First I want to apologize for my ignorance in RPGLE...we typically don't use this programming language, but have to for FieldProc purposes. I've researched this issue for a couple weeks now, and cannot find a resolution. I'm currently trying to write a field procedure program. I have taken the IBM RPGLE example (
https://www.ibm.com/support/knowledg...yfpexample.htm<
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/sqlp/rbafyfpexample.htm>), and started to modify it to work for us.
Here is the table that was created for testing purposes:
********** Beginning of data *************************************
A R REC
A ECNUM 16S 0 COLHDG('NUMBER')
A ALIAS(EC_NUMBER)
A ECALPHA 32A COLHDG('ALPHA')
A ALIAS(EC_ALPHA)
************* End of data ****************************************
The program from the link above allows for several SQL types, clob, varchar, char, blob, etc., but I needed to add zoned numeric. To begin, I studied and stepped through the program to see what it was doing, and thought I had a good understanding of how it worked. I then started adding what appeared as necessary for the SQL_TYP_ZONED (488).
When I send the 'ALTER TABLE' command and set the FieldProc program on a column, the first call is to Register(function code: 8), the next is Encode(function code: 0) to encode the values in said column.
I set a breakpoint at the end of the program, and evaluated the parameters when setting the FieldProc on a VARCHAR and ZONED NUMERIC columns, and besides being different data types all appears correct, but the ZONED NUMERIC column abruptly stops with the error below after the register call.
Message ID . . . . . . : SQL0685
Date sent . . . . . . : 03/18/20 Time sent . . . . . . : 16:17:04
Message . . . . : Field procedure on column ECNUM has returned invalid data.
Cause . . . . . : Field procedure on column ECNUM has returned invalid data.
Recovery . . . : Change the field procedure to return valid data.
Thank you in advance for any help you can give on this.
Thanks,
Nathan Hughes
Software Developer
[BadgePass]
601.499.2131 Office
280 Trace Colony Park
Ridgeland, MS 39157
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information or otherwise protected by law. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
As an Amazon Associate we earn from qualifying purchases.