ODAC Direct + UseUnicode + ReturnParams problem
Posted: Fri 03 Jul 2009 10:44
Hello,
I use Delphi 2007 with ODAC 6.20.0.11, Oracle Database 10g Release 10.2.0.3.0.
In database I have table TEST_PRIZE and stored procedures GET_ITEMS, NEW_PRIZE, UPDATE_PRIZE to manipulate with it.
In client application I use data grid and TOraQuery component which SQL, SQLInsert and SQLUpdate properties are set to call these stored procedures.
After executing code like
or
I have an exception with message like
"ORA-01461: can bind a LONG value only for insert into a LONG column"
This exception appears in case:
This exception does not appear in case:
or
or
.
Any workarounds for situation like this?
-----------------------------------------------------------
More details posted here:
TOraQuery.SQL is
TOraQuery.SQLInsert is
TOraQuery.SQLUpdate is
I use Delphi 2007 with ODAC 6.20.0.11, Oracle Database 10g Release 10.2.0.3.0.
In database I have table TEST_PRIZE and stored procedures GET_ITEMS, NEW_PRIZE, UPDATE_PRIZE to manipulate with it.
In client application I use data grid and TOraQuery component which SQL, SQLInsert and SQLUpdate properties are set to call these stored procedures.
After executing code like
Code: Select all
qryPrize.Append;
......
qryPrize.Post;Code: Select all
qryPrize.Edit;
......
qryPrize.Post;
"ORA-01461: can bind a LONG value only for insert into a LONG column"
This exception appears in case:
Code: Select all
TOraSession.Direct:= True;
TOraSession.UseUnicode:= True;
TOraQuery.Options.ReturnParams:= True;
Code: Select all
TOraSession.Direct:= FalseCode: Select all
TOraSession.UseUnicode:= FalseCode: Select all
TOraQuery.Options.ReturnParams:= FalseAny workarounds for situation like this?
-----------------------------------------------------------
More details posted here:
Code: Select all
create table TEST_PRIZE
(
PRIZE_CODE INTEGER,
CODE_DESC VARCHAR2(50 CHAR),
PRIZE_COMMENT VARCHAR2(50 CHAR),
PRIZE_DATE DATE
)
FUNCTION get_items RETURN sys_refcursor
IS
c_Ref sys_refcursor;
BEGIN
OPEN c_Ref FOR
SELECT prize_code, code_desc, prize_comment, prize_date
FROM test_prize
ORDER BY code_desc;
RETURN c_Ref;
END get_items;
FUNCTION new_prize (
p_PrizeName IN VARCHAR2,
p_Prizecomment IN VARCHAR2
) RETURN INTEGER IS
v_Code INTEGER;
BEGIN
select SEQ_test_prize.nextval into v_code from dual;
INSERT INTO test_prize(
prize_code, code_desc, prize_comment, prize_date )
VALUES (
v_code, p_PrizeName, p_Prizecomment, SYSDATE );
COMMIT;
RETURN v_Code;
END new_prize;
PROCEDURE upd_prize (
p_PrizeCode IN INTEGER,
p_PrizeName IN VARCHAR2,
p_PrizeComment IN VARCHAR2
) IS
BEGIN
update test_prize set code_desc = p_PrizeName,
prize_comment = p_PrizeComment
where prize_code = p_PrizeCode;
COMMIT;
END upd_prize;
Code: Select all
begin
:RESULT := TEST_LCPRIZE.Get_Items;
end;
Code: Select all
begin
:PRIZE_CODE:= TEST_LCPRIZE.NEW_PRIZE(:CODE_DESC, :PRIZE_COMMENT);
end;
Code: Select all
begin
TEST_LCPRIZE.UPD_PRIZE(:PRIZE_CODE, :CODE_DESC, :PRIZE_COMMENT);
end;