Oracle Stored Procedures Hello World Examples
Oracle Stored Procedures Hello World Examples
END;
/
Run it
exec procPrintHelloWorld;
Output
Hello World!
END;
/
Run it
exec procOneINParameter('mkyong');
Output
END;
/
Run it
DECLARE
outParam1 VARCHAR2(100);
BEGIN
procOneOUTParameter(outParam1);
DBMS_OUTPUT.PUT_LINE(outParam1);
END;
/
Output
END;
/
Run it
DECLARE
genericParam VARCHAR2(100) := 'mkyong';
BEGIN
procOneINOUTParameter(genericParam);
DBMS_OUTPUT.PUT_LINE(genericParam);
END;
/
Output
END;
/
Run it
DECLARE
dbUserCursor SYS_REFCURSOR;
dbUserTable DBUSER%ROWTYPE;
BEGIN
procCursorExample(dbUserCursor,'mkyong');
LOOP
END LOOP;
CLOSE dbUserCursor;
END;
/
Output
Reference
1. http://www.oradev.com/ref_cursor.jsp
2. http://psoug.org/reference/procedures.html
3. http://www.devshed.com/c/a/Oracle/Working-with-REF-CURSOR-in-PL-SQL/
4. http://www.codeproject.com/KB/database/Oracle_RefCursor_ADO_C__.aspx
Related Articles
- Oracle Stored Procedure UPDATE example
- Oracle Stored Procedure DELETE example
- Oracle Stored Procedure Cursor example
- Oracle Stored Procedure SELECT INTO example
- JDBC CallableStatement – Stored Procedure OUT pa
mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my
tutorials, consider make a donation to these charities.
3000
{}
Most Voted
15 COMMENTS
Thanks..
0 Reply
Thanks
-1 Reply
in sql cmd prompt after creating the basic procedure, when we run it with “exec procedure_name” getting output as “PL/SQL
procedure successfully completed” not displaying the message given inside.
-1 Reply
0 Reply
-1 Reply
Could you please tell me which command should we use to execute example no-3(hello world +Out parameter)
-1 Reply
0 Reply
END SP_Fill_Municipios;
DECLARE
C_DBUSER SYS_REFCURSOR;
temp_dbuser MUNICIPIOS%ROWTYPE;
BEGIN
SP_Fill_Municipios(1,C_DBUSER);
LOOP
END LOOP;
CLOSE C_DBUSER;
END;
-1 Reply
-1 Reply
Easy learning
-1 Reply
Thank you
-2 Reply
Thank you.
-2 Reply
no work’s 🙁
PL/SQL procedure successfully completed.
-2 Reply