Plex 2E

  • 1.  Sql Result Set from Plex generated RPG?

    Posted Nov 09, 2012 07:10 AM
    Hey there!

    I would be very grateful for the info that tells me if it's possible to generate RPG returning Sql Result Set?

    Plex version is 6.1.

    I'm trying to reuse current implementation in Plex from dotnet application so that dotnet calls stored procedure in DB2 and that calls indirectly RPG program.

    br,
    Kari


  • 2.  RE: Sql Result Set from Plex generated RPG?

    Posted Nov 09, 2012 09:26 AM
    Hi Kari, Im guessing a bit here but if you meant:

    kappasvaan wrote:

    dotnet calls stored procedure in DB2 and that calls indirectly RPG PLEX program.
    then I would point you to Dynamic Array

    In a plex data access function you have fixed output arrays, so for example the BlockFetchSet pattern will get a 'SET' of data (by default 64 records that satisfy the key and programmatic restriction) but it can't get ALL the records that satisfy a set arguement as its ouput array is fixed.

    Plex developers therefore use BlockFetches and call them from their tier requiring the 'SET' mulitiple times untill ALL rows are got.

    Your stored procedure needs to call the plex data access function multiple times. People have been disappointed about this and have various workarounds such as loading work tables, or increasing the size of the fixed arrays.

    If I have missed the point apologies


  • 3.  RE: Sql Result Set from Plex generated RPG?

    Posted Nov 09, 2012 03:31 PM
    Hi Kari
    I have tested some years ago (but not used) some source code to get a cursor working. It seems to me that it would be used that way. Here goes a sample:



    I haven't here the full example, but I hope it would help you to get the idea...

    Jorge Ubeda


  • 4.  Re: RE: Sql Result Set from Plex generated RPG?

    Posted Feb 11, 2015 02:42 AM

    called a DB2 stored procedure from rpgiv plex function and retrieved a record from the data set. Works like magic

     

    stole it from Four Hundred Guru--DB2 for i: Process Stored Procedure Result Sets as Cursors

     

    storedprocedure.png