Dear All,
I'm trying to write a batch file executing some sql statements (drop database, create database ...) in DB2 and the database name is a parameter.
1. I have 2 files: run.bat and script.sql
---run.bat--
db2cmd db2 -f script.sql
---script.sql---
drop database mydb
create database mydb
connect to mydb user myuser using mypwd
...
How can I pass variable (mydb...) into script.sql from run.bat?
2. I include the sql statements within run.bat like below
---run.bat---
db2cmd -c -w -i db2 drop database mydb db2 create database mydb ...
But it seems not able to execute more than 1 sql statement. How can I run many sql statements?
I'm using DB2 8.1
Thanks for your reading
