usql icon indicating copy to clipboard operation
usql copied to clipboard

oracle procedure

Open JuchangGit opened this issue 2 years ago • 3 comments

Can you give an example of how a stored procedure is executed?

JuchangGit avatar Dec 30 '21 10:12 JuchangGit

Executing a stored procedure is probably not possible at the moment. usql can be used to define schemas, stored procedures, views, etc. on Oracle (simply escape ; as \;):

CREATE PROCEDURE a_0_in_1_out(a_return OUT INTEGER) AS
BEGIN
  SELECT 10 INTO a_return FROM dual\;
END\;;

However, I am not sure if it's possible to actually call a stored procedure at the moment, as it requires creating/declaring variables for storing out values and then returning that. I'm not sure if the Go drivers in usql (godror and ora) currently support this, in a way that would work with usql. I'll try to see if I can figure out a way for this. For now, I'd suggest using sqlplus if you need a command-line to retrieve values from a stored procedure.

kenshaw avatar Dec 31 '21 02:12 kenshaw

Ok, thank you

JuchangGit avatar Jan 04 '22 05:01 JuchangGit

Hello.

Any news about this?

We want to execute a procedure without variables.

Is it possible to just run this command:

exec procedure_name;

via usql?

MichalisDBA avatar Jun 24 '22 07:06 MichalisDBA