Subject | RE: [IBO] Long Qry Index Out of Bound Error Pls Hlp |
---|---|
Author | Helen Borrie |
Post date | 2006-12-23T05:28:53Z |
At 03:46 PM 23/12/2006, you wrote:
practice in any case but, in IBO, you must set JoinLinks to isolate
join criteria from search criteria. Almost certainly the Index Out
of Bounds error is coming from IBO's attempt to read your
(non-existent) JoinLinks.
To make the above [ disgustingly ugly ] statement work properly, set
the JoinLinks to
EmployeeMaster.EmpCode=AD1_TEMPREPYPAYROLLMASTER.EmpCode
AD1_TEMPREPYPAYROLLMASTER.DsgCode=Designations.DsgCode
Departments.DptCode=AD1_TEMPREPYPAYROLLMASTER.DptCode
But, far better is to train yourself to use the clearer, more
self-documenting SQL-92 join syntax (and also to train yourself to
post clean code examples to the lists when you are seeking
help!!). Besides removing the need to provide JoinLinks, doing so
will find at least two errors in the statement that you provided:
SELECT
YY.*,
EM.EMPNAME,
EM.DOB,EM.SEX,
EM.MARITAL, [etc.],
DG.DSGNAME,
DP.DPTNAME, B.*,
(TRIM(B.FLATNO)|| ' '||TRIM(B.BUILDINGNAME) || ' '
||TRIM(B.ROADADDRESS)|| ' ' || TRIM(B.AREA) || ' ' || TRIM(B.CITY)
|| ' ' || TRIM(B.PIN)) ONELINEADDR
FROM
AD1_TEMPREPYPAYROLLMASTER YY
join EMPLOYEEMASTER EM on EM.EMPCODE = YY.EMPCODE
join DESIGNATIONS DG on YY.DSGCODE = DG.DSGCODE
join DEPARTMENTS DP on DP.DPTCODE = YY.DPTCODE
join AD1_REPFORMSHEADER B on ????????
WHERE
YY.PGCODE='STAFF' AND
?????.ESI <> 0
ORDER BY
YY.YEARMONTHS,
EM.EMPCODE
Helen
>Hi Markus,Specifically do not use SQL-89 join syntax with IBO. It is not good
>
> Thanks for your reply. The information you asked are as follows
>
> Front End - Delphi 5.0
>
> Firebird Version 2.0
>
> IBO : IBO_4_6_B
>
> The SQL :
>
> SELECT YY.*,EM.EMPNAME,EM.DOB,EM.SEX,EM.MARITAL,EM.DOJ,
>EM.AUTOCUT,EM.EMPBNKCODE,EM.EMPACNO,EM.EYRBNKCODE,EM.EYRACNO,EM.STATUS,
>EM.PFNO,EM.PANNO,EM.ESINO,EM.PFJOINDATE,EM.NOTICEPERIOD,EM.PHOTOPATH,
>EM.EMAILID,EM.EMPFATHERNAME,EM.EMPPRADD1,EM.EMPPRADD2,EM.EMPPRADD3,EM.EMPPRPINCODE,
>EM.EMPPRPHONENO,EM.EMPPEADD1,EM.EMPPEADD2,EM.EMPPEADD3,EM.EMPPEPINCODE,EM.EMPPEPHONENO,
>EM.EMPDISPENSARY,EM.EFFDATE,EM.CCCODE,EM.FROMDATE,EM.APPLIEDDATE,
>EM.RESIGNNOTSETTLE,EM.LASTPRESDATE,EM.CALCSTATDED,EM.PFGROUPCODE,EM.LGCODE,
>EM.RETIREMENTDATE, EM.PENSIONNO,EM.ESIAPP, DG.DSGNAME, DP.DPTNAME, B.*
>,(TRIM(B.FLATNO)|| ' '||TRIM(B.BUILDINGNAME) || ' '
>||TRIM(B.ROADADDRESS)|| ' ' || TRIM(B.AREA) || ' ' || TRIM(B.CITY) || ' '
>|| TRIM(B.PIN)) ONELINEADDR FROM AD1_TEMPREPYPAYROLLMASTER YY,
>EMPLOYEEMASTER EM, DESIGNATIONS DG, DEPARTMENTS DP, AD1_REPFORMSHEADER
>B WHERE ((EM.EMPCODE = YY.EMPCODE) AND (YY.DSGCODE = DG.DSGCODE)
>AND (DP.DPTCODE = YY.DPTCODE) AND (YY.PGCODE='STAFF') AND (ESI <> 0))
>ORDER BY YY.YEARMONTHS,EM.EMPCODE
practice in any case but, in IBO, you must set JoinLinks to isolate
join criteria from search criteria. Almost certainly the Index Out
of Bounds error is coming from IBO's attempt to read your
(non-existent) JoinLinks.
To make the above [ disgustingly ugly ] statement work properly, set
the JoinLinks to
EmployeeMaster.EmpCode=AD1_TEMPREPYPAYROLLMASTER.EmpCode
AD1_TEMPREPYPAYROLLMASTER.DsgCode=Designations.DsgCode
Departments.DptCode=AD1_TEMPREPYPAYROLLMASTER.DptCode
But, far better is to train yourself to use the clearer, more
self-documenting SQL-92 join syntax (and also to train yourself to
post clean code examples to the lists when you are seeking
help!!). Besides removing the need to provide JoinLinks, doing so
will find at least two errors in the statement that you provided:
SELECT
YY.*,
EM.EMPNAME,
EM.DOB,EM.SEX,
EM.MARITAL, [etc.],
DG.DSGNAME,
DP.DPTNAME, B.*,
(TRIM(B.FLATNO)|| ' '||TRIM(B.BUILDINGNAME) || ' '
||TRIM(B.ROADADDRESS)|| ' ' || TRIM(B.AREA) || ' ' || TRIM(B.CITY)
|| ' ' || TRIM(B.PIN)) ONELINEADDR
FROM
AD1_TEMPREPYPAYROLLMASTER YY
join EMPLOYEEMASTER EM on EM.EMPCODE = YY.EMPCODE
join DESIGNATIONS DG on YY.DSGCODE = DG.DSGCODE
join DEPARTMENTS DP on DP.DPTCODE = YY.DPTCODE
join AD1_REPFORMSHEADER B on ????????
WHERE
YY.PGCODE='STAFF' AND
?????.ESI <> 0
ORDER BY
YY.YEARMONTHS,
EM.EMPCODE
Helen