Page 1 of 1

SQL Error: POSITIVE VALUE EXPECTED when using ftString field type

Posted: Tue 10 Dec 2013 16:54
by Bjarke_Moholt
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

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

Posted: Thu 12 Dec 2013 07:19
by AndreyZ
This problem is already fixed. You should upgrade IBDAC to version 5.1.4.

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

Posted: Thu 12 Dec 2013 08:43
by Bjarke_Moholt
It seems I'm already running 5.1.4 in Delphi XE

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

Posted: Fri 13 Dec 2013 11:49
by AndreyZ
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 .

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

Posted: Mon 16 Dec 2013 09:29
by Bjarke_Moholt
A sample project has been sent to you, please verify that it has been received

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

Posted: Mon 16 Dec 2013 10:19
by AndreyZ
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).

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

Posted: Mon 06 Jan 2014 09:49
by Bjarke_Moholt
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?

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

Posted: Wed 08 Jan 2014 13:38
by ZEuS
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).