More problems with output params 2: Reusing prep. statements

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
NineBerry
Posts: 11
Joined: Tue 02 Sep 2008 14:54

More problems with output params 2: Reusing prep. statements

Post by NineBerry » Thu 04 Sep 2008 13:27

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

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 08 Sep 2008 07:08

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).

NineBerry
Posts: 11
Joined: Tue 02 Sep 2008 14:54

Post by NineBerry » Mon 08 Sep 2008 11:27

Thank you very much :D

Post Reply