Home » Developer & Programmer » Reports & Discoverer » execute immediate in Oracle 10g reports?
execute immediate in Oracle 10g reports? [message #117612] Thu, 28 April 2005 09:23 Go to next message
jsg1
Messages: 8
Registered: April 2005
Junior Member
Can i use execute immediate in a function within a library for oracle 10g reports?

i.e.

execute immediate 'SELECT ' || p_vc2_seq_name || '_' ||p_vc2_report_id ||'.NEXTVAL FROM dual' into l_n_seq_no;

When I compile the above within a Program unit in reports - I get message -

Error 591 at line x, column y
this feature is not supported in client-side programs

If I cannot do the above - any suggestions would be appreciated on how to execute the above select statement.
Re: execute immediate in Oracle 10g reports? [message #118142 is a reply to message #117612] Tue, 03 May 2005 04:48 Go to previous messageGo to next message
jsg1
Messages: 8
Registered: April 2005
Junior Member
Can anyone help me please?
Re: execute immediate in Oracle 10g reports? [message #118159 is a reply to message #118142] Tue, 03 May 2005 06:48 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Normally, you would create a function on the database and make a simple call. That's a lot easier...

But you can use DBMS_SQL I believe. EXECUTE IMMEDIATE is only supported on the server side.

MHE
Re: execute immediate in Oracle 10g reports? [message #118174 is a reply to message #118159] Tue, 03 May 2005 08:33 Go to previous messageGo to next message
jsg1
Messages: 8
Registered: April 2005
Junior Member
Thanks.

I have tried DMBS_SQL within Oracle 10g reports -

l_vc2_sql_text := 'SELECT ' || p_vc2_seq_name || '_' ||p_vc2_report_id ||'.NEXTVAL FROM dual';
l_n_cursor_id := dbms_sql.open_cursor;
dbms_sql.parse(l_n_cursor_id, l_vc2_sql_text,dbms_sql.native);
l_n_seq_no := dbms_sql.EXECUTE(l_n_cursor_id);
dbms_sql.close_cursor(l_n_cursor_id);

but unable to compile due to the following -

'Implementation restriction 'DBMS_SQL.NATIVE': cannot directly access remote package variable or cursor'

Can anyone help me to solve the above problem within a reports Libaary?

jsg1
Re: execute immediate in Oracle 10g reports? [message #118181 is a reply to message #118174] Tue, 03 May 2005 09:22 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Replace the 'DBMS_SQL.NATIVE' by the numeric literal 1:
 dbms_sql.parse(l_n_cursor_id, l_vc2_sql_text, 1);


MHE
Re: execute immediate in Oracle 10g reports? [message #118188 is a reply to message #118181] Tue, 03 May 2005 09:49 Go to previous messageGo to next message
jsg1
Messages: 8
Registered: April 2005
Junior Member
Brillant - It works.

Thanks MHE.
Re: execute immediate in Oracle 10g reports? [message #118276 is a reply to message #118188] Wed, 04 May 2005 02:01 Go to previous message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Yes, it's a little trick. Forms cannot address the package constant 'NATIVE' in the package 'DBMS_SQL' directly. The value of this constant is 1.

MHE
Previous Topic: Oracle Reports on GERs
Next Topic: reports with 2 vertical panels
Goto Forum:
  


Current Time: Thu Apr 25 08:23:14 CDT 2024