How to see the source code of an overloaded stored procedure?

johansnjohansn Community Edition User

Hi, I have two stored procedures test() and test(x int) and I need to get the source code of only one of them.
select export_objects('', 'test'); returns the source code of both procedures, is there any way to differentiate them? I tried to write the procedure name in diffent ways, like 'test(int)' and 'test(x int)' but I have not found anything that works.

Answers

  • s_crossmans_crossman Vertica Employee Employee

    Looking into this. Definitely interesting as the export objects says the two items are a single row, so it doesn't know how ot differentiate them.

    VMart=> select export_objects('','raiseXY2');
    export_objects
    ------------------------------------------------------------------------------------------------------------CREATE PROCEDURE public.raiseXY2(x int, y varchar)
    LANGUAGE 'PL/vSQL'
    SECURITY INVOKER
    AS '
    BEGIN
    RAISE NOTICE ''x = %'', x;
    RAISE NOTICE ''y = %'', y;
    -- some processing statements
    END
    ';
    CREATE PROCEDURE public.raiseXY2(x int)
    LANGUAGE 'PL/vSQL'
    SECURITY INVOKER
    AS '
    BEGIN
    RAISE NOTICE ''x = %'', x;
    -- some processing statements
    END
    ';
    SELECT MARK_DESIGN_KSAFE(0);
    (1 row)

  • SruthiASruthiA Vertica Employee Administrator

    I have created a JIRA bug for the same.

    VER-84041
    Unable to export a single stored procedure when 2 procedures have same name but different arguments

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file