Page 1 of 1

More problems with output params 2: Reusing prep. statements

Posted: Thu 04 Sep 2008 13:27
by NineBerry
A TIBCSQL is prepared with the following statement:

Code: Select all

UPDATE "AvailableNumbers" SET "Available" = 0 
    WHERE ("ObjectType" = :ObjectType) AND ("Available" = 1) 
    ORDER BY "Created" 
    ROWS 1
    RETURNING "Number";
"Number" is a varchar column in the table.

The TIBCSQL is first prepared, then filled with the input parameters, then executed once. The table is set up to return NULL in the parameter RET_Number (the table is empty).

Afterwards, the table is filled with some data by some different code and the statement is executed again. It will fail with error "Unknown data type of parameter RET_Number" in TGDSCommand.BindParams

This only happens, when NULL had been returned in the parameter before. There's no problems, when a parameter value had been returned by the previous execution of the statement

Posted: Mon 08 Sep 2008 07:08
by Plash
We have fixed this problem. The fix will be included in the next build of IBDAC.

You can also avoid this problem by setting the DataType property of the RET_Number parameter to the appropriate type (ftString).

Posted: Mon 08 Sep 2008 11:27
by NineBerry
Thank you very much :D