> 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