By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,610 Members | 2,310 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,610 IT Pros & Developers. It's quick & easy.

equivalent of oracle's dbms_output.put_line in db2

P: n/a
nsd
Is there any equivalent of oracle's dbms_output.put_line in db2?
Pl. let me know if any..
regards,
nsd

Nov 12 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
nsd wrote:
Is there any equivalent of oracle's dbms_output.put_line in db2?
Pl. let me know if any..


What's this function doing in Oracle?

To write some data to a file, you could roll your own UDF in DB2 like shown
here:
http://www-128.ibm.com/developerwork...0302izuha.html

or here:

http://www-128.ibm.com/developerwork...303stolze.html

--
Knut Stolze
Information Integration Development
IBM Germany / University of Jena
Nov 12 '05 #2

P: n/a
nsd
Hi,

If that is a question put on me, the answer is

In ORACLE the function dbms_output.put_line(" Hi thanks for ur reply" )

when used inside a function or a procedure
displays the string "Hi thanks for ur reply"
in the screen on completion of execution of the code.

regards,
nsd

Nov 12 '05 #3

P: n/a
nsd wrote:
Hi,

If that is a question put on me, the answer is

In ORACLE the function dbms_output.put_line(" Hi thanks for ur reply" )

when used inside a function or a procedure
displays the string "Hi thanks for ur reply"
in the screen on completion of execution of the code.


Stupid question maybe but what do you need that for. Assuming you have some
sort of application talking to the database server, what could you do with
such an output?

--
Knut Stolze
Information Integration Development
IBM Germany / University of Jena
Nov 12 '05 #4

P: n/a
nsd wrote:
Hi,

If that is a question put on me, the answer is

In ORACLE the function dbms_output.put_line(" Hi thanks for ur reply" )

when used inside a function or a procedure
displays the string "Hi thanks for ur reply"
in the screen on completion of execution of the code.

The common way to achieve this in DB2 is to use a DECLARED GLOBAL
TEMPORARY TABLE. INSERT INTO the TEMP for put_line.
Then you can either SELECT after the proc is done, or you can just open
a resultset.
If you are hung up on the names this logic can be easily encapuslated
into a couple of procedures.

To answer Knut's question: This is done in Oracle either for debugging
(tracing (see developer works) is much bettr IMHO) or to compose reports.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
Nov 12 '05 #5

P: n/a
nsd,

I am not sure it is that simple what you are looking for, but did you try
values()?
a call like
db2 > values('Have a nice day')

will return the string 'Have a nice day' like a one row result set.

Juliane.
--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums....m-db2/200508/1
Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.