Icon View Incident Report

Minor Minor
Reported By: Ralf Bertoldi
Reported On: 12/19/2005
For: Version 4.22 Build 3
# 2151 Using LASTAUTOINC Function Before a Parameter in INSERT Statement Causes Error

The first query below is working fine. If using parameters, like in the second query, the SQL raises an error REQUEST_EXECUTESTMT (error 11279).

First Query:

myquery.SQL.Text := 'INSERT INTO mytable '+
 '(id,mytext,mydate)'+
 'VALUES '+
 '(LASTAUTOINC(''mytable'')+1,''some text'', CURRENT_TIMESTAMP)';
myQuery.ExecSQL;

Second Query:

myquery.SQL.Text := 'INSERT INTO mytable '+
 '(id,mytext,mydate)'+
 'VALUES '+
 '(LASTAUTOINC(''mytable'')+1,:mytext, CURRENT_TIMESTAMP)';
myQuery.ParamBynamemytextxt').AsString := 'my text';
myQuery.ExecSQL;



Comments Comments and Workarounds
The workaround is to not use the parameterized version.


Resolution Resolution
Fixed Problem on 1/7/2006 in version 4.22 build 4


Products Affected Products Affected
DBISAM Additional Software and Utilities
DBISAM ODBC Client-Server
DBISAM ODBC Client-Server with Source
DBISAM ODBC Standard
DBISAM ODBC Standard with Source
DBISAM VCL Client-Server
DBISAM VCL Client-Server with Source
DBISAM VCL Standard
DBISAM VCL Standard with Source

Image