I have Oracle Package named DEF , with 1 function inside named ABC that accept 1 string argument.
May I know how to call this function ABC directly in TOAD Editor?
Thanks in advance.
CREATE OR REPLACE PACKAGE HPQ_IF.def AS
FUNCTION def(p_sql IN VARCHAR2)
RETURN VARCHAR2;
END def;
/
FUNCTION abc(p_sql IN VARCHAR2)
RETURN VARCHAR2
IS
j NUMBER;
BEGIN
dbms_output.put_line(p_sql);
RETURN 'Done';
END abc;
Last error (using first answer below):
[Error] Execution (6: 31): ORA-06550: line 6, column 31:
PLS-00302: component 'abc' must be declared
ORA-06550: line 6, column 3:
PL/SQL: Statement ignored
In the TOAD SQL buffer:
If you don’t want to do anything with the return value other than display the information:
However, for a PL/SQL function to be called in SQL (SELECT, INSERT, etc), it must be free from certain side effects (ie. it can’t modify certain kinds of state within the database). To be called as a column in a SELECT, it must not modify the database (insert or update, for example), perform DDL, or commit a transaction.
You can also use Execute Procedure from within the Schema Browser.