Home » RDBMS Server » Server Administration » how to pass variables into a sql script
how to pass variables into a sql script [message #371980] Fri, 29 December 2000 09:35 Go to next message
Charles Li
Messages: 2
Registered: December 2000
Junior Member
I want to pass the variable 's' to test.sql.
I have try to do the following, but its not working:
sqlplus app/passw@dev @test.sql 's'

Any ideas?

Thanks
Re: how to pass variables into a sql script [message #371981 is a reply to message #371980] Fri, 29 December 2000 13:13 Go to previous message
Bala
Messages: 205
Registered: November 1999
Senior Member
Hi,
in your test.sql script add
define variable1 = &1;

and then in your sql query use this vaiable1 like..
select c1, c2, c3... from t1
where c2 = &variable1

now you can pass the param outside the sql script
like....
SQL> @test.sql 's'

Bala.
Previous Topic: : How to calculating the max,min,avg of a column from a given query?
Next Topic: Primary Key Random Number
Goto Forum:
  


Current Time: Thu May 16 23:05:22 CDT 2024