Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / January 2007

Tip: Looking for answers? Try searching our database.

Stored Procedure output into File

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
VK - 26 Jan 2007 20:11 GMT
Hello,
Can some one suggest me a way of putting Stored procedure output into a
file, the file should be available on my Computer, I don't want to use
FTP process.
Thanks
vk
VK - 26 Jan 2007 20:14 GMT
Just any update, am using DB2 UDB V8.0

> Hello,
> Can some one suggest me a way of putting Stored procedure output into a
> file, the file should be available on my Computer, I don't want to use
> FTP process.
> Thanks
>  vk
Serge Rielau - 26 Jan 2007 20:27 GMT
> Just any update, am using DB2 UDB V8.0
>
[quoted text clipped - 4 lines]
>> Thanks
>>  vk

You mean like this?
db2 "call proc(...)" > file.txt

Cheers
Serge

Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

VK - 26 Jan 2007 21:32 GMT
Hello

say my SP have "Select * from table1" SQL statment... I wanted the out
put of the SQL into a file, and how do I get the file created in DB
server to my system. I have no FTP access.

> > Just any update, am using DB2 UDB V8.0
>
[quoted text clipped - 13 lines]
> DB2 Solutions Development
> IBM Toronto Lab
Serge Rielau - 26 Jan 2007 22:27 GMT
> Hello
>
> say my SP have "Select * from table1" SQL statment... I wanted the out
> put of the SQL into a file, and how do I get the file created in DB
> server to my system. I have no FTP access.
INSERT the query result into a DECLARE GLOBAL TEMPORARY TABLE.
When the procedure has finished you can select from the temp table and
store in a file on your client as I have shown or via EXPORT.

Cheers
Serge

Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

Philip Nelson - 29 Jan 2007 13:15 GMT
>> Hello
>>
[quoted text clipped - 7 lines]
> Cheers
> Serge

Reading between the lines, I expect what VK is looking for is a function
within SQL/PL which would allow him to write output from within the SP to a
file.   This is commonly done in Oracle PL/SQL for debugging purposes.

I remember being this discussed at a Viper briefing I attended.   It isn't,
AFAIK, possible yet.   There was talk of making it available to aid
porting.  

I, for one, am against the idea as it means that certain elements of the SP
are then treated outside the Unit of Work (and hence don't get rolled back
in the event of a failure).  

In my investigations into developing DB2Unit I would dearly have loved this
functionality : but then came to realise how dangerous it could be.   I
then looked for alternative ways of getting test outputs back, and came up
with a second process running the checks "WITH UR".

As Serge has already said you can return information from a GTT, as long as
you aren't rolling everything back beforehand.

Phil
Serge Rielau - 29 Jan 2007 14:17 GMT
>>> Hello
>>>
[quoted text clipped - 29 lines]
>
> Phil
DGTT support "NOT LOGGED ON ROLLBACK PRESERVE ROWS". I had it added to
support tracing in SQL Procedures.

Cheers
Serge

Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

Philip Nelson - 29 Jan 2007 23:40 GMT
>>>> Hello
>>>>
[quoted text clipped - 37 lines]
> Cheers
> Serge

Thanks for that : missed it in the docs (and we're still on V8.2).

Phil
Serge Rielau - 30 Jan 2007 01:32 GMT
>>>>> Hello
>>>>>
[quoted text clipped - 35 lines]
>> support tracing in SQL Procedures.
> Thanks for that : missed it in the docs (and we're still on V8.2).
It's in DB2 V8.2
Signature

Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

Ian - 26 Jan 2007 21:07 GMT
> Hello,
> Can some one suggest me a way of putting Stored procedure output into a
> file, the file should be available on my Computer, I don't want to use
> FTP process.
> Thanks
>  vk

Not possible, assuming "my computer" means the remote client, as opposed
to the database server.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.