Re: Using a variable in a select clause
Date: Tue, 03 Nov 1998 10:29:58 -0800
Message-ID: <363F4BA5.5AFBDCD4_at_iname.com>
Hi!
As I already told you yesterday there is only one way to do this. Use Dynamic SQL package (DBMS_SQL).
By performing folowing statement you can retrieve information about this package from DB
select text from all_source where name = 'DBMS_SQL';
Best regards,
Dennis.
dosberg7268_at_my-dejanews.com wrote:
> This didn't make sense on the first posting so lets try it again.
>
> I'm building a cursor to execute several actions inside of a procedure. But I
> need to retrieve a value from a dictionary table in order to do a SELECT..INTO
> statement. The part I'm having trouble with would look like this:
>
> Declare
> x Varchar2(25);
> s Varchar2(25);
> Begin
> x:='CustId';
> Select x into s from Orders Where OrderId = 1234;
> End;
>
> As I loop through the cursor I want to constantly be resetting X and insert a
> value into S. But the Select statement doesn't interpret the value of X as the
> literal string. I just get the value of X into the variable S. I figure there
> has got to be some way to do this. I would appreciate any advice.
>
> David Osberg
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Received on Tue Nov 03 1998 - 19:29:58 CET