Subject Problem Posting a record from TIB_Query
Author Dan
I am using Delphi 6 SP 2, IBObject 4.2Ha

I have a TIB_DataSource that I switch between 19 TIB_Queries. On 4 of those
19 I am getting the following error when I post
ISC ERROR CODE : 335544485 Invalid statement handle.

All 19 tables have the same Index structure.

All queries follow the Select * from table where param1 and param2 format.

I can insert records through IBConsole in all problem tables.

I am posting a monitor script from a problem post, followed by a successful
post.

***************** Failed To Post ***********************
EXECUTE STATEMENT
TR_HANDLE = 13770176
STMT_HANDLE = 0
PARAMS = [ ]

ERRCODE = 335544485
----*/
/*---
INTERPRETE BUFFER =

ERRCODE = 24
----*/
/*---
INTERPRETE BUFFER = invalid statement handle

ERRCODE = -1
----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 13770176
STMT_HANDLE = 13811932

SELECT COUNT( * )
from Entity
where EntityCD = 0
PLAN (ENTITY NATURAL)

FIELDS = [ Version 1 SQLd 1 SQLn 1
COUNT = -1 ]
----*/
/*---
EXECUTE2 DSQL
TR_HANDLE = 13770176
STMT_HANDLE = 13811932
PARAMS = [ ]
FIELDS = [ Version 1 SQLd 1 SQLn 1
COUNT = 2 ]

SELECT COUNT: 1
----*/
/*---
CLOSE CURSOR
STMT_HANDLE = 13779328
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 13770176
STMT_HANDLE = 13779328
PARAMS = [ ]
----*/
/*---
OPEN CURSOR
STMT_HANDLE = 13779328
NAME = C2022031230050499

----*/
/*---
PREPARE STATEMENT
TR_HANDLE = 13770176
STMT_HANDLE = 13811932

SELECT COUNT( * )
from Entity
where EntityCD = 0
PLAN (ENTITY NATURAL)

FIELDS = [ Version 1 SQLd 1 SQLn 1
COUNT = -1 ]
----*/
/*---
EXECUTE2 DSQL
TR_HANDLE = 13770176
STMT_HANDLE = 13811932
PARAMS = [ ]
FIELDS = [ Version 1 SQLd 1 SQLn 1
COUNT = 2 ]

SELECT COUNT: 1
----*/
***************** Successfull Post ***********************
PREPARE STATEMENT
TR_HANDLE = 13770176
STMT_HANDLE = 13762712

INSERT INTO "STMT_1099-INT"
( TAXID
, ENTITYASPAYOR
, ENTITYASPAYEE
, TAXYEAR
, REPORTSTATECD
, ACCTNO
.
.
, RCD_STATUS)
VALUES
( ? /* "STMT_1099-INT".TAXID */
, ? /* "STMT_1099-INT".ENTITYASPAYOR */
, ? /* "STMT_1099-INT".ENTITYASPAYEE */
, ? /* "STMT_1099-INT".TAXYEAR */
, ? /* "STMT_1099-INT".REPORTSTATECD */
, ? /* "STMT_1099-INT".ACCTNO */
.
.
, ? /* "STMT_1099-INT".RCD_STATUS */ )

FIELDS = [ Version 1 SQLd 0 SQLn 36 ]

SECONDS = 0.032
----*/
/*---
EXECUTE STATEMENT
TR_HANDLE = 13770176
STMT_HANDLE = 13762712
PARAMS = [ Version 1 SQLd 20 SQLn 20
"STMT_1099-INT".TAXID = 126
"STMT_1099-INT".ENTITYASPAYOR = 18
"STMT_1099-INT".ENTITYASPAYEE = 22
"STMT_1099-INT".TAXYEAR = '2002'
"STMT_1099-INT".REPORTSTATECD = 'MI'
"STMT_1099-INT".ACCTNO = <NULL>
.
.
"STMT_1099-INT".RCD_STATUS = 'A' ]

INSERT COUNT: 1

SECONDS = 0.011
----*/
/*---
STATEMENT INFO
STMT_HANDLE = 13762712