Subject IBO 3.6 query parser makes mistakes with comments
Author Jeroen W. Pluimers (mailings)
The IBO Query parser has problems when part of the ORDER BY is actually a
comment.

The statement below put into a TIBOQuery.SQL generates the following error:

Error:

ISC ERROR CODE:335544569 ISC ERROR MESSAGE: Dynamic SQL Error SQL error
code = -104 Token unknown - line 21, char 9 ASC STATEMENT:
TIBOInternalDataset:
"VacancyTurnAroundTimeIBOQuery.IBOqrVacancyTurnAroundTimeIBOQuery"
stHandle=32301556 (ERROR)

Statement:

select
vacancyturnaroundtimereport.companyid
, vacancyturnaroundtimereport.vacancyid
, vacancyturnaroundtimereport.workflowid
, vacancyturnaroundtimereport.recruituserid
, vacancyturnaroundtimereport.initialdate
, vacancyturnaroundtimereport.sequencedate
, vacancyturnaroundtimereport.sequencenumber
, cast(1 + vacancyturnaroundtimereport.sequencedate - initialdate as
integer) duration
, vacancyturnaroundtimereport.sequencedescription
, VacancyOverView.RFUNCTIONNAME
, VacancyOverView.RCOMPANYNAME
, VacancyOverView.RRECRUITERNAME

from vacancyturnaroundtimereport

join VacancyOverView(vacancyturnaroundtimereport.companyid,
vacancyturnaroundtimereport.vacancyid)
on 1=1

order by
/*
vacancyturnaroundtimereport.companyid
, vacancyturnaroundtimereport.vacancyid
, vacancyturnaroundtimereport.workflowid
, vacancyturnaroundtimereport.recruituserid
*/
VacancyOverView.RCOMPANYNAME
, VacancyOverView.RFUNCTIONNAME
, VacancyOverView.RRECRUITERNAME
, vacancyturnaroundtimereport.initialdate
, vacancyturnaroundtimereport.sequencenumber
, vacancyturnaroundtimereport.sequencedate


Actual statement sent to Interbase (captured by the IB_Monitor):

/*---
[ 30-08-2001 11:58:12 ]
PREPARE STATEMENT
TR_HANDLE = 32301512
STMT_HANDLE = 32301556

select
vacancyturnaroundtimereport.companyid
, vacancyturnaroundtimereport.vacancyid
, vacancyturnaroundtimereport.workflowid
, vacancyturnaroundtimereport.recruituserid
, vacancyturnaroundtimereport.initialdate
, vacancyturnaroundtimereport.sequencedate
, vacancyturnaroundtimereport.sequencenumber
, cast(1 + vacancyturnaroundtimereport.sequencedate - initialdate as
integer) duration
, vacancyturnaroundtimereport.sequencedescription
, VacancyOverView.RFUNCTIONNAME
, VacancyOverView.RCOMPANYNAME
, VacancyOverView.RRECRUITERNAME

from vacancyturnaroundtimereport

join VacancyOverView(vacancyturnaroundtimereport.companyid,
vacancyturnaroundtimereport.vacancyid)
on 1=1
WHERE
( RECRUITUSERID = 1 ) or ( RECRUITUSERID IS NULL )
ORDER BY ASC
, vacancyturnaroundtimereport.vacancyid ASC
, vacancyturnaroundtimereport.workflowid ASC
, vacancyturnaroundtimereport.recruituserid */
VacancyOverView.RCOMPANYNAME ASC
, VacancyOverView.RFUNCTIONNAME ASC
, VacancyOverView.RRECRUITERNAME ASC
, vacancyturnaroundtimereport.initialdate ASC
, vacancyturnaroundtimereport.sequencenumber ASC
, vacancyturnaroundtimereport.sequencedate ASC

FIELDS = [ Version 1 SQLd 14 SQLn 12
EVENTBROWSERVIEWONUSER.REVENTID = <NIL>
EVENTBROWSERVIEWONUSER.RCONTACTID = <NIL>
EVENTBROWSERVIEWONUSER.RCOMPANYID = <NIL>
EVENTBROWSERVIEWONUSER.RVACANCYID = <NIL>
EVENTBROWSERVIEWONUSER.RCANDIDATEID = <NIL>
EVENTBROWSERVIEWONUSER.RRECRUITUSERID = <NIL>
EVENTBROWSERVIEWONUSER.RWORKFLOWTASKID = <NIL>
EVENTBROWSERVIEWONUSER.RWORKFLOWID = <NIL>
EVENTBROWSERVIEWONUSER.RNAME = <NIL>
EVENTBROWSERVIEWONUSER.RTYPE = <NIL>
EVENTBROWSERVIEWONUSER.RRECRUITERNAME = <NIL>
EVENTBROWSERVIEWONUSER.REVENTSTARTDATE = <NIL> ]

SECONDS = 0,000

ERRCODE = 335544569
----*/



--
Jeroen W. Pluimers
Consultant at All I M
http://www.all-im.com