Hello, I sent this message but it was rejected because of it seems SPAM!!!
I am trying to send it again... I hope that it won�t be rejected...

The question:

I have this DBPROC that returns an OUT parameter:

CREATE DBPROC TBW_MONEDA ( IN MES FIXED(2.0) ,  IN ANIO  FIXED(4,0), IN ID_PAIS 
FIXED(3,0), IN IMPORTE FIXED(14,2), OUT IMP_MXN FIXED(14,2) ) AS
TRY
    SELECTNU_TIPOCAMBIOUS
        FROM ADMACI.TC_MONEDAS
        WHERE NU_MES = :MES AND NU_ANIO = :ANIO 
        AND IDNU_PAIS = :IP_PAIS;

    WHILE $rc = 0 DO BEGIN
        FETCH INTO :IMP_MXN;
    END;
CATCH
  IF $rc <> 100 THEN STOP ($rc, 'unexpected error');

I am trying to call this DBPROC from another DBPROC but i don�t know how 
to get the OUT parameter:

CREATE DBPROC PBW_AHO_SELECT_TEST AS
        VAR IMP_MXN FIXED(14,2);
TRY
    CALL TBW_MONEDA ( 1, 2005, 3, 5800, IMP_MXN);
CATCH
  IF $rc <> 100 THEN STOP ($rc, 'unexpected error');

I got the error:

Auto Commit: On, SQL Mode: Internal, Isolation Level: Committed
 General error;-8005 POS(115) Value expression must be parameter name
CREATE DBPROC PBW_AHO_SELECT_TEST AS
        VAR IMP_MXN FIXED(14,2);
TRY
    CALL TBW_MONEDA ( 1, 2005, 3, 5800, IMP_MXN);
CATCH
  IF $rc <> 100 THEN STOP ($rc, 'unexpected error');

Please, can you help me to resolve this problem...

Thanks in advance,

Luis Jorge Castro

Reply via email to