In my case there should be only ONE ROW found or NO ROWS
So the SQLCODE = or <> 100 is the best option.
I have been testing:
SET V vLocalCode = LocalCode IN Quarter_NOW WHERE ZipCode = .vThisZcode +
AND .vThisPlus4 BETWEEN PLUS4_LOW AND PLUS4_HIGH
IF SQLCODE = 100 THEN
<do this if row NOT found>
ELSE
<do this if row FOUND>
ENDIF
In Code above: For some reason it makes no difference whether a row is
found or not
The error message pops up ".No Rows Found." AND the ELSE routine still runs
Very puzzled. . .still missing on one cylinder.
Ned
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Claudine
Robbins
Sent: Friday, July 25, 2008 5:58 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: My mind is missing on a few cylinders this evening!
Ned,
IF SQL = 100 THEN.
Or you could try:
WHENEVER NOT FOUND with a DECLARE CURSOR loop.
Claudine
_____
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Ned Ritchie
Sent: Friday, July 25, 2008 2:47 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - My mind is missing on a few cylinders this evening!
I sat in a dentist chair for 5 hours and I'm not all here, and I cannot
figure out the following:
I've imported a Zip+4.cvs sales tax file supplied by our Washington State
Dept of Revenue that has some missing Plus4 data due to new sub-developments
and new construction and PO Boxes
I can SET vLocalCode as a VARIABLE where there is a valid row, but when the
valid USPS Plus4 is not in a Dept of Rev Plus4 range we of course get a "NO
ROWS FOUND"
I now need to find the row where the zipcode is the same and the starting
Plus4 range is '0000'. I need to reset the vThisPlus4 variable to '0000'
and then make a second go at finding the valid default row
EXAMPLE: Any Plus4 up to 9734 will create a "NO ROWS FOUND"
Sample data as supplied:
ZIP PLUS4_LOW PLUS4_HIGH CODE STATE LOCAL TOT_RATE EFF_START EFF_END
----- --------- ---------- ---- ----- ----- -------- ----------
----------
98537 0000 0000 1400 0.065 0.018 0.083 07/01/08
09/30/08
98537 9735 9745 2500 0.065 0.013 0.078 07/01/08
09/30/08
98537 9747 9747 1400 0.065 0.018 0.083 07/01/08
09/30/08
98537 9801 9801 1402 0.065 0.018 0.083 07/01/08
09/30/08
*(Lots of Rbase for DOS code above)
LABEL BadPlus4
CLEAR V vLocalCode
SET V vLocalCode TEXT = NULL
SET V vLocalCode = LocalCode IN Quarter_NOW WHERE ZipCode = .vThisZcode AND
+
.vThisPlus4 BETWEEN PLUS4_LOW AND PLUS4_HIGH
*(Here is where I need to check if NO row was found)
IF <something> THEN
SET V vThisPlus4 = '0000'
GOTO BadPlus4
ENDIF
My hope is that I awake refreshed and you folks who are in earlier time
zones and with all cylinders firing will have supplied the missing line(s)
of code or have told me where to look for the examples.
Thanks in advance.
Ned