Hi Mark, excuse for my delay.
I changed the code for:
Code: Select all
procedure TZInterbase6PreparedStatement.Prepare;
begin
LogPrepStmtMessage(lcPrepStmt, SQL);
StmtHandle := nil;
with FIBConnection do
begin
StatementType := ZDbcInterbase6Utils.PrepareStatement(GetPlainDriver,
GetDBHandle, GetTrHandle, GetDialect, SQL, StmtHandle);
if StatementType in [stSelect, stExecProc] then
begin
SQLData := TZResultSQLDA.Create(GetPlainDriver, GetDBHandle, GetTrHandle);
PrepareResultSqlData(GetPlainDriver, GetDBHandle, GetDialect,
SQL, StmtHandle, SQLData);
end;
end;
CheckInterbase6Error(SQL);
// LogPrepStmtMessage(lcPrepStmt, SQL);
inherited Prepare;
end;
And I provoked the error, and generated the log and trace:
LOG:
Code: Select all
2010-09-21 11:15:44 cat: Connect, proto: firebird-2.1, msg: CONNECT TO "C:\Users\silvioprog\Desktop\TEMP\EditBug\TEST.FDB" AS USER "SYSDBA"
2010-09-21 11:15:44 cat: Transaction, proto: firebird-2.1, msg: TRANSACTION STARTED.
2010-09-21 11:15:44 cat: Prepare, proto: firebird-2.1, msg: Statement 1 : select * from tabletest
order by oid
2010-09-21 11:15:44 cat: Execute prepared, proto: firebird-2.1, msg: Statement 1
2010-09-21 11:15:44 cat: Execute, proto: firebird-2.1, msg: SELECT a.RDB$RELATION_NAME, a.RDB$FIELD_NAME, a.RDB$FIELD_POSITION, a.RDB$NULL_FLAG, a.RDB$DEFAULT_VALUE, b. RDB$FIELD_LENGTH, b.RDB$FIELD_SCALE, c.RDB$TYPE_NAME, b.RDB$FIELD_TYPE, b.RDB$FIELD_SUB_TYPE, b.RDB$DESCRIPTION, b.RDB$CHARACTER_LENGTH, b.RDB$FIELD_PRECISION, a.RDB$DEFAULT_SOURCE, b.RDB$DEFAULT_SOURCE as RDB$DEFAULT_SOURCE_DOMAIN,b.RDB$COMPUTED_SOURCE as RDB$COMPUTED_SOURCE FROM RDB$RELATION_FIELDS a JOIN RDB$FIELDS b ON (b.RDB$FIELD_NAME = a.RDB$FIELD_SOURCE) LEFT JOIN RDB$TYPES c ON (b.RDB$FIELD_TYPE = c.RDB$TYPE and c.RDB$FIELD_NAME = 'RDB$FIELD_TYPE') WHERE a.RDB$RELATION_NAME = 'TABLETEST' ORDER BY a.RDB$RELATION_NAME, a.RDB$FIELD_POSITION
2010-09-21 11:15:46 cat: Execute, proto: firebird-2.1, msg: Dynamic SQL Error SQL error code = -206 Column unknown A.RDB$FIELD_POSITIONTION At line 1, column 641, errcode: -206, error: Column does not belong to referenced table
TRACE:
Code: Select all
#0 fpc_raiseexception at :0
#1 CHECKINTERBASE6ERROR({<IZPLAINDRIVER> = {<IUNKNOWN> = {}, }, }, #1#249#1't'#4'2'#1#2#1'>'#2#12#1#152#4#1#4#129#0'p'#10, LCEXECUTE, 0x0) at C:\Repository\svn\zeos\src\dbc\ZDbcInterbase6Utils.pas:818
#2 PREPARESTATEMENT({<IZPLAINDRIVER> = {<IUNKNOWN> = {}, }, }, 0x28c4a6c, 0x28c4a70, 3, 0x0, 0x5) at C:\Repository\svn\zeos\src\dbc\ZDbcInterbase6Utils.pas:858
#3 TZINTERBASE6PREPAREDSTATEMENT__PREPARE(<error reading variable>) at C:\Repository\svn\zeos\src\dbc\ZDbcInterbase6Statement.pas:560
#4 TZINTERBASE6PREPAREDSTATEMENT__CREATE({<IUNKNOWN> = {}, }, 0x0, 0x0, 0x6c2528, <error reading variable>) at C:\Repository\svn\zeos\src\dbc\ZDbcInterbase6Statement.pas:542
#5 TZINTERBASE6CONNECTION__CREATEPREPAREDSTATEMENT(0x0, 0x0, <error reading variable>, {<IZSTATEMENT> = {<IUNKNOWN> = {}, }, }) at C:\Repository\svn\zeos\src\dbc\ZDbcInterbase6.pas:598
#6 TZABSTRACTCONNECTION__PREPARESTATEMENT(0x0, <error reading variable>, {<IZSTATEMENT> = {<IUNKNOWN> = {}, }, }) at C:\Repository\svn\zeos\src\dbc\ZDbcConnection.pas:551
#7 TZGENERICCACHEDRESOLVER__CREATERESOLVERSTATEMENT(0x0, <error reading variable>, {<IZSTATEMENT> = {<IUNKNOWN> = {}, }, }) at C:\Repository\svn\zeos\src\dbc\ZDbcGenericResolver.pas:325
#8 TZGENERICCACHEDRESOLVER__POSTUPDATES({<IZRESULTSET> = {<IUNKNOWN> = {}, }, }, UTMODIFIED, 0x2854138, 0x2854178, <error reading variable>) at C:\Repository\svn\zeos\src\dbc\ZDbcGenericResolver.pas:837
#9 TZABSTRACTCACHEDRESULTSET__POSTROWUPDATES(0x2854138, 0x2854178, <error reading variable>) at C:\Repository\svn\zeos\src\dbc\ZDbcCachedResultSet.pas:439
#10 TZABSTRACTCACHEDRESULTSET__POSTUPDATES(<error reading variable>) at C:\Repository\svn\zeos\src\dbc\ZDbcCachedResultSet.pas:546
#11 TZABSTRACTCACHEDRESULTSET__UPDATEROW(<error reading variable>) at C:\Repository\svn\zeos\src\dbc\ZDbcCachedResultSet.pas:1610
#12 TZABSTRACTDATASET__INTERNALUPDATE(<error reading variable>) at C:\Repository\svn\zeos\src\component\ZAbstractDataset.pas:381
#13 TZABSTRACTDATASET__INTERNALPOST(<error reading variable>) at C:\Repository\svn\zeos\src\component\ZAbstractDataset.pas:470
#14 DB_TDATASET_$__TRYDOING$TDATAOPERATION$TDATASETERROREVENT$$BOOLEAN at :0
#15 DB_TDATASET_$__POST at :0
#16 TDBCUSTOMNAVIGATOR__BTNCLICK(NBPOST, <error reading variable>) at .\include\dbcustomnavigator.inc:386
#17 TDBCUSTOMNAVIGATOR__BUTTONCLICKHANDLER(0x3ed8fc8, <error reading variable>) at .\include\dbcustomnavigator.inc:299
#18 TCONTROL__CLICK(<error reading variable>) at .\include\control.inc:2251
#19 TCUSTOMSPEEDBUTTON__CLICK(<error reading variable>) at .\include\speedbutton.inc:115
#20 TCUSTOMSPEEDBUTTON__WMLBUTTONUP({MSG = 514, KEYS = 0, XPOS = 14, YPOS = 10, POS = {X = 14, Y = 10}, DUMMY = 655374, RESULT = 0}, <error reading variable>) at .\include\speedbutton.inc:797
#21 SYSTEM_TOBJECT_$__DISPATCH$formal at :0
#22 TCUSTOMSPEEDBUTTON__WSREGISTERCLASS(0x270f9ec) at .\include\speedbutton.inc:748
#23 TCONTROL__PERFORM(514, 0, 655374, <error reading variable>) at .\include\control.inc:1025
#24 TWINCONTROL__ISCONTROLMOUSEMSG(void, <error reading variable>) at .\include\wincontrol.inc:4596
#25 TWINCONTROL__WNDPROC({MSG = 514, WPARAM = 0, LPARAM = 655598, RESULT = 0, WPARAMLO = 0, WPARAMHI = 0, LPARAMLO = 238, LPARAMHI = 10, RESULTLO = 0, RESULTHI = 0}, <error reading variable>) at .\include\wincontrol.inc:5172
#26 DELIVERMESSAGE(0x3ed5fa8, void) at lclmessageglue.pas:110
#27 WINDOWPROC(1444364, 514, 0, 655598) at win32callback.inc:2422
#28 ?? at :0
#29 ?? at :0
#30 ?? at :0
#31 ?? at :0
A.RDB$FIELD_POSITIONTION? <<- TIONTION
Please excuse me if I misunderstood, my english is not very good.