[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1017
  • Last Modified:

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

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

0
bobdylan75
Asked:
bobdylan75
  • 3
  • 2
1 Solution
 
Dave FordSoftware Developer / Database AdministratorCommented:

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
0
 
Gary PattersonVP Technology / Senior Consultant 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
0
 
bobdylan75Author Commented:
Yeah!
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
bobdylan75Author 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..
0
 
Gary PattersonVP Technology / Senior Consultant 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

0
 
bobdylan75Author Commented:
Yeah,
thank you very much,
now all is more clear in my mind ;-).
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now