database procedure parameter truncated to one character
Posted: Wed 23 Jun 2010 04:49
I am having a problem where string parameters that I pass to an Oracle database procedure (via an ODAC TOraStoredProc) are being
truncated to 1 character.
This problem only occurs when I use direct connect (OraSession.Options.Direct := TRUE)
Is there a workaround to this ?
I have reproduced this with a very simple test case, so I dont think this is a logic error in my app
Environment
Delphi 2009
Oracle 10gr2 XE database on my local PC
example code
====================
pass in value of "abcdef" to the parameter via the proc
the log table shows a value a "a" instead of "abcdef"
Delphi
~~~~~~~~~~~~~~~~~
OraStoredProc1.ParamByName('p_test_param').AsString := 'abcdef';
OraStoredProc1.ExecSQL;
Oracle Log Table
~~~~~~~~~~~~~~~~~
create table TESTX_LOG (
log_message varchar2(100)
);
Oracle Stored Procedure
~~~~~~~~~~~~~~~~~
create or replace procedure TESTX (p_test_param in varchar2) is
begin
insert into testx_log values ('p_test_param='|| p_test_param);
commit;
end;
thanks
Scott
truncated to 1 character.
This problem only occurs when I use direct connect (OraSession.Options.Direct := TRUE)
Is there a workaround to this ?
I have reproduced this with a very simple test case, so I dont think this is a logic error in my app
Environment
Delphi 2009
Oracle 10gr2 XE database on my local PC
example code
====================
pass in value of "abcdef" to the parameter via the proc
the log table shows a value a "a" instead of "abcdef"
Delphi
~~~~~~~~~~~~~~~~~
OraStoredProc1.ParamByName('p_test_param').AsString := 'abcdef';
OraStoredProc1.ExecSQL;
Oracle Log Table
~~~~~~~~~~~~~~~~~
create table TESTX_LOG (
log_message varchar2(100)
);
Oracle Stored Procedure
~~~~~~~~~~~~~~~~~
create or replace procedure TESTX (p_test_param in varchar2) is
begin
insert into testx_log values ('p_test_param='|| p_test_param);
commit;
end;
thanks
Scott