Oct 27, 2004 #1 2314 Programmer Joined May 19, 2001 Messages 69 Location IN how i i execute a stored procedure from sql*plus which gives a return value
Oct 27, 2004 #2 lewisp Programmer Joined Aug 5, 2001 Messages 1,238 Location GB Is it a procedure or a function? If a function, you could try Code: set serveroutput on declare x varchar2(255); -- or whatever your return type is begin x := your_function; dbms_output.put_line(x); END; / If the code is a procedure with an OUT parameter, change the first line of code to [tt]your_function(x);[/tt] ...although I'm sure theres a more elegant solution. Upvote 0 Downvote
Is it a procedure or a function? If a function, you could try Code: set serveroutput on declare x varchar2(255); -- or whatever your return type is begin x := your_function; dbms_output.put_line(x); END; / If the code is a procedure with an OUT parameter, change the first line of code to [tt]your_function(x);[/tt] ...although I'm sure theres a more elegant solution.
Oct 27, 2004 #3 sem Programmer Joined Jun 3, 2000 Messages 4,709 Location UA Or Code: VAR result VARCHAR2(4000) EXEC :result := function(parameters) PRINT result Or if your function doesn't modify database just: Code: select function(parameters) from dual; BTW in Oracle and many other languages procedure returning a value is called function. Regards, Dima http://seminihin.narod.ru Upvote 0 Downvote
Or Code: VAR result VARCHAR2(4000) EXEC :result := function(parameters) PRINT result Or if your function doesn't modify database just: Code: select function(parameters) from dual; BTW in Oracle and many other languages procedure returning a value is called function. Regards, Dima http://seminihin.narod.ru