COLUMN command with NEW_VALUE option can be used.
-- declare a bind variable
var bind_var varchar2(100)
-- assign it a value
begin
:bind_var :='order by name';
end;
/
--pass the value into substitution variable
COLUMN b_var_alias new_value subs_var
select :bind_var b_var_alias from dual;
select name from TEST &&subs_var;
No comments:
Post a Comment