Antonio,

I google around but Receiving result was a little bit too complicated
for me but I successed passing parameters. It's easy to specify the
parameter with the wizard provided by CREATE PROCEDURE + F4 !!

CL
--------------------------------------------------
PGM PARM(&PARM1 &PARM2)
//
/* DECLARE VARIABLES */
//
   DCL VAR(&PARM1) TYPE(*CHAR) LEN(128)
   DCL VAR(&PARM2) TYPE(*CHAR) LEN(128)
   DCL VAR(&PARM3) TYPE(*CHAR) LEN(256)

   CHGVAR VAR(&PARM3) VALUE(&PARM1 *BCAT &PARM2)
   SNDPGMMSG  MSG(&PARM3)  MSGTYPE(*COMP)

   RETURN
ENDPGM
--------------------------------------------------

Procedure
--------------------------------------------------
CREATE PROCEDURE USITD61339/MYPRCD3(IN PARM1 CHARACTER ( 128), IN
PARM2 CHARACTER ( 128)) LANGUAGE CL NOT DETERMINISTIC CONTAINS SQL
EXTERNAL NAME USITD61339/MYCLPGMP PARAMETER STYLE GENERAL
--------------------------------------------------

web2py
--------------------------------------------------
def params():
    form=SQLFORM.factory()
    if form.accepts(request):
        db.executesql("CALL USITD61339.MYPRCD3('OMI','CHIBA')")
        response.flash = "Stored Executed !!"
    return dict(form=form)
--------------------------------------------------

AS400 Job log
--------------------------------------------------
                              Display Job
Log
                                                            System:
xxxxxx
Job . . :   QZDASOINIT    User . . :   xxxxx         Number . . . :
306188

    Job 306188/xxxxx/QZDASOINIT started on 02/14/12 at 08:14:45 in
subsystem
      QUSRWRK in QSYS. Job entered system on 02/14/12 at
08:14:45.
    User xxxxx from client xx.xx.x.xxx connected to
server.
    OMI
CHIBA
--------------------------------------------------




On Feb 13, 5:25 pm, Omi Chiba <[email protected]> wrote:
> I will try tomorrow and let you know. I have RPG to return the price
> for the given currency (e.g. USD $100 => EUR $76) so it will be a good
> sample.
>
> On Feb 13, 4:13 pm, António Ramos <[email protected]> wrote:
>
>
>
>
>
>
>
> > Excelent
> > How to pass parameters and receive result?
>
> > Thank you
> > António
>
> > 2012/2/13 Omi Chiba <[email protected]>
>
> > > Posted on web2py slice.
> > >http://www.web2pyslices.com/slices/take_slice/151
>
> > > I'm so excited and it is greater than aha moment for me. We're using
> > > DB2 for our internal web app and now I can do almost anything from
> > > web2py because RPG/CL/Query... will be dynamically executed from
> > > web2py as an part of process.
>
> > > If you use DB2, I strongly recommend to try !

Reply via email to