Stefan wrote:
Hi Knut,
thank you for your answer.
I'm a db2 beginner, so I have some problems with your answer.
My script is called like this:
su -root -c "db2 -tvf test.sql"
In the SQL-Script test.sql are about 10 sql-statements.
I think (2) sounds quit easy, but do you have a small example?
I would do this:
su -root -c "my_db2_script"
The content of "my_db2_script" would be:
------------------snip--------------------------
#!/bin/sh
VAR1=...
VAR2=...
db2 "connect to database"
db2 "first sql statement using ${VAR1}"
db2 "second sql statement"
db2 "another sql statement using ${VAR2}"
db2 "connect reset"
------------------snip--------------------------
--
Knut Stolze
DB2 Information Integration Development
IBM Germany