Save results of a stored proc into a temp table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lunchroom@gmail.com

    Save results of a stored proc into a temp table

    Type - Model: 9406 - 520
    i5/OS version: 5 Release 4 Modification 0

    I need to be able to create a script that will allow me to store the
    results of a stored proc into a session temp table. I need to be able
    to do this in a script, not a stored procedure.

    Something like this:

    SELECT INTO Session.TempTab le (CALL MyProc('12345') );
    SELECT * FROM Session.TempTab le WHERE Column1 = 'A';

    MyProc already exists and I don't have the luxury of modifying it in
    any way. Is this possible?
  • Serge Rielau

    #2
    Re: Save results of a stored proc into a temp table

    lunchroom@gmail .com wrote:
    Type - Model: 9406 - 520
    i5/OS version: 5 Release 4 Modification 0
    >
    I need to be able to create a script that will allow me to store the
    results of a stored proc into a session temp table. I need to be able
    to do this in a script, not a stored procedure.
    >
    Something like this:
    >
    SELECT INTO Session.TempTab le (CALL MyProc('12345') );
    SELECT * FROM Session.TempTab le WHERE Column1 = 'A';
    >
    MyProc already exists and I don't have the luxury of modifying it in
    any way. Is this possible?
    You can write an external table UDF (Java or C), consume the result set
    there and return as a table.

    Cheers
    Serge

    --
    Serge Rielau
    DB2 Solutions Development
    IBM Toronto Lab

    Comment

    Working...