Hello.
I'am using TSmartOraQuery. Some properties:
SQL = 'select t.rowid, t.NAME, t.ID from table t TEST'
KEYFIELDS = 'ROWID'
KEYSEQUENCE = ''
SEQUENCEMODE = smInsert
SQLREFRESH = 'where rowid = :rowid'
SQLUPDATE = 'begin upd(:ROWID, :NAME); end;
SQLINSERT = 'begin ins(:NAME); end;
When user insert new record in grid and than step for next record - method INSERT occurs and record inserted into DB by procedure "ins". Then user step back for fist record and edit it. When he again step for next record method update occurs and :ROWID is NULL. How can I get ROWID for update after inserting?
Thanks.
Returning rowid after insert by procedure
You must use OLD_ prefix in parameter name to get required ROWID value e.g.
Pls. see TCustomOraQuery.SQLUpdate , TCustomOraQuery.SQLInsert, TCustomOraQuery.SQLDelete, TCustomOraQuery.SQLRefresh and TCustomOraQuery.SQLLock topics in ODAC Help
Code: Select all
SQLUPDATE = 'begin upd(:OLD_ROWID, :NAME); end;