RPGLE trigger tables AS/400

310 pts.
Tags:
AS/400
RPGLE
Hi, Does RPGLE triggers can be added to the tables? I created a Table and RPGLE Trigger. But I am getting error saying 'Receiver too small to hold the result'. But the same code is accepting the physical files. Do I need to set any attributes while creating the RPGLE triggers or tables? Please suggest Amutha

Software/Hardware used:
Software

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Do i need to set any attributes while creating the RPGLE triggers or TABLES?   No. But you do need to show us the source for the statements that throw errors if you want s to help with debugging. It's obvious that you have at least one variable defined incorrectly, but we can't suggest fixes if we can't see it.   Tom
    125,585 pointsBadges:
    report
  • As400pgmmer
    D@OrRecord        S               *   Inz(*Null)                                                                                  DOrRecord       E DS                  ExtName(PF1) Prefix(OVN_)  D                                     Based(@OrRecord)                                                                            D@NwRecord        S               *   Inz(*Null)                                                                                  DNwMAMA1        E DS                  ExtName(PF1) Prefix(NVN_)  D                                     Based(@NwRecord)           DBuffer           DS         32767                               D PFName                        10                               D PFLibrary                     10                               D PFMember                      10                               D TrgEvent                       1                               D TrgTime                        1                               D TrgCmtLvl                      1                               D                                3                                  D TrgCCSID                       7B 0                               D                                8                                  D OrOffset                       7B 0                               D OrRcdLen                       7B 0                               D OrNBMapOfs                     7B 0                               D OrNBMapLen                     7B 0                               D NwOffset                       7B 0                               D NwRcdLen                       7B 0                               D NwNBMapOfs                     7B 0                               D NwNBMapLen                     7B 0                               D DataSpace               1  32767                                  D Bytes                          1    Overlay(Dataspace) Dim(32767) DBufferLen        S              7B 0                                * Null byte status                            DNB_NOTNULL       C                   '0'      DNB_NULL          C                   '1'                                                      * Trigger events                              DTE_INSERT        C                   '1'      DTE_DELETE        C                   '2'      DTE_UPDATE        C                   '3'                                                      * Trigger times                               DTT_AFTER         C                   '1'      DTT_BEFORE        C                   '2'       * Assign the record templates to their data space                     C                   Eval      @OrRecord = %Addr(Bytes(OrOffset+1))    --> Getting error here saying 'Receiver too small to hold the result' C                   Eval      @NwRecord = %Addr(Bytes(NwOffset+1))    
    310 pointsBadges:
    report
  • As400pgmmer
    Getting error in the 1st line itself   OrRecord = %Addr(Bytes(OrOffset+1))     Amutha  
    310 pointsBadges:
    report
  • TomLiotta
    There are a couple general problems.   You have a bunch of fields defined as [7B 0], but none of the trigger buffer fields should be defined as a "B" data type. The fields are 4-byte integers, so define them as [10i 0].   Then you have DataSpace defined as part of the Buffer DS, immediately after the NwNBMapLen subfield. The buffer sections documentation shows that the offset is not known ahead of time, but you have it in a fixed position. You need it to be in a separated DS that is based on a pointer. The pointer address will be the Buffer address plus the OrOffset value. (And don't add (1) to it.) The other record areas will also have their own DS addresses. The position can change every time you run the program, so you can't define it in a fixed location.   Since the fields have incorrect data definitions, I can't guess what value is returned when it tries to evaluate (OrOffset+1) for an index into your Bytes array.   Tom
    125,585 pointsBadges:
    report
  • As400pgmmer
    Thanks Tom, It worked with below suggestions   Amutha
    310 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following