ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Need Example for SP - RPG with returns a Resultset

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need Example for SP - RPG with returns a Resultset

    Hello,

    at first i want to introduce myself:

    I am from Austria. I developed at first 2,5 years on AS400 then around 6 years on Microsoft Navision (ERP) and now im Back to AS400 .

    I am searching an full example/listing:
    - an RPG / RPG-LE programm
    - with sql which
    - with imput parameter
    - which returs an result set
    - which can i call form a stored procedure
    - should include "WITH RETURN TO CLIENT"

    I need an example like http://publib.boulder.ibm.com/infoce...crpghostex.htm

    but i want not to use a cursor - i think it should slow down


    2nd Question:
    Is it possible to create a function without an rpg - only in sql like MS SQL Server?


    thanks in Adance
    Greetings form Austria
    Jürgen

  • #2
    Re: Need Example for SP - RPG with returns a Resultset

    Hi,

    1. To create a RPG program that returns one or several result sets is quite easy. Declare a cursor, open it an do not close it when ending your program. If you want to return a result set you need to declare a cursor.

    SET RESULT SET as displayed in the examples is since release V5R1 no longer required.

    2. This RPG Program must be registered as Stored Procedure. The easiest way is to use iSeries Navigator Database.

    3. SQL deliverers everything you need to write stored procedures, triggers and user defined functions sonely with SQL.

    You may also contact me privately, because asking and explaining in German may be easier for both of us.

    Birgitta

    Comment


    • #3
      Re: Need Example for SP - RPG with returns a Resultset

      Originally posted by B.Hauser View Post
      You may also contact me privately, because asking and explaining in German may be easier for both of us.

      Birgitta
      oh come on post it here...i'm trying to remember my German, it's my 5th language!!!
      • Redneck
      • English (US)
      • English (UK)
      • Spanish (not fluent but i'm not fluent in any language but Redneck)
      • German
      I'm not anti-social, I just don't like people -Tommy Holden

      Comment


      • #4
        Re: Need Example for SP - RPG with returns a Resultset

        In the meantime a have found and example provided form IBM

        http://publib.boulder.ibm.com/infoce...esultsete2.htm

        Comment

        Working...
        X