dbTalk Databases Forums  

GPV/GPF using SQL queries

comp.databases.paradox comp.databases.paradox


Discuss GPV/GPF using SQL queries in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Rey
 
Posts: n/a

Default GPV/GPF using SQL queries - 02-10-2006 , 05:26 PM






Howdy all.

Getting very frustrated w/getting a general protection violation msg on
running a series of sql queries...
Initially, the problem was occurring on attempting to run the 2nd query.
No amt of retypying the 2nd query; researching opportunistic locks and
making the neccessary change to my XP Pro box and NT4 svr worked. Even
changed from using executeSQL from meth to proceedure. Nothing!

After mucho searching, found a response from Bertil on another SQL - GPV
post (SQL & Paradox -> GPV ?) and removed the priv alias from the sql query.
This then worked until the 5th query in the series and again I get a GPV.
Even using the actual full path to the priv table did not help. Checked
Bertil's buglist for GPV and tried those suggestions w/no success.

Now it seems to work - after opening Outlook Express 8-). However, this is a
test environ not production.
Any ideas as to why this occurs?

Using Pdox 10.0.0.719 on an XP Pro box SP2; accessing tables on an NT4 sp6a
svr.

Appreciate your suggestions. Below are the queries.

Thanks,
Rey

**************************************

{orig queries
qs0 = query ; creates riv:statun00.db

:haidata:UNITBAL | UnitNumFK | AssnNumFK |
ParticipantFK |
Quote:
CheckPlus <900000 | CheckPlus _join1 |
CheckPlus |

:haidata:UNITBAL | CurrentBal |
Quote:
CheckPlus |
:PRIV:ASSNPICK | AssnPick |
Quote:
_join1 |
EndQuery

qs1 = query ; creates riv:statun01.db

:PRIV:STATUN00 | UnitNumFK | AssnNumFK | ParticipantFK | CurrentBal |
Quote:
Check | _assn | =_assn
calc sum as P1Bal |
EndQuery

qs2 = query ; creates riv:statun02.db

:PRIV:STATUN00 | UnitNumFK | ParticipantFK | CurrentBal |
Quote:
Check | 200 | calc
sum as P2Bal |

EndQuery

qs3 = query ; creates riv:statun03.db

:PRIV:STATUN00 | UnitNumFK | AssnNumFK | ParticipantFK |
Quote:
Check | _assn | not
_assn, not 200 |

:PRIV:STATUN00 | CurrentBal |
Quote:
calc sum as P3Bal |
EndQuery

qs4 = query ; creates riv:statun04.db; pulls transactions as of effdate

:haidata:UNITTRAN | UnitNumFK | TranDate | AssnNumFK | Participant |
Quote:
Check _join1 | >_join2 | Check
Check |
:haidata:UNITTRAN | Amount |
Quote:
calc sum as TranTot |
:PRIV:USERACTV | FirstFlag | EfftvDate |
Quote:
1 | _join2 |
:PRIV:STATUN01 | UnitNumFK |
Quote:
_join1, <900000 |
EndQuery

qs5 = query ; creates riv:statun05.db

:PRIV:STATUN04 | UnitNumFK | AssnNumFK | Participant | TranTot
Quote:
Check | _assn |
=_assn | calc sum as P1Trans |

EndQuery

qs6 = query ; creates riv:statun06.db

:PRIV:STATUN04 | UnitNumFK | Participant | TranTot |
Quote:
Check | 200 | calc sum
as P2Trans |

EndQuery

qs7 = query ; creates riv:statun07.db

:PRIV:STATUN04 | UnitNumFK | AssnNumFK | Participant |
Quote:
Check | _assn | not
_assn, not 200 |

:PRIV:STATUN04 | TranTot |
Quote:
calc sum as P3Trans |
EndQuery

qs8 = query ; creates riv:statun08.db

:PRIV:STATUN00 | UnitNumFK | AssnNumFK | CurrentBal |
Quote:
Check | Check | calc
sum as TotBal |

EndQuery

qs9 = query ; creates riv:statun09.db

:PRIV:STATUN04 | UnitNumFK | TranTot |
Quote:
Check | calc sum as TotTran |
EndQuery

qs10 = query ; creates riv:statun0A.db

:PRIV:STATUN01 | UnitNumFK | P1Bal |
Quote:
_join6 | CheckPlus |
:PRIV:STATUN02 | UnitNumFK | P2Bal |
Quote:
_join5 | CheckPlus |
:PRIV:STATUN03 | UnitNumFK | P3Bal |
Quote:
_join4 | CheckPlus |
:PRIV:STATUN05 | UnitNumFK | P1Trans |
Quote:
_join3 | CheckPlus |
:PRIV:STATUN06 | UnitNumFK | P2Trans |
Quote:
_join2 | CheckPlus |
:PRIV:STATUN07 | UnitNumFK | P3Trans |
Quote:
_join1 | CheckPlus |
:PRIV:STATUN08 | UnitNumFK
Quote:
CheckPlus _join7!, _join6!, _join5!,
_join4!, _join3!, _join2!, _join1! |

:PRIV:STATUN08 | AssnNumFK | TotBal |
Quote:
CheckPlus | CheckPlus |
:PRIV:STATUN09 | UnitNumFK | TotTran |
Quote:
_join7 | CheckPlus |
EndQuery

qs11 = query ; creates riv:statun0B.db

:PRIV:STATUN0A | P1Bal | P2Bal | P3Bal | P1Trans |
Quote:
_b1 | _b2 | _b3 | _t1, calc
_b1-_t1 as P1Bal |

:PRIV:STATUN0A | P2Trans | P3Trans
Quote:
_t2, calc _b2-_t2 as P2Bal | _t3, calc
_b3-_t3 as P3Bal |

:PRIV:STATUN0A | UnitNumFK | AssnNumFK | TotBal |
Quote:
CheckPlus | CheckPlus |
CheckPlus _tb, as CurrBal |

:PRIV:STATUN0A | TotTran |
Quote:
_tt, calc _tb-_tt as TotBal |
EndQuery

}


