× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am a newbie to SQL Stored Procedures so be gentle and don't make fun of
my code. But, if it needs correcting feel free to say so. Anyway... I
have the following series of statements that are executing without error.
I also check the base table and the rows *are* getting deleted. However,
the message I'm getting back at the end is that rows deleted = 0. How can
this be fixed to accurately give the number of deleted rows? Thanks.

DELETE IMIOVMET
WHERE Company_Number = COMPNUMB
AND Company_Period = COMPPERD;
GET CURRENT DIAGNOSTICS CONDITION 1 CURSTATE = RETURNED_SQLSTATE;
IF SUBSTR(CURSTATE,1,2) <> '00' THEN
SET STR1 = ERRPFX || 'IM IOV M/E data delete failed.'
|| ' (' || CURSTATE || ')';
SIGNAL SQLSTATE '88W08' SET MESSAGE_TEXT = STR1;
END IF;
GET DIAGNOSTICS CNT2 = ROW_COUNT;
COMMIT WORK;
GET CURRENT DIAGNOSTICS CONDITION 1 CURSTATE = RETURNED_SQLSTATE;
IF SUBSTR(CURSTATE,1,2) <> '00' THEN
SET STR1 = ERRPFX || 'SQL failed to commit updates.'
|| ' (' || CURSTATE || ')';
SIGNAL SQLSTATE '88W09' SET MESSAGE_TEXT = STR1;
END IF;
SET STR1 = ERRPFX || 'IM IOV M/E rows deleted = ' || CHAR(CNT2);
SIGNAL SQLSTATE '88W00' SET MESSAGE_TEXT = STR1;

Sincerely,

Dave Clark
int.ext: 91078
direct: (937) 531-6378

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio 45439 USA
(937) 294-5331



*********************************************************************************************
This email message and any attachments is for use only by the named
addressee(s) and may contain confidential, privileged and/or proprietary
information. If you have received this message in error, please
immediately notify the sender and delete and destroy the message and all
copies. All unauthorized direct or indirect use or disclosure of this
message is strictly prohibited. No right to confidentiality or privilege
is waived or lost by any error in transmission.
*********************************************************************************************

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.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 on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.