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

method to write to a flat file from Stored procedure

P: n/a
vj
Is there any way out to writer to a flat file from the Stored
Procedure.

Vijay.

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


P: n/a
Hi Vijay,

If you're using a Java Stored Proc, you can use a PrintWriter as below:
{
....
pwx = new PrintWriter(new FileWriter("/tmp/sp_debug.txt"),true);
}
catch (Exception e) {
pwx.println("Exception occured!");
pwx.println(e.getStackTrace().toString());
}

This will write a file in the /tmp directory on the server on which the
stored procedure is running.

Nov 12 '05 #2

P: n/a
No way from a SQL stored proc (AFAIK), not an issue from an external
stored proc (java, C, etc , whatever supported on your platform)

Nov 12 '05 #3

P: n/a
vj
Thanks ! Let me give a go on this

Nov 12 '05 #4

P: n/a
vj
I think then JAVA Proc should work fine !

Nov 12 '05 #5

P: n/a
ef******@gmail.com wrote:
No way from a SQL stored proc (AFAIK), not an issue from an external
stored proc (java, C, etc , whatever supported on your platform)

I think there are soem artciles on developerWorks/DB2.
Here is one by Knut:
http://www-128.ibm.com/developerwork...303stolze.html

Cheers
Serge

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

This discussion thread is closed

Replies have been disabled for this discussion.