How To Call a Stored Function with Parameters?
Submitted by: AdministratorYou can define a function that takes parameters, provide values to those parameters when calling the function. Here is a good example of a function with a parameter:
SQL> CREATE OR REPLACE FUNCTION GET_DOUBLE(X NUMBER)
2 RETURN NUMBER AS
3 BEGIN
4 RETURN X * 2;
5 END;
6 /
Function created.
SQL> SELECT GET_DOUBLE(36) FROM DUAL;
GET_DOUBLE(36)
--------------
72
Submitted by: Administrator
SQL> CREATE OR REPLACE FUNCTION GET_DOUBLE(X NUMBER)
2 RETURN NUMBER AS
3 BEGIN
4 RETURN X * 2;
5 END;
6 /
Function created.
SQL> SELECT GET_DOUBLE(36) FROM DUAL;
GET_DOUBLE(36)
--------------
72
Submitted by: Administrator
Read Online Oracle Database Job Interview Questions And Answers
Top Oracle Database Questions
☺ | How To Write Date and Time Interval Literals in Oracle? |
☺ | How To View the Dropped Tables in Your Recycle Bin? |
☺ | How Run SQL*Plus Commands That Are Stored in a Local File? |
☺ | How To Run SQL*Plus Commands in SQL Developer? |
☺ | How To Use Values from Other Tables in UPDATE Statements using Oracle? |
Top DB Oracle Categories
☺ | Oracle PL-SQL Interview Questions. |
☺ | Oracle DBA Interview Questions. |
☺ | Oracle D2K Interview Questions. |
☺ | OCI Interview Questions. |
☺ | Oracle RMAN Interview Questions. |