Hi everybody. We are moving into InterBase for our tables instead of using flat files (DBF's) and I am stuck on something.
I am designing a daily tracking application for sales calls and the like and need to be able to update an existing record in an InterBase table.
I have a stored procedure and a generator which create a new record and increment the primary key when the application is initialized.
I'm using a page control to separate many data entry points and would like to update the just created record with newly entered data after the user moves to the next page(s).
My problem is I can't figure out how to get the GEN_ID (primary key) into an UPDATE SQL statement so the app knows which record to update.
I'm stuck here:
[tt]
UPDATE DT_COMPLETE SET CM_CLINIC = :clinic, CM_WEEK_OF = :week_of, CM_WHO_ADDED = :user, CM_REF_TH = :ref_th, CM_REF_FR = :ref_fr, CM_REF_MN = :ref_mn, CM_REF_TS = :ref_ts, CM_REF_WD = :ref_wd, CM_REF_TOTAL = :ref_total WHERE CM_ID = :id;
[/tt]
The :id param needs to be populated with the generated primary key. I'm used to doing this with the web where I can use sessions and queryStrings, I'm just not sure how to translate it to Delphi 7.
Any help would be greatly appreciated.
I am designing a daily tracking application for sales calls and the like and need to be able to update an existing record in an InterBase table.
I have a stored procedure and a generator which create a new record and increment the primary key when the application is initialized.
I'm using a page control to separate many data entry points and would like to update the just created record with newly entered data after the user moves to the next page(s).
My problem is I can't figure out how to get the GEN_ID (primary key) into an UPDATE SQL statement so the app knows which record to update.
I'm stuck here:
[tt]
UPDATE DT_COMPLETE SET CM_CLINIC = :clinic, CM_WEEK_OF = :week_of, CM_WHO_ADDED = :user, CM_REF_TH = :ref_th, CM_REF_FR = :ref_fr, CM_REF_MN = :ref_mn, CM_REF_TS = :ref_ts, CM_REF_WD = :ref_wd, CM_REF_TOTAL = :ref_total WHERE CM_ID = :id;
[/tt]
The :id param needs to be populated with the generated primary key. I'm used to doing this with the web where I can use sessions and queryStrings, I'm just not sure how to translate it to Delphi 7.
Any help would be greatly appreciated.