Article View: borland.public.vdbase.data.sql
Article #1494TOO MANY NESTED DO/UDF
From: Joe Yuzamas
Date: Wed, 17 Dec 1997 00:00
Date: Wed, 17 Dec 1997 00:00
66 lines
2644 bytes
2644 bytes
Have a very intresting problem. While executing the following code and
processing about 600 records, I get the following error 'TOO MANY NESTED
DO/UDFs'. The line that it fails on is oAm.Add(1). Does anybody out there
have any ideas as to why this code would process 600 recodes and then fail?
FOR i = 1 to soPrjNr.Size && ARRAY soPrjNr loaded in code above
OPEN DATABASE FMPROJ
SET DATABASE TO FMPROJ
cPrjNr = soPrjNr[i]
SELECT PRJ_NO,AMEND_NO,AMOUNT,INT_AMOUNT,INTENT ;
FROM AMEND ;
WHERE PRJ_NO = :cPrjNr
oAm = NEW ARRAY()
oAmt = NEW ARRAY()
oIAmt = NEW ARRAY()
oInt = NEW ARRAY()
DO WHILE .NOT. EMPTY(PRJ_NO)
oAm.Add(1)
oAmt.Add(1)
oIAmt.Add(1)
oInt.Add(1)
oAm[oAm.Size] = AMEND_NO
oAmt[oAmt.Size] = AMOUNT
oIAmt[oIAmt.Size] = INT_AMOUNT
oInt[oInt.Size] = INTENT
SKIP
ENDDO
FOR j = oAm.Size to 1 step -1
IF .NOT. oInt[j]
nTotAmt = 0.0
FOR k = j to 1 step -1
IF .NOT. oInt[k]
nTotAmt = nTotAmt + oAmt[k]
ENDIF
NEXT
oIAmt[j] = nTotAmt
ENDIF
NEXT
FOR j = 1 TO oAm.Size
IF .NOT. oInt[j]
cAM = oAm[j]
nAmt = oAmt[j]
nIAmt = oIAmt[j]
IF nAmt = 0.0 .AND. nIAmt <> 0.0 && Make up for the fact
UPDATE AMEND SET INT_AMOUNT = :nIAmt ; && SQL will not allow
WHERE PRJ_NO = :cPrjNr AND AMEND_NO = :cAM && a zero
update
ELSEIF nAmt <> 0.0 .AND. nIAmt = 0.0
UPDATE AMEND SET AMOUNT = :nAmt ;
WHERE PRJ_NO = :cPrjNr AND AMEND_NO = :cAM
ELSEIF nAmt <> 0.0 .AND. nIAmt <> 0.0
UPDATE AMEND SET AMOUNT = :nAmt, INT_AMOUNT = :nIAmt ;
WHERE PRJ_NO = :cPrjNr AND AMEND_NO = :cAM
ENDIF
ENDIF
NEXT
oAm = .f.
oAmt = .f.
oIAmt = .f.
oInt = .f.
Close DATABASES && SQL will eat memory if you don't
NEXT
--
Joe < jyuzamas@wrdiss1.robins.af.mil or jyuzamas@sprynet.com >
Technical Details
Message-ID:
<01bd0afe$ef069980$1030f489@jyuzamas.robins.af.mil>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: ff5a1,249488cfdabe46c3,start X-Google-Attributes: gidff5a1,public From: "Joe Yuzamas" <jyuzamas@wrdiss1.robins.af.mil> Subject: TOO MANY NESTED DO/UDF Date: 1997/12/17 Message-ID: <01bd0afe$ef069980$1030f489@jyuzamas.robins.af.mil> X-Deja-AN: 299050528 Organization: U.S. Air Force Newsgroups: borland.public.vdbase.data.sql