You can run SQL scripts in the Command Editor, DB2 command window in windows, or shell in Linux. Run the following SQL statement in the Windows DB2 command window or Linux Shell:
DB2-T-v-F script1. SQL-Z script1.log
Or:
DB2-tvf script1. SQL-Z script1.log
In the preceding command,
-T indicates that the statement uses the default statement Terminator-semicolon;
-V indicates that the lengthy mode is used, so that DB2 displays information about each command being executed;
-F indicates that it is a script file;
-Z indicates the information record file after it is used to record the output of the screen for future analysis (this is optional, but we recommend that you use this option ).
When the-T option is used without specifying the statement Terminator, the semicolon (;) is the statement Terminator by default. Sometimes there may be situations where another Terminator is used. For example, scripts written in SQL PL use other symbols instead of default semicolons, because a semicolon ends a statement used to define a database object in SQL Pl.