473,385 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

equivalent of oracle's dbms_output.put_line in db2

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
5 12287
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jagdip Singh Ajimal | last post by:
I have a new VB 6 project, and I have successfully created a data environment that connects to my oracle server (they don't make this easy!!). In my oracle server, I have the following stored...
1
by: Philip Mette | last post by:
I am in a crunch and need to covert this Oracle statement to MSSQL. Is there any Oracle/MSSQL experts out there that can help me? I do not understand the syntax enough to modify this. Thanks so...
1
by: harp | last post by:
I created a stored procedure in oracle with the help of sql +plus: Set serveroutput on create or replace procedure spComp(company IN CHAR,oFname OUT CHAR, oFamname OUT CHAR, oAdr OUT CHAR,...
0
by: rsankpal | last post by:
CREATE OR REPLACE TYPE cust_address_t AS OBJECT ( street_address VARCHAR2(40), postal_code VARCHAR2(10), city VARCHAR2(30), state_province VARCHAR2(2), country_id VARCHAR(2));...
7
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g. Please help, I'm trying to write an ASP page to use ADO to run a long query against an Oracle 10g database, to create tables,...
1
by: rajanbabu23 | last post by:
PL/SQL "continue" keyword - This will allow a "C-Like" continue in a loop, skipping an iteration to bypass any "else" Boolean conditions. A nasty PL/SQL GOTO statement is no longer required to exit a...
4
by: Surek | last post by:
Hi, When i compile my stored procedure, my Oracle session automatically gets disconnected. Please find my procedure below. Can anyone help me in finding the solution? AM Using TOAD. CREATE OR...
0
debasisdas
by: debasisdas | last post by:
SAMPLE CODE TO SHOW USE OF REFCURSOR ======================================= EXAMPLE #1 ---------------------- declare --declare the fer cursor. type my_ref_cur_typ is ref cursor; --declare...
0
debasisdas
by: debasisdas | last post by:
Cursor Variable Returning %ROWTYPE ----------------------------------------------------------- DECLARE TYPE TmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE; tmp_cv TmpCurTyp;TYPE EmpCurTyp IS REF...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.