how do you create a stored procedure with a simple select (SELECT * FROM TABLE) using Oracle? Also, any good tutorials on stored procedures would help tremendously.
Thanks.
We can not directly use stored procedures in a SELECT statement.
Yes, we can create trigger like functionality on select statement like, which user has select which table and most importantly what sql query�issued by using dbms_fga built in package. just check it out.
You can make the use of the SELECT INTO statement in PL/ SQL to retrieve the row containing single or multiple column values in the resultant for storing them in variables.
create or replace procedure spr_select_Emp(eno in number, employee out emp%RowType)
As
Begin
Select empno,ename,mgrno,hiredate,sal,comm,deptno into employee from emp
where empno=eno
End;
It depends on what you're trying to return from the stored procedure (resultset vs. scalar value) and what version of Oracle you're on (newer versions make this easier).
This question is probably a dupe of Get resultset from oracle stored procedure.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With