How to make a query in run time?
From: Zé Paulo (jmartins_at_telbit.pt)
Date: 02/25/05
- Next message: Sunil Furtado: "Re: How to make a query in run time?"
- Previous message: Bas van Beek: "Re: Not enough Parameters?"
- Next in thread: Sunil Furtado: "Re: How to make a query in run time?"
- Reply: Sunil Furtado: "Re: How to make a query in run time?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 Feb 2005 01:44:14 -0800
Hello
I want to Do updates in Oracle DB Using Delphi at run Time!
How can I Put de names of the tables and of the fields in the SQL commad?
My problem are With "table_name","column_name" and "parameter"!
I have this procedure:
procedure UpdateDB(query: TQuery; table_name, column_name, parameter, param_value, value: String);
Begin
With query do begin
with SQL do begin
query.Close;
SQL.Clear;
Add('UPDATE "table_name" SET "column_name"=:value WHERE "parameter"=:param_value');
query.ParamByName('value').AsString := value;
query.ParamByName('param_value').AsString := param_value;
query.Prepare;
query.ExecSQL;
End;
End;
End.
Errors:
Table does not exist or Invalid field Name
Thanks
- Next message: Sunil Furtado: "Re: How to make a query in run time?"
- Previous message: Bas van Beek: "Re: Not enough Parameters?"
- Next in thread: Sunil Furtado: "Re: How to make a query in run time?"
- Reply: Sunil Furtado: "Re: How to make a query in run time?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|