Our shop is getting into using more embedded SQL. Can someone suggest a good book or site on it's use in SQLRPGLE. We're not looking for a manual, but more of a guide on best practices, like when to use the Prepare statement or when to use Execute Immediate.
Thanks, Walt
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Birgitta Hauser
Sent: Wednesday, September 17, 2014 11:32 AM
To: 'RPG programming on the IBM i (AS/400 and iSeries)'
Subject: AW: Another Embedded SQL question
You try to execute your SQL Delete Statement, but your table is not registered in a journal.
You either have to specify COMMIT *NONE within the compile command or better add an SET OPTION Statement to your source code:
Exec SQL SET OPTION COMMIT = *NONE;
Attention: You can only embed a single SET OPTION statement within your source code and the SET OPTION statement must be physically the FIRST SQL statement within your source code.
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok) "What is worse than training your staff and losing them? Not training them and keeping them!"
-----Ursprüngliche Nachricht-----
Von: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von
(WalzCraft) Jerry Forss
Gesendet: Wednesday, 17.9 2014 17:11
An: rpg400-l@xxxxxxxxxxxx
Betreff: Another Embedded SQL question
Hi All,
I am trying to delete records from a file using the SQL delete.
It is giving me the return code of 55019. Each delete will delete multiple records.
What am I doing wrong?
// Delete History Records
For X = 1 To COIdx;
DeleteKey = COKey(X);
// Delete All Records For Order
Exec SQL Delete From MntLog
Where MlFile = 'MBC6REP' And
MlKeyVal1 = :DeleteKey;
// Check For End Of Data
If (SqlSTT <> SqlOK);
// Leave;
EndIf;
EndFor;
Additional Message Information
Message ID . . . . . . : SQL7008
Date sent . . . . . . : 09/17/14 Time sent . . . . . . : 09:43:02
Message . . . . : MNTLOG in UTILITIES not valid for operation.
Cause . . . . . : The reason code is 3. Reason codes are:
1 -- MNTLOG has no members.
2 -- MNTLOG has been saved with storage free.
3 -- MNTLOG not journaled, no authority to the journal, or the journal
state is *STANDBY. Files with an RI constraint action of CASCADE, SET NULL,
or SET DEFAULT must be journaled to the same journal.
4 and 5 -- MNTLOG is in or being created into production library but the
user has debug mode UPDPROD(*NO).
6 -- Schema being created, but user in debug mode with UPDPROD(*NO).
7 -- A based-on table used in creation of a view is not valid. Either the
table is program described table or it is in a temporary schema.
More...
Press Enter to continue.
Jerry Forss
Information Technology Team
WalzCraft
608-781-6355 EXT 2530
jforss@xxxxxxxxxxxxx
Subject to Change Notice:
WalzCraft reserves the right to improve designs, and to change specifications without notice.
Confidentiality Notice:
This message and any attachments may contain confidential and privileged information that is protected by law. The information contained herein is transmitted for the sole use of the intended recipient(s) and should "only"
pertain to "WalzCraft" company matters. If you are not the intended recipient or designated agent of the recipient of such information, you are hereby notified that any use, dissemination, copying or retention of this email or the information contained herein is strictly prohibited and may subject you to penalties under federal and/or state law. If you received this email in error, please notify the sender immediately and permanently delete this email. Thank You;
WalzCraft PO Box 1748 La Crosse, WI. 54602-1748
www.walzcraft.com<
http://www.walzcraft.com/> Phone... 800-237-1326
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.