Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i call pl/sql stored procedure (function, returning number value)?

I'm using Oracle SQL developer, or Oracle SQL* Plus

like image 214
Mattan Avatar asked Oct 31 '10 10:10

Mattan


People also ask

How do you return a value from a procedure in PL SQL?

your code END; And then use it like this: returnvalue NUMBER; procedurename(0, 'xxx', returnvalue); dbms_output. putline(returnvalue);

Can stored procedure return a value?

A stored procedure does not have a return value but can optionally take input, output, or input-output parameters.

How do you call a procedure or function in PL SQL?

Select (highlight) the code for creating the procedure or function, then click the Run button to create the procedure or function. Select (highlight) the code for calling the procedure or function, then click the Run button to call the procedure or function.

Which keyword is used to return a value from a PL SQL procedure?

RETURN. RETURN is the keyword that instructs the compiler to switch the control from the subprogram to the calling statement. In subprogram RETURN simply means that the control needs to exit from the subprogram. Once the controller finds RETURN keyword in the subprogram, the code after this will be skipped.


1 Answers

In SQL Plus you can do this:

var x number
exec :x := myfunction();

Or you may be able to use SQL:

select myfunction() from dual;
like image 68
Tony Andrews Avatar answered Sep 24 '22 21:09

Tony Andrews