The UNIX Forums
"Join the Network of UNIX System Users"


 
Subject: passing unix variable to sqlplus without a file name
johno12345
Newbie
Rank: 1



UID 9
Digest Posts 0
Credits 0
Posts 25
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 4, 2007 08:18 AM  Profile | P.M. 
passing unix variable to sqlplus without a file name



passing unix variable to sqlplus without a file name



hi,
i want to input unix variable to sqlplus.the following is working fine
sqlplus username/password @dummy.sql param1 param2 << eof
create user $1 identified by $2;
eof

but i dont want any file name to be passed,i just want to pass the parameter. is there any way to that??


thanks


Top
8everything
Newbie
Rank: 1



UID 32
Digest Posts 0
Credits 0
Posts 38
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 4, 2007 08:18 AM  Profile | P.M. 
replace $ by &&
Top
combat
Newbie
Rank: 1



UID 93
Digest Posts 0
Credits 0
Posts 71
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 4, 2007 08:18 AM  Profile | P.M. 
some errors are coming



i tried that &&;
sqlplus -s -l $dbausername/$dbapwd $1 $password <<eof
create user &&1 identified by &&2;
grant create session to &&1;
exit;
eof

still ,it's giving some errors...

can someone help me??
Top
Adriaan1985
Newbie
Rank: 1



UID 38
Digest Posts 0
Credits 0
Posts 15
Reading Access 10
Registered Apr 25, 2007
Status Offline
Post at Jun 4, 2007 08:19 AM  Profile | P.M. 
i got it ...
--- $1 $password already there..
sqlplus -s -l $dbausername/$dbapwd <<eof
create user $1 identified by $password;
grant create session to $1;
exit;
eof

simple naaa...some times these small things we ll spend more times
Top
 

 

All times are GMT, the time now is Jul 31, 2010 03:42 AM

Powered by Discuz! 5.0.0  © 2001-2006 UNIX Forums
Processed in 0.005469 second(s), 8 queries

Clear Cookies - Contact Us - UNIX Help - Archiver - WAP