Thanks in advance, and I apologize if any of you feel this has been posted to the wrong forum, it was originally posted in the delphi forum.
Original post:
thread102-450082 am now working with a SQL statement and code as follows:
strSQL := 'UPDATE [WFSetup]' +
'SET [LastNo] = ' +
'(SELECT [LastNo] AS dLastNo ' +
'FROM [WFSetup]) + 1';
if odbcStmt.ExecDirect(strSQL) then
begin
if odbcStmt.Fetch then //<---
begin
dTemp := odbcStmt.GetDataAsDouble('dLastNo');
I error out on the fetch, the statement has executed so I cannot fetch as I would normally. If the fetch is removed I don't have access to the dLoastNo variable.
I am hoping there is a way to rewrite the SQL statement, any help in this would be appreciated, thanks.
Andrew
Original post:
thread102-450082 am now working with a SQL statement and code as follows:
strSQL := 'UPDATE [WFSetup]' +
'SET [LastNo] = ' +
'(SELECT [LastNo] AS dLastNo ' +
'FROM [WFSetup]) + 1';
if odbcStmt.ExecDirect(strSQL) then
begin
if odbcStmt.Fetch then //<---
begin
dTemp := odbcStmt.GetDataAsDouble('dLastNo');
I error out on the fetch, the statement has executed so I cannot fetch as I would normally. If the fetch is removed I don't have access to the dLoastNo variable.
I am hoping there is a way to rewrite the SQL statement, any help in this would be appreciated, thanks.
Andrew