views:

458

answers:

1

I get this error on many of the TQuery connected to Interbase via BDE. Exact message is:

General SQL Error. Dynamic SQL Error, SQL error code = -804, SQLDA missing or incorrect version, or incorrect number/type of variables.

The message appears as soon as i try to open/edit the TQuery at design time, or when a Post is done at run time. For the Post action at run time, i have found that if i Prepare the table before the Post, the Post is done nicely.

I have read Craig Stunz's Weblog about same error [ http://blogs.teamb.com/craigstuntz/2009/01/22/37934/ ]. The parameters i have are all integers. Database is small, Interbase 2009, and i see no particular patterns with the queries that show the error message (it can be selected, deleted, updated etc.). Running the query out of Delphi is just fine.

The tables have numeric data type (15,2)

The tables have been Backup/restored from Interbase version 5 - dialect 1 to Interbase 2009

Actual ODS is 13.1 (Interbase 9)

No UDFs

Any idea what is wrong? Thanks

[UPDATE]

Samples of query not showing the error / showing the error

No Error:

select MASTER_ID, GL_ACCT_DR, GL_ACCT_CR,
VENDOR_ID, VENDOR_CODE,
ORDER_NO, ORDER_DATE, INVOICE_NO, INVOICE_DATE,
DESCRIP, BUYER, SHIP_VIA, FOB, IS_FREIGHT_PREPAID,
IS_TAXABLE, TERMS_ID, TERMS_CODE,
DISC_DAYS_OR_DATE, DISCOUNT_PCT, NET_DAYS_OR_DATE,
BILL_TO_LOC_ID, SHIP_TO_LOC_ID,
BILL_TO_LOC_CODE, SHIP_TO_LOC_CODE,
DISCOUNT_DATE, DUE_DATE
from P_JRNTRN where
ENTITY_DB_ID = :PRIMARY_DB_ID and
SRC_MODULE = 'PJ'
order by INVOICE_NO

Parameter is Integer.

Error:

select * from P_JRNTRN where
BATCH_ID = :BATCH_ID
order by MASTER_ID

Parameter is Integer.

[UPDATE] ... I've not been able to resolved this problem so i moved to IBDAC in replacement of the BDE. I get no more error. Thanks to all.

A: 

To me it looks like you have a problem with dialect 1. Di you check your conection is using that? or the default 3?

Daniel Luyo
I did move from dialect1 (interbase 5) to dialect 1 or 3 (interbase 2009) -> same errors. Note: not all query give me an error. I have posted on top question samples of quey with error and no with error. thanks.
volvox
Try changing the parameter name, may be conflicting with the field name
Daniel Luyo