Skip to main content
Question

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

  • October 19, 2022
  • 2 replies
  • 9 views

johansn

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.

2 replies

s_crossman
Forum|alt.badge.img
  • Participating Frequently
  • October 20, 2022

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)


SruthiA
Forum|alt.badge.img+1
  • Participating Frequently
  • October 21, 2022

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