![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script needed | vpandey | Shell Programming and Scripting | 3 | 03-04-2008 05:45 AM |
| help needed! my first script | fcbarcelona1984 | Shell Programming and Scripting | 1 | 11-04-2007 08:32 AM |
| Script needed to FTP a file from sql report to unix server | vprevin | Shell Programming and Scripting | 0 | 10-30-2007 10:33 PM |
| please help me how to script atomatic remove file that are not needed | sunilnbalar | Shell Programming and Scripting | 1 | 08-23-2007 03:30 AM |
| Script Needed | Dastard | SUN Solaris | 1 | 03-20-2007 06:54 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Help needed in script and sql file
Hi all,
I have a script which takes in sqlfile as argument and executes the sql execSqlFile() { sqlFile=$1 sqlplus -S $DBLOG/$DBPWD@$DBSVR < $sqlFile } This works fine if the sql file is plain, simple and pre-defined statment. But i want to have a sql file which itself will take an argument What do i need to modify in my script? Please help! jak |
| Forum Sponsor | ||
|
|
|
|||
|
First you have to embed argument stubs into your script...
mysql.sql might be select x, z from t where x = $1 and z = $2; Obviously very simple example... then just pass arguments to script on command line... execSqlFile() { sqlFile=$1 arg1 = "abc" arg2 = "def" sqlplus -S $DBLOG/$DBPWD@$DBSVR < $sqlFile $arg1 $arg2 } It's that simple... |