sql - accessing a bind variable in sqlplus -


In the following example,

  variable record ID number; Initially select the record (record value); End; Print records; Where else do thermal record from SELECT * & amp; Record id;  

The last line selection statement can not reach the value of the record. I know that I can use recordId inside the PL / SKL block: record ID but Is there a way to access recordId in a SQL statement which is not in the PL / SKL block? (As in the last line). You can also use the bind variable in the SQL * plus, : recordId / Code>. & amp; The version will prompt for a value, and there will be no direct link with the variable version.

  variable record ID number; Initially select the maximum (record value): Record for some time; End; / Print records; SELECT * with some more thermal record =: record id;  

A slightly more common way to assign values ​​to bind the variable is exec: recordId: = value; , but exec is actually a random block for an anonymous block anyway.

Of course you want to mix and match like this. If you want to use the result of any one query in one of the following, you can try new_value instead:

  column x_val new_value y_val; - If you do not need to look at the intermediate value of MAX (record value) x_val for some time, even then Noptr may be; Select * Some more thermal from where record = & amp; Y_val;  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -