Subject Re: [IBO] Null in Stored Procedure parameter.
Author Lucas Franzen
dale tabbert schrieb:
>
> Hello,
>
> I have a stored procedure that enters a value into a table which
> takes three input params: key_id, key_name and key_value. In my
> client, I may know either the key_id or the key_name. If key_id =
> null, then in my SP I use the value of key_name to determine which
> key gets key_value. If key_id is not null, I use key_id to determine
> who gets key_value.
>
> I just started using IBObjects and with a TIB_DSQL it appears that I
> cannot have nulls as params. I was able to do this with IBExpress.
> Any help is greatly appreciated.

Use a TIB_StoredProc component to access your stored procedure, not a
TIB_DSQL and assign the correct stored procedure in the object
inmspector.

When calling the procedure this should work:

procedure DoExceSP;
begin
with mySP do
begin
Prepare;
if noID
then ParamByName ( 'ID' ).Clear
else ParamByName ( 'ID' ).AsInteger := myID;
ParamByName('VAL').AsString := mykeyValue;
ExecProc;
Unprepare;
end;
end;

hth

luc.