I created a function in oracle that inserts records in specific tables and return an output according to what occurs within the function. e.g (ins_rec return number)
How do I call this function and see its output in sql plus
About calling a FUNCTION, you can use a PL/SQL block, with variables: SQL> create or replace function f( n IN number) return number is 2 begin 3 return n * 2; 4 end; 5 / Function created. SQL> declare 2 outNumber number; 3 begin 4 select f(10) 5 into outNumber 6 from dual; 7 -- 8 dbms_output.
declare x number; begin x := myfunc(myargs); end;
Alternatively:
select myfunc(myargs) from dual;
One option would be:
SET SERVEROUTPUT ON EXEC DBMS_OUTPUT.PUT_LINE(your_fn_name(your_fn_arguments));
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