On Wed, 27 Jan 1999, Medy Paridho wrote:
> Hi, Ari
> I am getting problem when I need some flexibility variables
>
> for example :
>
> var1 := name;
> var2 := age;
>
> select var1,var2
> from table
> where var2 > 20;
>
> that is a simple example but I dont know, How I must coding in Oracle
> programs ?
>
> Please help me
>
>
> Medy
>
It is not so simple. You can either use SQL to generate SQL, or dynamic
SQL.
Using SQL to generate SQL, you can spool to a file and then run the file.
Dynamic SQL is more complicated and you should read a PL/SQL book (it
would take pages of explanation).
You can also use the & in SQL*Plus:
select &var1, &var2 from table where &var2 > 20;
Each time you run the statement you will be prompted to enter values for
var1 and var2.
Best regards,
-Ari Kaplan
Independent Oracle DBA Consultant
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
<-> For 250+ Oracle tips, visit my Web Page: <->
<-> <->
<-> www.arikaplan.com <->
<-> <->
<-> email: akaplan@interaccess.com <->
<-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><-><->
Back to Ari Kaplan's Home Page