; :PRIV:statun00
sqlqs0 = SQL

SELECT U.UnitNumFK, U.AssnNumFK, U.ParticipantFK, U.CurrentBal
FROM :haidata:UNITBAL U
INNER JOIN ASSNPICK A
ON (A.AssnPick = U.AssnNumFK)
WHERE U.UnitNumFK < '900000'
ORDER BY U.UnitNumFK

endSQL

; :PRIV:statun01
sqlqs1 = SQL

SELECT DISTINCT a.UnitNumFK, SUM(a.CurrentBal) AS P1Bal
FROM STATUN00 a
WHERE a.ParticipantFK IN (SELECT b.AssnNumFK
FROM STATUN00 b)
GROUP BY a.UnitNumFK

EndSQL


;:PRIV:statun02
sqlqs2 = SQL

SELECT DISTINCT UnitNumFK, SUM(CurrentBal) AS P2Bal
FROM STATUN00
WHERE
(ParticipantFK = '200')
GROUP BY UnitNumFK
ORDER BY UnitNumFK

endSQL

; :PRIV:statun03
sqlqs3 = SQL

SELECT DISTINCT UnitNumFK, SUM(CurrentBal) AS P3Bal
FROM STATUN00
WHERE
(ParticipantFK <> AssnNumFK)
AND (ParticipantFK <> '200')
GROUP BY UnitNumFK
ORDER BY UnitNumFK

endSQL

; :PRIV:statun04
sqlqs4 = SQL

SELECT DISTINCT U.UnitNumFK, U.AssnNumFK, U.Participant, SUM( U.Amount )
TranTot
FROM :haidata:UNITTRAN U
INNER JOIN USERACTV U1
ON (U.TranDate > U1.EfftvDate)
INNER JOIN STATUN01 S
ON (S.UnitNumFK = U.UnitNumFK)
WHERE (U1.FirstFlag = '1')
AND (S.UnitNumFK < '900000')
GROUP BY U.UnitNumFK, U.AssnNumFK, U.Participant
ORDER BY U.UnitNumFK, U.AssnNumFK, U.Participant

endSQL

; :PRIV:statun05
sqlqs5 = SQL

SELECT DISTINCT UnitNumFK, SUM(TranTot) AS P1Trans
FROM STATUN04
WHERE
(Participant = AssnNumFK)
GROUP BY UnitNumFK
ORDER BY UnitNumFK

endSQL

; :PRIV:statun06
sqlqs6 = SQL

SELECT DISTINCT UnitNumFK, SUM(TranTot) AS P2Trans
FROM STATUN04
WHERE
(Participant = '200')
GROUP BY UnitNumFK
ORDER BY UnitNumFK

