WEB开发网
开发学院数据库DB2 DB2 v7.2 中的高级 SQL 过程脚本编制 阅读

DB2 v7.2 中的高级 SQL 过程脚本编制

 2008-09-09 16:30:15 来源:WEB开发网   
核心提示: 在上面的输出中,成功执行了脚本,DB2 v7.2 中的高级 SQL 过程脚本编制(5),但我们注意到屏幕输出不同于日志文件(output.log)的输出,用粗体突出显示了这些差别,请注意最后一句由下面 DB2 的 VALUES 语句发出的注释:This will get written t

在上面的输出中,成功执行了脚本,但我们注意到屏幕输出不同于日志文件(output.log)的输出。用粗体突出显示了这些差别,并且它们都是用感叹号(!)作为前缀的 OS“echo”命令。因为那些命令都在 OS 级别上执行,而不是由 DB2 执行,所以没有通过 -z 标志记录它们的输出。

请注意最后一句由下面 DB2 的 VALUES 语句发出的注释:

This will get written to the screen AND log file

被同时写到屏幕和日志文件,因为这个命令是由 DB2,而不是 OS 执行的。

下面是当脚本在星期三运行时相对应的屏幕和日志文件的结果:

屏幕输出 日志文件输出 beginning complex.db2
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0438N Application raised error with diagnostic text: "Script is for MON & FRI only!" SQLSTATE=80000
Retrieving from HELLO table..
MYCOL
--------------------
0 record(s) selected.
Cleaning up...
SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000
This will get written to screen, but not to log file
1
-----------------------------------
This will get written to the screen AND log file
1 record(s) selected.
 DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0438N Application raised error with diagnostic text: "Script is for MON & FRI only!" SQLSTATE=80000
MYCOL
--------------------
0 record(s) selected.
SQL0100W No row was found for FETCH, UPDATE or DELETE; or the result of a query is an empty table. SQLSTATE=02000
1
-----------------------------------
This will get written to the screen AND log file
1 record(s) selected.

上一页  1 2 3 4 5 6 7 8 9 10  下一页

Tags:DB 高级 SQL

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接