Subject | RE: [IBO] How to pass parameter for the SP in the InsertSQL statement of TIBOQuery |
---|---|
Author | Jason Wharton |
Post date | 2004-10-28T23:32:39Z |
The parameter values are obtained from the fields that have corresponding
names.
If it isn't matching up with a field name then I don't support that kind of
usage.
Perhaps you could maintain a calculated field, though I'm not precisely sure
if the value would be updated properly just prior to sending the values to
the server. It does recalculate things after sending stuff to the server...
You may just need to manually call CalculateFields in the BeforePost event.
You can also use the OnCustomInsert event and do the entire handling of the
insert yourself manually.
HTH,
Jason Wharton
names.
If it isn't matching up with a field name then I don't support that kind of
usage.
Perhaps you could maintain a calculated field, though I'm not precisely sure
if the value would be updated properly just prior to sending the values to
the server. It does recalculate things after sending stuff to the server...
You may just need to manually call CalculateFields in the BeforePost event.
You can also use the OnCustomInsert event and do the entire handling of the
insert yourself manually.
HTH,
Jason Wharton
> -----Original Message-----
> From: jliu1530 [mailto:jliu1530@...]
> Sent: Thursday, October 28, 2004 3:47 PM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] How to pass parameter for the SP in the InsertSQL
> statement of TIBOQuery
>
>
>
>
> Hi,
>
> I would like to know how do I pass parameter for the SP I am calling
> in the InsertSQL statement a TIBOQuery.
>
> Here is my TIBOQuery object,
>
> object HolQry: TIBOQuery
> Params = <
> item
> DataType = ftUnknown
> Name = 'HOLGRPID'
> ParamType = ptInput
> end>
> AutoCalcFields = False
> AutoFetchAll = True
> BufferSynchroFlags = [bsBeforeEdit, bsAfterEdit, bsAfterInsert]
> DatabaseName = 'NDSERVER_1'
> DeleteSQL.Strings = (
> 'UPDATE HOLIDAYS SET'
> 'IN_USE = 0'
> 'WHERE HOLID = :HOLID')
> EditSQL.Strings = (
> 'UPDATE HOLIDAYS SET'
> 'HOLDATE = :HOLDATE,'
> 'HOLNAME = :HOLNAME,'
> 'AUTOEXPIRE = :AUTOEXPIRE'
> 'WHERE HOLID = :HOLID')
> IB_Connection = HolConn
> InsertSQL.Strings = (
> 'EXECUTE PROCEDURE NEW_HOL_SP(:HOLGRPID)')
> KeyLinks.Strings = (
> 'HOLID')
> KeyLinksAutoDefine = False
> PreparedInserts = True
> RecordCountAccurate = True
> OnError = HolQryError
> AfterInsert = HolQryAfterInsert
> BeforePost = HolQryBeforePost
> AfterPost = HolQryAfterPost
> OnNewRecord = HolQryNewRecord
> SQL.Strings = (
> 'select * from HOLIDAYS where HOLGRPID = :HOLGRPID and IN_USE =
> 1')
> FieldOptions = []
> Left = 93
> Top = 272
> end
>
> So I want to call NEW_HOL_SP in the InsertSQL. This Stored Procedure
> NEW_HOL_SP takes one parameter HOLGRPID. I've tried to use
> HolQry->ParamByName("HOLGRPID")->AsInteger = 1;
> in the BeforePost() event. It doesn't seem to work.
>
> Jackie