Fuangwith S.
Fuangwith S.

Reputation: 5764

How do we do a DBMS OUTPUT line in db2 (like you can in oracle)

In Oracle we can print output by dbms_output.put_line() but I don't know to do the same thing in DB2.

I currently use signal for printing some messages when I debug.

Upvotes: 1

Views: 6278

Answers (2)

Rashmi Pandit
Rashmi Pandit

Reputation: 23858

You can do:

select 'message' from sysibm.sysdummy1;

Upvotes: 1

Fred Sobotka
Fred Sobotka

Reputation: 5332

You could store a row in a permanent debug table or in a declared global temporary table (DGTT). You could also write a simple Java stored procedure that stores a line of text to a file.

When DB2 9.7 is released (sometime in June 2009) it will automatically come with the dbms_output feature as part of DB2's new "SQL dialect" support (a.k.a Oracle compatibility).

Upvotes: 1

Related Questions