Page 1 of 1

ODAC will automatically create the Params for TOraSQL?

Posted: Fri 30 Sep 2005 00:40
by akiraiu
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??

Posted: Fri 30 Sep 2005 06:43
by Alex
TOraSQL automatically scans SQL and creates parameters when ParamCheck property is set.

Posted: Fri 30 Sep 2005 06:55
by akiraiu
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?

Posted: Fri 30 Sep 2005 09:32
by Alex
Please see "Working with Unicode character data" topic of ODAC help