ODAC Direct + UseUnicode + ReturnParams problem

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
anyrkov
Posts: 2
Joined: Fri 03 Jul 2009 10:34
Location: Russia, SPB

ODAC Direct + UseUnicode + ReturnParams problem

Post by anyrkov » 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

Code: Select all

qryPrize.Append;
......
qryPrize.Post;
or

Code: Select all

qryPrize.Edit;
......
qryPrize.Post;
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:

Code: Select all

TOraSession.Direct:= True;
TOraSession.UseUnicode:= True;
TOraQuery.Options.ReturnParams:= True;
This exception does not appear in case:

Code: Select all

TOraSession.Direct:= False
or

Code: Select all

TOraSession.UseUnicode:= False
or

Code: Select all

TOraQuery.Options.ReturnParams:= False
.


Any 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;


TOraQuery.SQL is

Code: Select all

begin
  :RESULT := TEST_LCPRIZE.Get_Items;
end;
TOraQuery.SQLInsert is

Code: Select all

begin
  :PRIZE_CODE:= TEST_LCPRIZE.NEW_PRIZE(:CODE_DESC, :PRIZE_COMMENT);
end;
TOraQuery.SQLUpdate is

Code: Select all

begin
  TEST_LCPRIZE.UPD_PRIZE(:PRIZE_CODE, :CODE_DESC, :PRIZE_COMMENT);
end;

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 06 Jul 2009 06:34

Please check if this problem occurs with the latest ODAC build.

anyrkov
Posts: 2
Joined: Fri 03 Jul 2009 10:34
Location: Russia, SPB

Post by anyrkov » Wed 08 Jul 2009 09:08

It's OK with ODAC 6.80.0.48 build
Thank you.

Post Reply