Re: Dynamic SQL in Forms4.5

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Fri, 04 Dec 1998 04:14:51 GMT
Message-ID: <366f6174.5144647_at_192.86.155.100>


A copy of this was sent to srijay_at_my-dejanews.com (if that email address didn't require changing) On Thu, 03 Dec 1998 21:48:58 GMT, you wrote:

>Hi,
>
>Is there a way to run an SQL command within a form and display the result of
>that SQL in a form filed.
>
>eg:
>Form will retrieve the SQL select statment which is stored in a table1.col1,
>and put it on the form :BLK1.FIELD1. Then I want to run this SQL select
>statement and display the results in the form field.
>
> :BLK1.FIELD2 := SELECT USER FROM DUAL; -- this works!
>
> But the thing is 'select user from dual' is in the form variable
>:BLK1.FIELD1.
>
>Can I do the following:
>
> :BLK1.FIELD2 := EXEC SQL(:BLK1.FIELD1);
>

no, not in the way you describe but you can do this.

You want to look at the create_group_from_query and populate_group_from_query functions. You can use dynamic sql to populate a record group (sort of like a 2 dimensional array).

If that doesn't work for you -- you can look at dbms_sql as well.

>Thanks,
>Sri.
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/    -- downloadable utilities
 
----------------------------------------------------------------------------
Opinions are mine and do not necessarily reflect those of Oracle Corporation
 
Anti-Anti Spam Msg: if you want an answer emailed to you, 
you have to make it easy to get email to you.  Any bounced
email will be treated the same way i treat SPAM-- I delete it.
Received on Fri Dec 04 1998 - 05:14:51 CET

Original text of this message