473,387 Members | 1,791 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,387 software developers and data experts.

Stored Procedure output into File

VK
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

Jan 26 '07 #1
9 11709
VK
Just any update, am using DB2 UDB V8.0

On Jan 26, 2:11 pm, "VK" <kanuriven...@gmail.comwrote:
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
Jan 26 '07 #2
VK wrote:
Just any update, am using DB2 UDB V8.0

On Jan 26, 2:11 pm, "VK" <kanuriven...@gmail.comwrote:
>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
You mean like this?
db2 "call proc(...)" file.txt

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jan 26 '07 #3
Ian
VK wrote:
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.

Jan 26 '07 #4
VK
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.

On Jan 26, 2:27 pm, Serge Rielau <srie...@ca.ibm.comwrote:
VK wrote:
Just any update, am using DB2 UDB V8.0
On Jan 26, 2:11 pm, "VK" <kanuriven...@gmail.comwrote:
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
vkYou mean like this?
db2 "call proc(...)" file.txt

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jan 26 '07 #5
VK wrote:
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

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jan 26 '07 #6
Serge Rielau wrote:
VK wrote:
>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
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
Jan 29 '07 #7
Philip Nelson wrote:
Serge Rielau wrote:
>VK wrote:
>>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

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
DGTT support "NOT LOGGED ON ROLLBACK PRESERVE ROWS". I had it added to
support tracing in SQL Procedures.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jan 29 '07 #8
Serge Rielau wrote:
Philip Nelson wrote:
>Serge Rielau wrote:
>>VK wrote:
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

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
DGTT support "NOT LOGGED ON ROLLBACK PRESERVE ROWS". I had it added to
support tracing in SQL Procedures.

Cheers
Serge

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

Phil
Jan 29 '07 #9
Philip Nelson wrote:
Serge Rielau wrote:
>Philip Nelson wrote:
>>Serge Rielau wrote:

VK wrote:
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

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
DGTT support "NOT LOGGED ON ROLLBACK PRESERVE ROWS". I had it added to
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
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jan 30 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
4
by: laurenq uantrell | last post by:
I'm using the function below to output all of my stored procedures into a text file. Fice, except that the output file does not reflect the names of the stored procedures correctly if the name has...
7
by: Jeff Wang | last post by:
Hi all, Can someone help me out? I've been struggling with this for almost a week and still have no clue what's wrong. Basically I want to write a DB2 stored procedure for OS/390 in REXX. In...
1
by: Private Pyle | last post by:
DB2 version 8, fixpack 5. Aix 5.1.0.0 Using C for AIX compiler. I'm having a problem where I can create stored procedures but I'm getting -444 when I call them. It's a new environment for...
5
by: Rhino | last post by:
This question relates to DB2 Version 6 on OS/390. Can a (COBOL) stored procedure on this platform do file I/O, i.e. write to a sequential file? I am trying to debug a stored procedure. As far...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
2
by: Rob Meade | last post by:
Hi all, I was wondering if anyone could give me a small example of running a stored procedure with both output and input parameters via asp.net (vb). I have tried a couple of things, one of...
2
by: Michael | last post by:
Running DB2 v7 UDB ("DB2 v7.1.0.93", "n031208" and "WR21333") on Windows XP, I am unable to find out why the "Build for Debug" option within Stored Procedure Builder is not enabled on Java stored...
2
by: jed | last post by:
I have created this example in sqlexpress ALTER PROCEDURE . @annualtax FLOAT AS BEGIN SELECT begin1,end1,deductedamount,pecentageextra FROM tax
0
by: pompeyoc | last post by:
I am trying to learn how to use stored procedures written in COBOL so I wrote 2 small programs to test it out: the stored procedure and the the calling program. I have no problems compiling them...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.