Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scripts and stored procedures

Status
Not open for further replies.

sweetsgup

Programmer
Oct 22, 2000
6
MY
hi, thanks a lot richman for helping me with my doubt, i have another question, pls bear with me :) i was wondering if i can package some script files as well as .sql files together in a single commandfile and execute it? or do they have to be in seperate commandfiles? [sig][/sig]
 
hi , you can always write a shell script and embed any sql command in it.It may not be in a single command line.

Regards
[sig][/sig]
 
but i dont want to embed any commands, i want the script to be seperate from the sql statements but to be stored in a single file. i dont know if that is too far fetched but i would like to know if that can be done.
Thanks a lot for replying. [sig][/sig]
 
sweetsgup,

I don't exactly know what you are asking. Given that I will say (again in Unix) that you can have one command file that executes SQL in separate file(s). For example;

Note: DBNAME is your database name

echo "`date` This executes sql_file_1"
dbaccess DBNAME sql_file_1.sql
echo "`date` This executed sql_file_1"
.
.
echo "`date` This executes sql_file_2"
dbaccess DBNAME sql_file_2.sql
echo "`date` This executed sql_file_2"

and so on . . .
This is one command file executing 2 sql files residing outside of it.

Hope this helps!
 
Thanks a lot richman, i apologise for being vague but the last mail finally sunk in, i see the light :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top