Very simple SQLRPGLE not working

1930 pts.
Tags:
AS/400
SQLRPGLE
I must be missing something simple. Any ideas ? Here's the code.

C/exec sql

C+ Update MFLLIB/ITMAST

C+ Set IM_ITEMID = 'ST150EML'

C+ Where IM_ITEMID = 'ST150E '

C/end-exec

C Eval *inlr = *on

 

I simplified the update for test purposes.  No halts but no update.  Of course I can do the update via interactive STRSQL using this exact syntax, but I want it in a program.

I did create it as CRTSQLRPGI as well as trying it as a "option 14" compile.

Mike L.



Software/Hardware used:
as/400

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: 9  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
  • carlosdl
    I know nothing about SQLRPGLE, but I noticed a blank space at the end of the string being compared in the where clause. Was that a typo ?
    C+ Where IM_ITEMID = 'ST150E ' 
    69,510 pointsBadges:
    report
  • TomLiotta
    The trailing blank(s) shouldn't be a problem, though it's certainly possible depending on specific column definitions. I'd be more interested in knowing what SQL compile options were used. I might expect that the UPDATE simply isn't being committed. Tom
    125,585 pointsBadges:
    report
  • aceofdelts
    The trailing blank is on purpose. Protects my item # from accidentally being treated as a 'wild card' in the 20-character field. I use this all the time within STRSQL. Please do keep pointing out any little thing that seems suspicious. Mike L.
    1,930 pointsBadges:
    report
  • aceofdelts
    Tom - I merely did a CRTSQLRPGI to my test library. No particular compile options. Do I need a special option to get the Update to commit ? Mike L.
    1,930 pointsBadges:
    report
  • TomLiotta
    Mike: For us to know the run-time behavior, please run PRTSQLINF for the program. Show us the CRTSQLRPGI section from near the beginning. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    try adding C/exec sql C+ set option COMMIT = *NONE C/end-exec before the update. Phil
    49,950 pointsBadges:
    report
  • as400dev
    Hi, YOu Please complie the Program with option 14 --> F4 --> COMMIT *NONE , will only make the files update/Insert . I do experience the same error in test Development , where as the Prod will be set to *none. So its better to add the option in your H-Spec . Thanks
    480 pointsBadges:
    report
  • TomLiotta
    It isn't yet known if COMMIT=*NONE is appropriate, though it stands as a likely resolution. That is, it commonly allows UPDATEs to work; but we don't know if that's how it should be done or if the transaction really needs to be run in a proper commitment control structure. It can be trouble to force a program to work by removing or disabling controls that protect database integrity. The various COMMIT options exist for reasons. The correct COMMIT option should match the desired environment. In any case, setting COMMIT=*NONE, either for a compile option or as a SQL SET OPTION, will probably allow the UPDATE to succeed. When the final program version becomes production, it should have the option set for the environment that it will run under. Tom
    125,585 pointsBadges:
    report
  • aceofdelts
    OK - I'm back in town. I tried it both ways (Commit via compile and via Set). They both worked !!! Thanks to all for the prompt attention.
    1,930 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