TimeStamp in Where clause

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mmagni
Posts: 3
Joined: Thu 26 Apr 2007 21:59

TimeStamp in Where clause

Post by mmagni » Thu 26 Apr 2007 22:12

Hello

I'm testing IBDAC 2.0 with Firebird 2.0.

I want that update sentences using primary key and a change_stamp field (its type is TIMESTAMP) in where clause to update the a record:
UPDATE "DESCRIPTOR_CATEGORIES"
SET
"DESCRIPTOR_CATEGORY_ID" = :"DESCRIPTOR_CATEGORY_ID", "DESCRIPTOR_CATEGORY" = :"DESCRIPTOR_CATEGORY", "ORDER" = :"ORDER", "APP_SESSION_ID" = :"APP_SESSION_ID"
WHERE
"DESCRIPTOR_CATEGORY_ID" = :"Old_DESCRIPTOR_CATEGORY_ID"
AND "CHANGE_STAMP" = :"Old_CHANGE_STAMP"

The SQL sentence is:
select * from DESCRIPTOR_CATEGORIES

The Refresh Query is:
SELECT "DESCRIPTOR_CATEGORIES"."DESCRIPTOR_CATEGORY_ID", "DESCRIPTOR_CATEGORIES"."DESCRIPTOR_CATEGORY", "DESCRIPTOR_CATEGORIES"."ORDER", "DESCRIPTOR_CATEGORIES"."CHANGE_STAMP", "DESCRIPTOR_CATEGORIES"."APP_SESSION_ID" FROM "DESCRIPTOR_CATEGORIES"
WHERE
"DESCRIPTOR_CATEGORY_ID" = :"DESCRIPTOR_CATEGORY_ID"

When trying to apply changes to database an exception is raised:
"Project IBDacTest.exe raised exception class EDatabaseError with message 'Update failed. Found 0 records'."

The monitor shows the following information:
select * from DESCRIPTOR_CATEGORIES
UPDATE "DESCRIPTOR_CATEGORIES"
SET
"DESCRIPTOR_CATEGORY_ID" = :"DESCRIPTOR_CATEGORY_ID", "DESCRIPTOR_CATEGORY" = :"DESCRIPTOR_CATEGORY", "ORDER" = :"ORDER", "CHANGE_STAMP" = :"CHANGE_STAMP", "APP_SESSION_ID" = :"APP_SESSION_ID"
WHERE
"DESCRIPTOR_CATEGORY_ID" = :"Old_DESCRIPTOR_CATEGORY_ID"
AND CHANGE_STAMP = :OLD_CHANGE_STAMP

:DESCRIPTOR_CATEGORY_ID(INTEGER)=3
:DESCRIPTOR_CATEGORY(VARCHAR[11])='Hobbies DDD'
:ORDER()=20
:CHANGE_STAMP(TIMESTAMP)=26/04/2007
:APP_SESSION_ID(INTEGER)=265
:Old_DESCRIPTOR_CATEGORY_ID(INTEGER)=3
:OLD_CHANGE_STAMP(TIMESTAMP)=26/04/2007

I use CHANGE_STAMP to manage concurrency.
Could somebody help me with this issue?

Thanks in advance.

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Fri 27 Apr 2007 07:04

We couldn't reproduce this problem.
Please specify complete IBDAC version(e.g. 2.0.0.6), and table srcipt.
If it is possible, send us a small demo project that demonstrates this problem with the script to create server side objects.

mmagni
Posts: 3
Joined: Thu 26 Apr 2007 21:59

Post by mmagni » Fri 27 Apr 2007 13:14

Hello

Product Versions:
Core Lab IBDAC 2.00.0.6 for Delphi 2007
Firebird 2.0.0.12748
Delphi 2007 Trial

A complete test case (only 38 kB) can be downloaded from
http://www.it-builder.com.ar/repository/IbDacTest.rar

I hope this help.

Thank for your quick response.

Mauricio Magni.

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Sat 28 Apr 2007 08:23

Thank you for assistance. We have reproduced this problem and fixed it. This fix will be included in the next IBDAC buld.

Post Reply