SQL Error: POSITIVE VALUE EXPECTED when using ftString field type

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Bjarke_Moholt
Posts: 39
Joined: Thu 21 Nov 2013 12:51

SQL Error: POSITIVE VALUE EXPECTED when using ftString field type

Post by Bjarke_Moholt » Tue 10 Dec 2013 16:54

I experience problems when I use a TIBCLoader to import a TVirtualTable with fields defined as ftString type. This yields a 'POSITIVE VALUE EXPECTED' SQL Error.

A closer look at the SQL generated by the loader gave me this:

Code: Select all

EXECUTE BLOCK
    (P0_0 INTEGER =?,P0_1 INTEGER =?,P0_2 INTEGER =?,P0_3 INTEGER =?,P0_4 DOUBLE PRECISION =?,P0_5 VARCHAR(0) =?,P0_6 INTEGER =?,
     P1_0 INTEGER =?,P1_1 INTEGER =?,P1_2 INTEGER =?,P1_3 INTEGER =?,P1_4 DOUBLE PRECISION =?,P1_5 VARCHAR(0) =?,P1_6 INTEGER =?)
  AS BEGIN
    INSERT INTO ODVPOSET("MODEL","POSITION","SEQUENCE","TYPE","NUMVALUE","STRVALUE","UNIT")
      VALUES (:P0_0,:P0_1,:P0_2,:P0_3,:P0_4,:P0_5,:P0_6);
    INSERT INTO ODVPOSET("MODEL","POSITION","SEQUENCE","TYPE","NUMVALUE","STRVALUE","UNIT")
      VALUES (:P1_0,:P1_1,:P1_2,:P1_3,:P1_4,:P1_5,:P1_6);
  END
The VARCHAR(0) statements seem to be the source of the problem. When I omit the ftString fields from my table everything works at intended.
I have tried to specify a string size explicitly on field definition, but this has not helped.

I have put together a small demoproject that should reproduce the problem with all relevant source. Please send me an email for a link to the project

I hope you can help me resolve this issue

AndreyZ

Re: SQL Error: POSITIVE VALUE EXPECTED when using ftString field type

Post by AndreyZ » Thu 12 Dec 2013 07:19

This problem is already fixed. You should upgrade IBDAC to version 5.1.4.

Bjarke_Moholt
Posts: 39
Joined: Thu 21 Nov 2013 12:51

Re: SQL Error: POSITIVE VALUE EXPECTED when using ftString field type

Post by Bjarke_Moholt » Thu 12 Dec 2013 08:43

It seems I'm already running 5.1.4 in Delphi XE

AndreyZ

Re: SQL Error: POSITIVE VALUE EXPECTED when using ftString field type

Post by AndreyZ » Fri 13 Dec 2013 11:49

You can learn the exact version of IBDAC you are using from the About sheet of TIBCConnection Editor. If it is 5.1.4, please try creating a small sample that demonstrates the problem and send it to andreyz*devart*com .

Bjarke_Moholt
Posts: 39
Joined: Thu 21 Nov 2013 12:51

Re: SQL Error: POSITIVE VALUE EXPECTED when using ftString field type

Post by Bjarke_Moholt » Mon 16 Dec 2013 09:29

A sample project has been sent to you, please verify that it has been received

AndreyZ

Re: SQL Error: POSITIVE VALUE EXPECTED when using ftString field type

Post by AndreyZ » Mon 16 Dec 2013 10:19

I tried to download the project using the link provided in your email but the server where you uploaded the project do not respond. Please send the project directly to me (in the attachment to an email).

Bjarke_Moholt
Posts: 39
Joined: Thu 21 Nov 2013 12:51

Re: SQL Error: POSITIVE VALUE EXPECTED when using ftString field type

Post by Bjarke_Moholt » Mon 06 Jan 2014 09:49

I have updated to IBDAC 5.2.5 for RAD Studio XE now, but the error persists.
The generated SQL looks like this:

Code: Select all

'EXECUTE BLOCK (P0_0 INTEGER =?,P0_1 INTEGER =?,P0_2 INTEGER =?,P0_3 INTEGER =?,P0_4 DOUBLE PRECISION =?,P0_5 VARCHAR(0) =?,P0_6 INTEGER =?,P1_0 INTEGER =?,P1_1 INTEGER =?,P1_2 INTEGER =?,P1_3 INTEGER =?,P1_4 DOUBLE PRECISION =?,P1_5 VARCHAR(0) =?,P1_6 INTEGER =?) AS BEGIN INSERT INTO ODVPOSET("MODEL","POSITION","SEQUENCE","TYPE","NUMVALUE","STRVALUE","UNIT") VALUES (:P0_0,:P0_1,:P0_2,:P0_3,:P0_4,:P0_5,:P0_6);INSERT INTO ODVPOSET("MODEL","POSITION","SEQUENCE","TYPE","NUMVALUE","STRVALUE","UNIT") VALUES (:P1_0,:P1_1,:P1_2,:P1_3,:P1_4,:P1_5,:P1_6); END'
to my suprise the VARCHAR(0) is still present in the generated SQL. I expected this to be fixed?

ZEuS
Devart Team
Posts: 240
Joined: Thu 05 Apr 2012 07:32

Re: SQL Error: POSITIVE VALUE EXPECTED when using ftString field type

Post by ZEuS » Wed 08 Jan 2014 13:38

The error is fixed in IBDAC 5.2.5. Please, try to re-create persistent columns in the TIBCLoader component (clear the TableName property and then set it again to the needed table name).

Post Reply