MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » March 2014

AW: SQLCOD 12



fixed

Hi,

SQLCODE 12 is not an error but a warning and means correlation names for the
same columns within the same tables should be used.
Just try to modify your UPDATE statement as follows:
Exec SQL
update LIb/file1 a set var =
(select var1 from lib/file2 b
where a.field1 = b.field2)
where exists(select * Lib/file2 c where a.field1=c.field2);

In former releases sometimes warnings were not sent out.
That's why you never should check for SQLCODE <> *ZEROS (or SQLCODE =
*Zeros) but always SQLCODE < *Zeros (=Error) andr SQLCODE = 100 (Last
Record/Not found)

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: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Billy Waters
Gesendet: Saturday, 29.3 2014 14:27
An: midrange-l@xxxxxxxxxxxx
Betreff: SQLCOD 12

RPG Code
Exec SQL
update LIb/file1 set var =
(select var1 from lib/file2
where field1 = field2)
where exists(select * Lib/file2 where field1=field2);

RSTNG = 'UPDATE STATUS: ' + SQLSTATE;
Write R001;
If SQLCOD <> 0;
*INU1 = *on;
EndIf;

Take necessary actions in CL if INU1 is off or on.

If I call from command line:
UPDATE STATUS: 00000 (SQLSTAT)
Zero Records: 0
Off (State of INU1) check doe SQLCOD <> 0

If I start from MSSQL stored procedure
UPDATE STATUS: 01545
Zero Records: 0
on
update is successful

Different user ids when calling from command line vs from MSSQL.
Please help..

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.







Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact