Subject Re: [IBO] Long Qry Index Out of Bound Error Pls Hlp
Author niegil_firebirddev
Hi Helen,

I have mentioned before that , i am doing a conversion project .
Which has a source code written long back . Our present requriement
is to just change the backend to firebird without even altering the
sql layer except for some syntax changes . So as long as the
existing sql are written with a Sql 89 script i have to continue to
do the same .

And about posting clean code to the list i didn't understand whats
wrong with my code. To many people around the code is fine and good

And the problem what i mentioned was solved by changing my
IBOQuery1.ExecSql to IBOQuery1.Active :=True;

And ofcource we are and will be using Sql 92 script for our new
projects except for this conversion one (based on requirement).
Before commentying any code pls note on what basis that code was
written.

Thank and Rgds

Niegil Thomas


--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
>
> At 03:46 PM 23/12/2006, you wrote:
> >Hi Markus,
> >
> > 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.STAT
US,
>
>EM.PFNO,EM.PANNO,EM.ESINO,EM.PFJOINDATE,EM.NOTICEPERIOD,EM.PHOTOPATH
,
>
>EM.EMAILID,EM.EMPFATHERNAME,EM.EMPPRADD1,EM.EMPPRADD2,EM.EMPPRADD3,E
M.EMPPRPINCODE,
>
>EM.EMPPRPHONENO,EM.EMPPEADD1,EM.EMPPEADD2,EM.EMPPEADD3,EM.EMPPEPINCO
DE,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
>
> Specifically do not use SQL-89 join syntax with IBO. It is not
good
> 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
>