469,327 Members | 1,242 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

db2 print message within procedure

Hi all :)

I like to be able to print messages throughout my long procedure statement.

I can currently use "!echo my message@" outside of my procedure BUT not able to figure out how to do this inside the procedure.

Any help would be greatly appreciated.

Mar 14 '08 #1
3 18425
127 Expert 100+
You cannot print directly to standard output device from a stored procedure. However, you can redirect your output to a file. Again, this is possible only if your stored procedure definition is written in a language than SQL/PL.

You can implement file handling.

By the way, what do you want to achieve from doing this?

-- Sanjay
Mar 19 '08 #2
297 Expert 100+

Deniz, as far as I can guess you'd like to echo some debug messages, like "stored procedure at point 3", right?

Now that a direct output isn't possible (Thanks Sanjay, I wouldn't have known), I suggest another approach. Create a separate table "debugtext" with columns (when datestamp, txt varchar(255)) and insert your messages into it while inside the stored procedure:

Expand|Select|Wrap|Line Numbers
  2.   debugtext
  4.   ( current_datestamp, 'stored proc at point 7' );
Sanjay, this should be possible, shouldn't it?


Mar 20 '08 #3
127 Expert 100+
Yes Bernd, this is possible............

-- Sanjay
Mar 20 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Khalid Hussain | last post: by
6 posts views Thread by Wim van Rosmalen | last post: by
2 posts views Thread by GUILLAUME LECOMTE | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by listenups61195 | last post: by
reply views Thread by Purva khokhar | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.