We help IT Professionals succeed at work.

SQLRPGLE program works, but it doesn't take any effects

Medium Priority
1,042 Views
Last Modified: 2013-12-06
Hello world!
Hi do a sample program SQLRPGLE,
it has to clear some record from a dds where the user is "DUFFYDUCK".
It works, it doesn't give me any error, but it doesn't delete these record.
Why?
There will be something I don't know to do before using SQLRPGLE..
DPUSER            S             10A   INZ('DUFFYDUCK')            
C* CLEAR FROM CLCINV USER'S RECORDS                                
C*                                                                 
C                   EVAL      PUSER='DUFFYDUCK'                        
C/EXEC SQL                                                         
C+ DELETE FROM CLCINV WHERE USER = :PUSER                    
C/END-EXEC                                                         
C                   SETON                                        LR

Open in new window

Comment
Watch Question

Software Developer / Database Administrator
CERTIFIED EXPERT
Commented:

If you're using any commitment-control level besides *NONE, then you'll have to COMMIT your changes. Otherwise, they'll automatcally rollback when the program ends.

Check your compile options for which "commitment cojntrol" level you're using.

HTH,
DaveSlash

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Gary PattersonVP Technology / Senior Consultant
CERTIFIED EXPERT

Commented:
Agree with daveslash, commitment control is likely cuplrit.

Run your program, then use DSPJOBLOG, F10 to display detailed messages.  Post the messages you see here if you need more help, including the second-level text (cursor on message, F1).

Recompile using COMMIT(*NONE) or specify the SQL or RPG COMMIT command:

EXEC SQL COMMIT:
C                                       COMMIT

If that doesn't solve it, post back.

- Gary Patterson

Author

Commented:
Yeah!

Author

Commented:
Thank you Dave and Gary
I have change commit=*none.
But I've a question.. If I leave commit=*chg. How can I do after to COMMIT?
Thanks.
If you want I open another question for points..
Gary PattersonVP Technology / Senior Consultant
CERTIFIED EXPERT

Commented:
I'm not sure I understand the question.

To commit after the delete, just issue the COMMIT opcode or the COMMIT SQL directive, like I show you above.

- Gary Patterson

Author

Commented:
Yeah,
thank you very much,
now all is more clear in my mind ;-).
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.