About using Parambyname in Toraquery.....
About using Parambyname in Toraquery.....
Hello,
I am considering upgrade Delphi( from Delphi6.0 to Delphi2009)
so I am testing ODAC 6.80.0.48 Trial version
I got some problem with Using Toraquery's Parambyname in direct mode
For example
select statments like this
select * from tab_aaa where field1 =:field1;
delphi6.0 using
parambyname('field1').asstring := 'aaa';
it's correct result ( seleted 2 rows)
but delphi2009 + ODAC 6.80.0.48 Trial version returns nothing( selected 0 row)
I got to know something
follows retruns correct result
delphi2009 + ODAC 6.80.0.48 Trial version using
parambyname('field1').datatype := ftFixedChar;
parambyname('field1').size := 32;
parambyname('field1').asstring := 'aaa'
or
parambyname('field1').asansistring := 'aaa'
why datatype,size options described by user only upgrade ODAC?
Is it Trial Version's limits?
I think it's not a good thing
I can't change huge sourcecode
helps, What can I do same result ?
I am considering upgrade Delphi( from Delphi6.0 to Delphi2009)
so I am testing ODAC 6.80.0.48 Trial version
I got some problem with Using Toraquery's Parambyname in direct mode
For example
select statments like this
select * from tab_aaa where field1 =:field1;
delphi6.0 using
parambyname('field1').asstring := 'aaa';
it's correct result ( seleted 2 rows)
but delphi2009 + ODAC 6.80.0.48 Trial version returns nothing( selected 0 row)
I got to know something
follows retruns correct result
delphi2009 + ODAC 6.80.0.48 Trial version using
parambyname('field1').datatype := ftFixedChar;
parambyname('field1').size := 32;
parambyname('field1').asstring := 'aaa'
or
parambyname('field1').asansistring := 'aaa'
why datatype,size options described by user only upgrade ODAC?
Is it Trial Version's limits?
I think it's not a good thing
I can't change huge sourcecode
helps, What can I do same result ?
Thanks for reply
Well, there is no changing developer environment except upgrade ODAC
requested information like this
- character set of your database;
=> NLS_RDBMS_VERSION 8.1.7.4.0
NLS_LANGUAGE AMERICAN
NLS_CHARACTERSET KO16KSC5601
NLS_NCHAR_CHARACTERSET KO16KSC5601
- data type of the column in the database
=> data type is varchar2 (differ size from each column)
- your Windows regional settings
=> south Korea
and additional question
when update statement excute using TOraQuery
following error occur
ora-22295:cannot bind more than 4000 bytes data to LOB and LONG columns in 1 statement
but update columns data type is varchar2
also this problem occurs only parambyname's Datatype,Size not assigned
Is this problem Character set relate ?
Is there no way to solve the problem from TOraSession or TOraQuery's options ?
Please Help..
Well, there is no changing developer environment except upgrade ODAC
requested information like this
- character set of your database;
=> NLS_RDBMS_VERSION 8.1.7.4.0
NLS_LANGUAGE AMERICAN
NLS_CHARACTERSET KO16KSC5601
NLS_NCHAR_CHARACTERSET KO16KSC5601
- data type of the column in the database
=> data type is varchar2 (differ size from each column)
- your Windows regional settings
=> south Korea
and additional question
when update statement excute using TOraQuery
following error occur
ora-22295:cannot bind more than 4000 bytes data to LOB and LONG columns in 1 statement
but update columns data type is varchar2
also this problem occurs only parambyname's Datatype,Size not assigned
Is this problem Character set relate ?
Is there no way to solve the problem from TOraSession or TOraQuery's options ?
Please Help..
Is there no way to solve the problem With Torasession or ToraQeury's options Without provide sample code including database object script?
example Torasession's UseUnicode option is True
if this Option changs True select statements retruns correct result
However ..
I wondering
Why parambyname's datatype and size options decribe by user?
example Torasession's UseUnicode option is True
if this Option changs True select statements retruns correct result
However ..
I wondering
Why parambyname's datatype and size options decribe by user?
In our test the AsString property works without problems. So you don't need to set the Size and DataType properties.
The sample will help us to find the problem. You don't need to use your actual database objects in the sample. You can create a small test table with two fields and use it in the sample.
The sample will help us to find the problem. You don't need to use your actual database objects in the sample. You can create a small test table with two fields and use it in the sample.
Thanks for reply.
sample code like this...
oracle version is 8.1.7.4.0
characterset KO16KSC5601
odac in direct mode. (ODAC 6.80.0.48 Trial version, Delphi2009 )
create table temp
(
userid varchar2(10),
sdate date,
edate date,
rmk varchar2(100)
)
[select query]
with toraquery1 do
begin
close;
SQL.Clear;
SQL.Add('select rmk from temp where userid =:userid');
ParamByName('userid').Asstring := '111';
open; ==> no date found
end;
if changed to
with toraquery1 do
begin
close;
SQL.Clear;
SQL.Add('select rmk from temp where userid =:userid');
----------------------------------------------------------
ParamByName('userid').AsAnsistring := '111';
----------------------------------------------------------
open; ==> 1 row found
end;
others
--------------------------------------------------
OraSession1.Options.UseUnicode := True;
--------------------------------------------------
with toraquery1 do
begin
close;
SQL.Clear;
SQL.Add('select rmk from temp where userid =:userid');
ParamByName('userid').Asstring := '111';
open; ==> 1 row found
end;
[update query]
with toraquery1 do
begin
close;
SQL.Clear;
SQL.Add('update temp set edate = to_date(:edate,''yyyy-mm-dd'') -1, rmk=:rmk');
SQL.Add(' where userid =:userid');
ParamByName('edate').Asstring := '2009-09-09';
ParamByName('rmk').AsString := 'remark';
ParamByName('userid').Asstring := '111';
Execsql; ==> ora-22295 error occur
end;
if changed to
with toraquery1 do
begin
close;
SQL.Clear;
SQL.Add('update temp set edate = to_date(:edate,''yyyy-mm-dd'') -1, rmk=:rmk');
SQL.Add(' where userid =:userid');
--------------------------------------------------
ParamByName('edate').datatype := ftfixedchar;
ParamByName('rmk').datatype := ftfixedchar;
ParamByName('userid').datatype := ftfixedchar;
ParamByName('edate').size := 32;
ParamByName('rmk').size := 32;
ParamByName('userid').size := 32;
--------------------------------------------------
ParamByName('edate').Asstring := '2009-09-09';
ParamByName('rmk').AsString := 'remark';
ParamByName('userid').Asstring := '111';
Execsql; ==> It works fine
end;
sample code like this...
oracle version is 8.1.7.4.0
characterset KO16KSC5601
odac in direct mode. (ODAC 6.80.0.48 Trial version, Delphi2009 )
create table temp
(
userid varchar2(10),
sdate date,
edate date,
rmk varchar2(100)
)
[select query]
with toraquery1 do
begin
close;
SQL.Clear;
SQL.Add('select rmk from temp where userid =:userid');
ParamByName('userid').Asstring := '111';
open; ==> no date found
end;
if changed to
with toraquery1 do
begin
close;
SQL.Clear;
SQL.Add('select rmk from temp where userid =:userid');
----------------------------------------------------------
ParamByName('userid').AsAnsistring := '111';
----------------------------------------------------------
open; ==> 1 row found
end;
others
--------------------------------------------------
OraSession1.Options.UseUnicode := True;
--------------------------------------------------
with toraquery1 do
begin
close;
SQL.Clear;
SQL.Add('select rmk from temp where userid =:userid');
ParamByName('userid').Asstring := '111';
open; ==> 1 row found
end;
[update query]
with toraquery1 do
begin
close;
SQL.Clear;
SQL.Add('update temp set edate = to_date(:edate,''yyyy-mm-dd'') -1, rmk=:rmk');
SQL.Add(' where userid =:userid');
ParamByName('edate').Asstring := '2009-09-09';
ParamByName('rmk').AsString := 'remark';
ParamByName('userid').Asstring := '111';
Execsql; ==> ora-22295 error occur
end;
if changed to
with toraquery1 do
begin
close;
SQL.Clear;
SQL.Add('update temp set edate = to_date(:edate,''yyyy-mm-dd'') -1, rmk=:rmk');
SQL.Add(' where userid =:userid');
--------------------------------------------------
ParamByName('edate').datatype := ftfixedchar;
ParamByName('rmk').datatype := ftfixedchar;
ParamByName('userid').datatype := ftfixedchar;
ParamByName('edate').size := 32;
ParamByName('rmk').size := 32;
ParamByName('userid').size := 32;
--------------------------------------------------
ParamByName('edate').Asstring := '2009-09-09';
ParamByName('rmk').AsString := 'remark';
ParamByName('userid').Asstring := '111';
Execsql; ==> It works fine
end;