Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Dynamic call to function ?
Hi !
Is there anybody who knows if it's possible to dynamically call a function and receive the correct return value from it ?
I've tried a bit but not managed to get to work, this is how I've done:
set serverout on size 10000
declare
procedure_ varchar2(200):='TEST_PKG.test';
statement_ varchar2(1000);
C integer;
count_ integer;
return_code_ number:=0;
begin
statement_ := 'BEGIN :rcode_ := '||procedure_||'; END;';
C := dbms_sql.open_cursor;
dbms_sql.parse( C, statement_, dbms_sql.native );
dbms_sql.bind_variable(C, 'rcode_', return_code_);
count_ := dbms_sql.execute( C );
dbms_sql.close_cursor( C );
dbms_output.put_line('return_code: '||return_code_);
end;
/
The function TEST_PKG.test returns the number 1, but the response from dbms_output is the number 0.
Is it possible to do this ?
regards,
// Magnus
Magnus Rosenquist
IFS Sweden AB
Received on Wed Dec 03 1997 - 00:00:00 CST