Hi,
I have a problem while commiting database recs on an appserver procedure.
I have 2 procs, 1 local which holds the updated row when the user presses the saverec button.
This record is sent to the appserver procedure as table-handle.
On the appserver there is also a buffer for the table to commit the changes. ON appserver, a buffer handle to the update temp-table is created, and a buffer copy is executed to the table (after record is positioned to the right rec. pointer. The Update buffer has 2 exta fields, namely RowIdent which holds the rowid to search te record to commit and rowmod, which indicates if record is update or add.
SnapShot of Code:
/* If not bChanged, update record on serverside */
/* bhRowObjUpd_AI contains the changed record */
/* bhTable contains the current value before update */
IF NOT bChanged AND bhRowObjUpd_AI:AVAILABLE THEN DO:
rRowIdent = bhTable:ROWID.
bhTable:FIND-BY-ROWID(rRowIdent,EXCLUSIVE-LOCK).
bhTable:BUFFER-COPY(bhRowObjUpd_AI,"RowIdent,RowMod":U) NO-ERROR.
IF ERROR-STATUS:ERROR THEN
DO:
DO i = 1 TO ERROR-STATUS:NUM-MESSAGES:
ERROR-STATUS:GET-NUMBER(i).
cRet = cRet + " <15> " + ERROR-STATUS:GET-MESSAGE(i) + " ":U + CHR(13) + CHR(10).
END.
END.
Problem is that after the update occurs (buffer-copy) the record isn't changed at all, just reset to it's original values.
Ex. cusomter x changed to y,
after buffer-copy still x in database table.
Any clue ?
Thanx for any response,
Emmanuel.
bhTable:FIND-BY-ROWID(rRowIdent,NO-LOCK).
END.
I have a problem while commiting database recs on an appserver procedure.
I have 2 procs, 1 local which holds the updated row when the user presses the saverec button.
This record is sent to the appserver procedure as table-handle.
On the appserver there is also a buffer for the table to commit the changes. ON appserver, a buffer handle to the update temp-table is created, and a buffer copy is executed to the table (after record is positioned to the right rec. pointer. The Update buffer has 2 exta fields, namely RowIdent which holds the rowid to search te record to commit and rowmod, which indicates if record is update or add.
SnapShot of Code:
/* If not bChanged, update record on serverside */
/* bhRowObjUpd_AI contains the changed record */
/* bhTable contains the current value before update */
IF NOT bChanged AND bhRowObjUpd_AI:AVAILABLE THEN DO:
rRowIdent = bhTable:ROWID.
bhTable:FIND-BY-ROWID(rRowIdent,EXCLUSIVE-LOCK).
bhTable:BUFFER-COPY(bhRowObjUpd_AI,"RowIdent,RowMod":U) NO-ERROR.
IF ERROR-STATUS:ERROR THEN
DO:
DO i = 1 TO ERROR-STATUS:NUM-MESSAGES:
ERROR-STATUS:GET-NUMBER(i).
cRet = cRet + " <15> " + ERROR-STATUS:GET-MESSAGE(i) + " ":U + CHR(13) + CHR(10).
END.
END.
Problem is that after the update occurs (buffer-copy) the record isn't changed at all, just reset to it's original values.
Ex. cusomter x changed to y,
after buffer-copy still x in database table.
Any clue ?
Thanx for any response,
Emmanuel.
bhTable:FIND-BY-ROWID(rRowIdent,NO-LOCK).
END.