![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Call sqlplus in the shell script | beaniebear | Shell Programming and Scripting | 3 | 05-13-2008 06:30 AM |
| how can i call sqlplus? | theodore | HP-UX | 13 | 04-25-2008 11:01 AM |
| how to differentiate system call from library call | muru | UNIX for Advanced & Expert Users | 2 | 07-19-2007 08:20 PM |
| Sqlplus | LiquidChild | Shell Programming and Scripting | 9 | 06-01-2007 08:22 AM |
| Sqlplus | antkiu | Shell Programming and Scripting | 4 | 09-13-2006 09:36 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
sqlplus call
I have a .sh file which acts as an all set for a couple of oracle scripts i want to call. Basically it has 3 variables, the user Id, the password, and the oracle instance to connect to.. the problem is I cant seem to get the connection string format properly.. the program essentially is this:
----------------------- SYSTEM_UID=SYSTEM SYSTEM_PWD=SYSTEM DATABASE=myDatabase CREATEUSERCMD="sqlplus ${SYSTEM_UID}/${SYSTEM_PWD}@${DATABASE}" echo Printing user Id: ${SYSTEM_UID} echo Printing pwd: ${SYSTEM_PWD} echo Printing db: ${DATABASE} echo Printing connection string: ${CREATEUSERCMD} ---------------------------- Resulting output I get is: $ bash allset.sh Printing user Id: SYSTEM Printing pwd: SYSTEM Printing db: myDatabase @myDatabasennection string: sqlplus SYSTEM Am I resolving those slashes and ampersands incorrectly? Or is there an issue with the way I'm referencing those variables? If I hard code the connection string as: CREATEUSERCMD='sqlplus SYSTEM/SYSTEM@myDatabase' and then just call : ${CREATEUSERCMD} it works fine. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Depends on what you are trying to do. For example
Code:
SQL_RESULT=`sqlplus -s "${USERID}/${PASSWORD}@${ORA_SID}" << EOF
-- sqlplus commands here...
exit
EOF`
echo "$SQL_RESULT" to see the result. |
|||
| Google The UNIX and Linux Forums |