How to execute sql file via command line for DB2

by

You can save a .sql file to your hard drive, and execute it using the DB2 command line using:

db2 -vtf C:\path\to\test.sql

-v echoes the command text back to the command line

-t sets the statement terminator to ;.

-f tells the command line to load the commands from the file.

See other command line options, http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/topic/com.ibm.db2.luw.admin.cmd.doc/doc/r0010410.html.

from: http://stackoverflow.com/questions/17834343/how-to-create-batch-file-to-execute-multiple-db2-queries