ODAC will automatically create the Params for TOraSQL?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
akiraiu
Posts: 22
Joined: Tue 16 Nov 2004 02:31

ODAC will automatically create the Params for TOraSQL?

Post by akiraiu » Fri 30 Sep 2005 00:40

Here part of Code:

Code: Select all

var OraSQL : TOraSQL;
.........
OraSQL.SQL.Add ('insert into test (a, b, c) values (:a, :b, :c)');
OraSQL.ParamByName ('a').AsString := '111';
OraSQL.ParamByName ('b').AsInteger := 222;
OraSQL.ParamByName ('c').AsString := '333';
OraSQL.Execute;
.......
Here I have test table:

Code: Select all

create table test (
  a Varchar2 (10),
  b Number (10),
  c Varchar2 (10)
);
ODAC TOraSQL will help me to create the parameters??

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Fri 30 Sep 2005 06:43

TOraSQL automatically scans SQL and creates parameters when ParamCheck property is set.

akiraiu
Posts: 22
Joined: Tue 16 Nov 2004 02:31

Post by akiraiu » Fri 30 Sep 2005 06:55

OK. For Above example, I want to Insert the unicode for the column a and c:

Code: Select all

var OraSQL : TOraSQL; 
......... 
OraSQL.SQL.Add ('insert into test (a, b, c) values (:a, :b, :c)'); 
OraSQL.ParamByName ('a').AsWideString := '111'; 
OraSQL.ParamByName ('b').AsInteger := 222; 
OraSQL.ParamByName ('c').AsWideString := '333'; 
OraSQL.Execute; 
then ODAC create the parameters type is ftString or ftWideString?

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Fri 30 Sep 2005 09:32

Please see "Working with Unicode character data" topic of ODAC help

Post Reply