Subject Re: [IBO] Parameters for TIBOQuery with stored procedure
Author Helen Borrie
At 07:39 AM 30/06/2004 +0000, you wrote:
>Could someone point me in the right direction please?
>
>I have set the design time properties for a TIBOQuery to return
>records from a stored procedure (FOR SELECT ... DO ... SUSPEND), but
>I get ISC error "parameter mismatch for stored procedure <name>" when
>setting the query active.
>
>So I tried with example procedure MAIL_LABEL in employee.fdb (which
>takes one input parameter) but get the same error. I also tried with
>TIB_Query, but this would not prepare at design time, so I could not
>set the Params.
>
>What am I doing wrong please?
>D7, IBO 4.2.Ie
>
> object IB_Connection1: TIB_Connection
> PasswordStorage = psNotSecure
> SQLDialect = 3
> Params.Strings = (
> 'SERVER=abs-s01'
> 'PATH=C:\Program Files\Firebird\Firebird_1_5
>\examples\employee.fdb'
> 'USER NAME=sysdba'
> 'PROTOCOL=TCP/IP')
> SavedPassword = '.JuMbLe.01.432B0639073E0E4B49'
> end
>
> object IBOQuery1: TIBOQuery
> Params = <
> item
> DataType = ftInteger
> Name = 'cust_no'
> ParamType = ptInput
> Value = 1001
> end>
> DatabaseName =
> 'abs-s01:C:\Program Files\Firebird\Firebird_1_5
>\examples\employee.fdb'
> IB_Connection = IB_Connection1
> RecordCountAccurate = True
> SQL.Strings = ('select * from mail_label')
> FieldOptions = []
> end
>

Missing input parameter(s)?
e.g. select * from mail_label(1001)

Not that you'd use it this way (hard-coding the value of the input param).

You'd do
select * from mail_label(:cust_no)

Then, in BeforeOpen:

with IBOQuery1 do
begin
if not Prepared then Prepare;
Params[0].AsInteger := 1001;
end;

Helen