|
Log in |
FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
2.07.06 bug - Delphi 7 TnxQuery code with "USING" clause broken
I have Delphi 7 code which has been broken by 2.07.06 - it was fine with
2.07.02: Using a tnxQuery component on a TDataModule, the code snippets are: cSQL_GetAnimalID_RFID = 'SELECT "AnimalID" FROM Animal INNER JOIN Devices USING (DeviceID) WHERE Devices."RFID" = :RF_ID'; with My_tnxQuery do begin Database := MyDatabase; SQL.Clear; SQL.Add(cSQL_GetAnimalID_RFID); Prepare; end; function TdmPxFarmsData.GetAnimalID(const aRFID : string) : integer; begin Result := -1; with My_txQuery do begin if Active then Close; ParamByName('RF_ID').AsString := aRFID; Open; if RecordCount > 0 then begin First; Result := FieldByName('AnimalID').AsInteger; end; end; end; With 2.07.06, the first call to GetAnimalID is successful. All subsequent calls then fail - it doesn't find any further records. Same code with 2.07.02 works as expected, finding a record each time. Replacing cSQL_GetAnimalID_RFID with any of the following causes the code to work with 2.07.06: SELECT "AnimalID" FROM Animal INNER JOIN Devices USING (DeviceID) WHERE D."RFID"=''%s'' SELECT A."AnimalID" FROM Animal A INNER JOIN Devices D ON (A."DeviceID"=D."DeviceID") where D."RFID" = :RF_ID Unfortunately, our code uses many "USING" clauses with parameterized SQL statements, so these workarounds are not an option. Can a fix be made available for this problem, as it is now holding up a major release of our product? Thanks, Greg |
#2
|
|||
|
|||
Re: 2.07.06 bug - Delphi 7 TnxQuery code with "USING" clause broken
> Can a fix be made available for this problem, as it is now holding up
> a major release of our product? First theory; try removing the Prepare; call. 2nd, we'd like to borrow the table and the actual param values to have a go at fixing. -- Eivind Bakkestuen Nexus Database Systems Pty Ltd |
#3
|
|||
|
|||
Re: 2.07.06 bug - Delphi 7 TnxQuery code with "USING" clause broken
Thanks Eivind,
Removing the Prepare call does then let the code run as expected. I have separately emailed directly to you the two nexusdb tables and a csv file with the param values. "Eivind Bakkestuen [NDD]" <Ieivind.bakkestuenHATE@nexusdb.comSPAM> wrote in message news:xn0fqrm1sd5h92000@news.nexusdb.com... >> Can a fix be made available for this problem, as it is now holding up >> a major release of our product? > > First theory; try removing the Prepare; call. 2nd, we'd like to borrow > the table and the actual param values to have a go at fixing. > > -- > > Eivind Bakkestuen > Nexus Database Systems Pty Ltd |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OT: Alternative to "IN" clause | John Turner | nexusdb.public.support.sql | 1 | 23rd January 2010 05:27 AM |
2.0.599r3: Query that should work returns Unable to resolve the identifier"#t1"."ContratoId" | =?ISO-8859-1?Q?=22Rodrigo_G=F3mez_=5BNDX=5D=22?= | nexusdb.public.support.sql | 2 | 4th November 2006 11:03 AM |
Announcment! "The Keep" ver 2.0.0.1 and "Po Boy Application LifeCycle Management Utility" ver 1.0.0.l are now both available for free download! | Robert Meek | nexusdb.public.support.thirdparty | 1 | 11th July 2004 11:23 AM |
Note 'please add "nx1xAllEngines" to your project's USES clause' | Paul Evers | nexusdb.public.support | 1 | 24th May 2004 08:32 PM |
Import CSV: Selecting "Overwrite" in "Advanced option" gives "Abstract error" when "Finish" is pressed | Jesper Østergaard | nexusdb.public.support | 1 | 6th July 2003 01:10 PM |