-
How do I pass the value of a bind variable to a SQL plus variable? I tried the following way, but it does not work the way I want. I want the value of ENV_VAR=test_value_for_bind_variable.
SQL> var bind_var varchar2(100)
SQL> begin
2 :bind_var :='test_value_for_bind_variable';
3 end;
4 /
PL/SQL procedure successfully completed.
SQL> print :bind_var
test_value_for_bind_variable
SQL> define env_var=:bind_var
SQL> define env_var
DEFINE ENV_VAR = ":bind_var" (CHAR)
--This is not I want!
-
Hi,
Can you please elaborate your question.
When the going gets tough, the tough gets going
-
Use the new_value feature:
var myvar varchar2(30)
exec myvar := 'Hello'
col myvar new_value myvar
select :myvar myvar
from dual
/
select '&myvar'
from dual
/
-
Sorry, should read:
var myvar varchar2(30)
exec :myvar := 'Hello'
col myvar new_value myvar
select :myvar myvar
from dual
/
select '&myvar'
from dual
/
-
-
Can you execute OS command inside a PL/SQL?
Can you execute OS commands inside a PL/SQL procedure?
I know in SQL script, you can use HOST. How do you do this in PL/SQL?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|