Skip to Main Content

Breadcrumb

May 4th

Question and Answer

Chris Saxon

Thanks for the question, Dusko.

Asked: January 25, 2023 - 11:08 pm UTC

Last updated: January 26, 2023 - 1:36 pm UTC

Version: oracle live sql

Viewed 1000+ times

You Asked

Dear Tom,

how can I create bind variable in Oracle Live SQL,

<variable variable_name data_type;>

example <variable dusko number;> 


just doesn't work, i get "Ussuported command" message...


Thanks and best regards

with LiveSQL Test Case:

and Chris said...

Well, as the output says, these are unsupported!

Note that PL/SQL variables in SQL are bind variables. So depending on what you're trying to do you can "use bind variables" by placing the query in a PL/SQL block.

For example:
declare
  var int;
begin
  select ...
  where  col = var;
end;


In this instance, VAR is a bind variable for the query. If you explain in more detail why you want to use bind variables we may be able to help with other options.

In general - if you have comments or suggestions for Live SQL, please use the feedback option on that site.

Is this answer out of date? If it is, please let us know via a Comment

More to Explore

SQL

The Oracle documentation contains a complete SQL reference.