Parametrized queries on insert

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
polsol
Posts: 71
Joined: Sun 20 May 2007 13:29
Contact:

Parametrized queries on insert

Post by polsol » Thu 25 Mar 2010 07:48

How does one add a parametrized query on inserting records using your Query component?
I need to add data taken from a combobox (DateTime) and place it in a FB field (DateTime also).

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 25 Mar 2010 10:32

The example of a code for inserting record in a table:

Code: Select all

IBCQuery.SQL.Text := 'INSERT INTO table_name(field1) VALUES(:field1)';
IBCQuery.ParamByName('field1').AsDataTime := Now;
IBCQuery.Execute;

Post Reply