Running Sql scripts accross db2

Hi,

I would be really thankful, if anyone could help me out with this,since i am very new to this shell scripting.
I have 6 sql scripts that i am trying to run in unix across db2.
i want the scripts to be executed as follows,
script_1 should be executed first.
Then script_2,script_3,script_4,script_5 should be executed simultaneously.
Once, after all these are done with execution, i need to execute script_6

Thanks in advance,
Ridley.

below is the code which will execute the sql command/existing .sql files in oracle. before doing this you have to provide the ORAUSER, ORAPWD and SPOOLFILE. This should be in the path where you having all the 6 .sql sciprt files. Try and let me know.

ORAUSER="oracle_username"
ORAPWD="oracle_password"
SPOOLFILE="spool filename"
 
sqlplus -s $ORAUSER/$ORAPWD >/dev/null <<!
        set show off
        set term off
        set termout off
        set trimspool on
        set verify off
        set feedback off
        set pagesize 0
        set long 2048
        set longchunksize 2048
        set linesize 2048
        set trimspool on
        set trim on
        SPOOL $SPOOLFILE
        @script1.sql
        @script2.sql
        @script3.sql
        @script4.sql
        @script5.sql
        @script6.sql
        SPOOL OFF;
!

sry.., but i need to run this across db2

Assuming your sql scripts are @ delimited
You might want to provide full path for db2 command,
#!/bin/ksh
db2 -td@ -vf script_1
db2 -td@ -vf script_2 &
db2 -td@ -vf script_3 &
db2 -td@ -vf script_4 &
db2 -td@ -vf script_5 &
wait
db2 -td@ -vf script_6

Is this what you are looking for ?

or you can just use
read sql script into a string variable sqltext,
db2 -x +w <sqltext>