dbTalk Databases Forums  

value expansion using binding variables?

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss value expansion using binding variables? in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
geos
 
Posts: n/a

Default value expansion using binding variables? - 08-22-2011 , 04:12 PM






hello, in pl/sql code I have defined a variable:

x varchar2(100) := 'do not :1';

is it possible to change the value of x to 'do not eat' with execute
immediate and using 'eat' clauses? if so, how can it be done? if not,
why not and what are the alternatives to accomplish this?

thank you,
geos

ps. Follow-up to comp.databases.oracle.misc

Reply With Quote
  #2  
Old   
John Hurley
 
Posts: n/a

Default Re: value expansion using binding variables? - 08-22-2011 , 05:20 PM






On Aug 22, 5:12*pm, geos <g... (AT) nowhere (DOT) invalid> wrote:
Quote:
hello, in pl/sql code I have defined a variable:

x varchar2(100) := 'do not :1';

is it possible to change the value of x to 'do not eat' with execute
immediate and using 'eat' clauses? if so, how can it be done? if not,
why not and what are the alternatives to accomplish this?

thank you,
geos

ps. Follow-up to comp.databases.oracle.misc
Looks like you do not yet have a good understanding of what a bind
variable is. Here are a couple of things found using google:

http://www.akadia.com/services/ora_bind_variables.html

http://www.oracle-base.com/articles/...dVariables.php

Reply With Quote
  #3  
Old   
Mark D Powell
 
Posts: n/a

Default Re: value expansion using binding variables? - 08-24-2011 , 09:04 AM



On Aug 22, 5:12*pm, geos <g... (AT) nowhere (DOT) invalid> wrote:
Quote:
hello, in pl/sql code I have defined a variable:

x varchar2(100) := 'do not :1';

is it possible to change the value of x to 'do not eat' with execute
immediate and using 'eat' clauses? if so, how can it be done? if not,
why not and what are the alternatives to accomplish this?

thank you,
geos

ps. Follow-up to comp.databases.oracle.misc
To change a pl/sql variable value you just assign it a new value in an
assignment statement:

begin
.... other code
x := 'do not eat';
.... more code
end;

You use execute immediate to perform dynamic SQL, not to execute pl/
sql statements.

HTH -- Mark D Powell --

Reply With Quote
  #4  
Old   
geos
 
Posts: n/a

Default Re: value expansion using binding variables? - 08-25-2011 , 03:34 PM



thanks for both answers!

geos

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.