endSQL

; :PRIV:statun07
sqlqs7 = SQL

SELECT DISTINCT UnitNumFK, SUM(TranTot) AS P3Trans
FROM STATUN04
WHERE
(Participant <> AssnNumFK)
AND (Participant <> '200')
GROUP BY UnitNumFK
ORDER BY UnitNumFK

endSQL

; :PRIV:statun08
sqlqs8 = SQL

SELECT DISTINCT UnitNumFK, AssnNumFK, SUM(CurrentBal) AS TotBal
FROM STATUN00
GROUP BY UnitNumFK, AssnNumFK
ORDER BY UnitNumFK, AssnNumFK

endSQL

; :PRIV:statun09
sqlqs9 = SQL

SELECT DISTINCT UnitNumFK, SUM(TranTot) AS TotTran
FROM STATUN04
GROUP BY UnitNumFK
ORDER BY UnitNumFK

endSQL

; :PRIV:statun10
sqlqs10 = SQL

SELECT S01.P1Bal, S02.P2Bal, S03.P3Bal,
S05.P1Trans, S06.P2Trans, S07.P3Trans,
S08.UnitNumFK, S08.AssnNumFK, S08.TotBal,
S09.TotTran
FROM statun08 S08
LEFT OUTER JOIN statun09 S09
ON (S08.UnitNumFK = S09.UnitNumFK)
LEFT OUTER JOIN statun01 S01
ON (S08.UnitNumFK = S01.UnitNumFK)
LEFT OUTER JOIN statun02 S02
ON (S08.UnitNumFK = S02.UnitNumFK)
LEFT OUTER JOIN statun03 S03
ON (S08.UnitNumFK = S03.UnitNumFK)
LEFT OUTER JOIN statun05 S05
ON (S08.UnitNumFK = S05.UnitNumFK)
LEFT OUTER JOIN statun06 S06
ON (S08.UnitNumFK = S06.UnitNumFK)
LEFT OUTER JOIN statun07 S07
ON (S08.UnitNumFK = S07.UnitNumFK)

endSQL

; :PRIV:statun11
sqlqs11= SQL

SELECT UnitNumFK, AssnNumFK, TotBal AS CurrBal, (P1Bal - P1Trans) AS
P1Bal, (P2Bal - P2Trans) AS P2Bal, (P3Bal - P3Trans) AS P3Bal, (TotBal -
TotTran) AS TotBal
FROM STATUN0A

endSQL



try

lSuccess = False
dbWork.open(":work:")
dbPriv.open("riv:")


vfail = ""

frm.open(":haiformrogres2")
frm.msg.value="Gathering Balances..."
sqlqs0.executeSQL(dbpriv, ":PRIV:statun00")
Sleep(2000)
;sqlqs1.writeSQL("riv:sqlqs1.txt")
;sleep(100)
sqlqs1.executeSQL(dbpriv, ":PRIV:statun01")
Sleep(2000)
sqlqs2.executeSQL(dbpriv, ":PRIV:statun02")
Sleep(2000)
sqlqs3.executeSQL(dbpriv, ":PRIV:statun03")
Sleep(2000)
frm.msg.value="Gathering Future Transactions..."
sqlqs4.executeSQL(dbpriv, ":PRIV:statun04")
Sleep(2000)
frm.msg.value="Summarizing..."
sqlqs5.executeSQL(dbpriv, ":PRIV:statun05")
Sleep(2000)
sqlqs6.executeSQL(dbpriv, ":PRIV:statun06")
Sleep(2000)
frm.msg.value="Summarizing...."
sqlqs7.executeSQL(dbpriv, ":PRIV:statun07")
Sleep(2000)
sqlqs8.executeSQL(dbpriv, ":PRIV:statun08")
Sleep(2000)
frm.msg.value="Summarizing....."
sqlqs9.executeSQL(dbpriv, ":PRIV:statun09")
Sleep(2000)
sqlqs10.executeSQL(dbpriv, ":PRIV:statun0a")
Sleep(2000)
frm.msg.value="Summarizing......"
sqlqs11.executeSQL(dbpriv, ":PRIV:statun0b")
Sleep(2000)

dbpriv.close()
WriteLogComment("StatusPrep method successful")
lSuccess = True ; got here...
frm.close()
RETURN LSuccess




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.