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
ASKED:
February 15, 2013 5:13 AM
UPDATED:
February 15, 2013 12:54 PM
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
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))
Getting error in the 1st line itself OrRecord = %Addr(Bytes(OrOffset+1))
Amutha
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
Thanks Tom, It worked with below suggestions
Amutha