tags:

views:

231

answers:

3
+1  Q: 

DB2 Print analog

What's the DB2 Version of TSQL Print?

I've tried

Print 'TableName:X'

And

Select 'X' As 'TableName'
A: 

Uggh...DB2. My condolances. ;-)

I don't think that there is a PRINT command. Have a look here for a similar thread.

Aaron Alton
In other words "there's not one", thanks.
C. Ross
You can print using sysibm.sysdummy1 table.
Rashmi Pandit
A: 

Would VALUES 'Tablename=X' work for you?

+2  A: 

Use sysibm.sysdummy1. It is a dummy table you can use to print constants values. Print 'TableName:X' would be:

select 'TableName:X' from sysibm.sysdummy1;

And Select 'X' As 'TableName' would be:

select 'X' as TableName from sysibm.sysdummy1;

Similarly if you want to print the current date, etc you can use:

select current date FROM sysibm.sysdummy1;
Rashmi Pandit