snippetMinor
How to get return value from pl sql procedure and assign it to variable?
Viewed 0 times
returnsqlvalueproceduregethowandfromvariableassign
Problem
Code:
Its my procedure.
How to get return value from this proc and assign it to variable ?
execute x.procedurename(row.accc_no, row.bill_no, 0, null, row.total_balance, 'A',assgn_scen_site_cv, :assgn_scen_site_cv);Its my procedure.
How to get return value from this proc and assign it to variable ?
Solution
You can create it like this:
And then use it like this:
You can look at CREATE PROCEDURE documentation at Oracle website.
CREATE OR REPLACE PROCEDURE procedurename(param1 NUMBER, param2 varchar(20), returnvalue OUT NUMBER);
IS
BEGIN
... your code
END;And then use it like this:
returnvalue NUMBER;
procedurename(0, 'xxx', returnvalue);
dbms_output.putline(returnvalue);You can look at CREATE PROCEDURE documentation at Oracle website.
Code Snippets
CREATE OR REPLACE PROCEDURE procedurename(param1 NUMBER, param2 varchar(20), returnvalue OUT NUMBER);
IS
BEGIN
... your code
END;returnvalue NUMBER;
procedurename(0, 'xxx', returnvalue);
dbms_output.putline(returnvalue);Context
StackExchange Database Administrators Q#123803, answer score: 4
Revisions (0)
No revisions yet.