Subject | Re: [IBO] help with stored procedures |
---|---|
Author | Dmitry Beloshistov |
Post date | 2004-02-24T08:33:33Z |
Hello, Daniel!
You can use:
1) Insert into sql text parameters values directly (without Prepare) as:
IB_Query1.SQL.Text:='delete from mytable whete ID='+IntToStr(PK_ID_Value);
IB_Query1.Execute;
(for litle sql queryes why not?-)
2) Use Prepare and ParamByName() and/or ParamValues[] for set parameters values as:
with IB_Query1 do
begin
Close; sql.clear;
sql.text:='insert into mytable(Field1,Field2) values(:FieldVal1,:FieldVal2)';
prepare;
ParamValues['FieldVal1']:='MyValue for Field1';
ParamByName('FieldVal2').LoadFromFile('D:\MyBlodField2Data.txt');
Execute;
Close;
end;
3) Also you can define parameters in TIB_Query.Params property. Query must be prepared too (see IBO help).
P.S. AFAIK second way is produced most readable sources.
WBR, Dmitry Beloshistov AKA [-=BDS=-]
You can use:
1) Insert into sql text parameters values directly (without Prepare) as:
IB_Query1.SQL.Text:='delete from mytable whete ID='+IntToStr(PK_ID_Value);
IB_Query1.Execute;
(for litle sql queryes why not?-)
2) Use Prepare and ParamByName() and/or ParamValues[] for set parameters values as:
with IB_Query1 do
begin
Close; sql.clear;
sql.text:='insert into mytable(Field1,Field2) values(:FieldVal1,:FieldVal2)';
prepare;
ParamValues['FieldVal1']:='MyValue for Field1';
ParamByName('FieldVal2').LoadFromFile('D:\MyBlodField2Data.txt');
Execute;
Close;
end;
3) Also you can define parameters in TIB_Query.Params property. Query must be prepared too (see IBO help).
P.S. AFAIK second way is produced most readable sources.
WBR, Dmitry Beloshistov AKA [-=BDS=-]
----- Original Message -----
From: Daniel Bertin
To: IBObjects@yahoogroups.com
Sent: Monday, February 23, 2004 7:20 PM
Subject: Re: [IBO] help with stored procedures
Thanks,
Prepare was probably the problem, but I can only try tonight.
A question; does the parameter need to be defined in the query's params
property or does prepare and parambyname take care of this?
Daniel
>>> torin@... 02/23/04 11:47 AM >>>
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
------------------------------------------------------------------------------
Yahoo! Groups Links
a.. To visit your group on the web, go to:
http://groups.yahoo.com/group/IBObjects/
b.. To unsubscribe from this group, send an email to:
IBObjects-unsubscribe@yahoogroups.com
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]