Subject | How to pass parameter for the SP in the InsertSQL statement of TIBOQuery |
---|---|
Author | jliu1530 |
Post date | 2004-10-28T22:46:58Z |
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.
Can anybody help me?
Thanks in advance.
Jackie
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.
Can anybody help me?
Thanks in advance.
Jackie