编码:
SET SERVEROUTPUT ON;
declare count_t integer : = 0;
BEGIN
CALL DBMS_OUTPUT.PUT_LINE ( 'Hello' );
CALL DBMS_OUTPUT.PUT_LINE ( 'count_t-' || count_t );
END;
无法在DB2中执行。错误:
[Code: -104, SQL State: 42601] An unexpected token "SERVEROUTPUT" was found following "SET ". Expected tokens may include: "SSA".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.28.11
而且还
[Code: -104, SQL State: 42601] An unexpected token "declare count_t integer" was found following "BEGIN-OF-STATEMENT". Expected tokens may include: "<select>".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.28.11
1条答案
按热度按时间pwuypxnk1#
您必须使用不同的语句分隔符/终止符来运行复合语句。
每个客户端工具都有自己的设置方法。
数据库可视化工具:
Using the DBMS Output Tab:
仅适用于DbVisualizer DbVisualizer专业版。
此功能仅在DbVisualizer Pro版中可用。