Anandhakrishnan
Anandhakrishnan

Reputation: 548

How do I call an Oracle SQL procedure from the command line?

How do I call an Oracle stored procedure with parameters?

It has one input and one output parameter, and looks like doSomething(IN x,OUT y);.

How do I call it from the command line?

Upvotes: 3

Views: 35097

Answers (2)

SNAG
SNAG

Reputation: 2113

try this

BEGIN
var v_outparam1 number;
var v_outparam2 number;
exec myProc(v_outparam1,v_outparam1);
END;
/

Upvotes: 3

user330315
user330315

Reputation:

Assuming SQL*Plus:

var v_result number
exec doSomething(42, :v_result);
print v_result

You can put that into a SQL script and pass that on the commandline to SQL*Plus.

Upvotes: 6

Related Questions