Subject | Re: [IBO] How to pass parameter for the SP in the InsertSQL statement of TIBOQuery |
---|---|
Author | jliu1530 |
Post date | 2004-10-29T01:36:52Z |
--- In IBObjects@yahoogroups.com, "Jason Wharton" <jwharton@i...>
wrote:
The parameter for the SP is HOLGRPID, it is the same name in the
table. Is that what you mean "match up"? What is the method to pass a
value for HOLGRPID to this SP? I know after I call
Dataset->Insert()
the InsertSQL statement will be executed and therefore the SP
NEW_HOL_SP will be executed. I need to pass the parameter before
NEW_HOL_SP is executed.
Jackie
wrote:
> The parameter values are obtained from the fields that havecorresponding
> names.kind of
> If it isn't matching up with a field name then I don't support that
> usage.Thanks,Jason,
The parameter for the SP is HOLGRPID, it is the same name in the
table. Is that what you mean "match up"? What is the method to pass a
value for HOLGRPID to this SP? I know after I call
Dataset->Insert()
the InsertSQL statement will be executed and therefore the SP
NEW_HOL_SP will be executed. I need to pass the parameter before
NEW_HOL_SP is executed.
Jackie
> > -----Original Message-----calling
> > From: jliu1530 [mailto:jliu1530@y...]
> > 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
> > in the InsertSQL statement a TIBOQuery.bsAfterInsert]
> >
> > Here is my TIBOQuery object,
> >
> > object HolQry: TIBOQuery
> > Params = <
> > item
> > DataType = ftUnknown
> > Name = 'HOLGRPID'
> > ParamType = ptInput
> > end>
> > AutoCalcFields = False
> > AutoFetchAll = True
> > BufferSynchroFlags = [bsBeforeEdit, bsAfterEdit,
> > DatabaseName = 'NDSERVER_1'IN_USE =
> > 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
> > 1')Procedure
> > FieldOptions = []
> > Left = 93
> > Top = 272
> > end
> >
> > So I want to call NEW_HOL_SP in the InsertSQL. This Stored
> > 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