ODAC Update Query Error (Direct Mode)

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
june04
Posts: 3
Joined: Fri 19 Aug 2011 05:44

ODAC Update Query Error (Direct Mode)

Post by june04 » Fri 19 Aug 2011 05:52

Hi,

I have problem using TOraQuery when executing query, my code is:

Code: Select all

 
  OraSession1.Options.Net := True;
  OraSession1.ConnectString := 'scott/[email protected]:1521:ora7';
  OraSession1.Connect;
  OraSession1.StartTransaction;

  OraQuery1.SQL.Clear;
  OraQuery1.SQL.Add
    ('UPDATE EMP SET JOB = :PARAM1 , ENAME = :PARAM2 WHERE  EMPNO = ''7369'' ');
  OraQuery1.ParamByName('PARAM1').AsString := 'TESTXE';
  OraQuery1.ParamByName('PARAM2').AsString := 'TEST2';

  try
    OraQuery1.ExecSQL;    ==>> Error!!!!!
  except
    on E: Exception do
    begin
      OraSession1.Rollback;
      exit;
    end;
  end;
  OraSession1.Commit;
When I execute query I have obteined the next error:

project raised exception raised class EInternal Error with message ". Process Stoped.

And I press 'continue' button ... Next error is :

Project Project1.exe raised exception class EOraError with message 'ORA-22295: cannot bind more than 4000 bytes data to LOB and LONG columns in 1 statement'.

What's the correct form for use Update in TOraQuery?

# That Field 'JOB' and 'ENAME' is varchar2
# ODAC version : 7.20.0.6 for RAD Studio XE
# ORACLE version : 9.2.0.8.0

june04
Posts: 3
Joined: Fri 19 Aug 2011 05:44

i found answer...

Post by june04 » Fri 19 Aug 2011 06:49

define Param like this ... :
OraQuery1.ParamByName('PARAM1').DataType := ftfixedchar;
OraQuery1.ParamByName('PARAM2').DataType := ftFixedChar;
OraQuery1.ParamByName('PARAM1').Size := 32;
OraQuery1.ParamByName('PARAM2').Size := 32;





But...I want simple code

How can i write different simple code????

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Fri 19 Aug 2011 08:21

Hello,

I cannot reproduce the problem.
Your code works without errors even if the parameter type and size is not explicitly defined. Please download the latest version of ODAC 7.20.0.8 and try again. If the problem persists, contact us again.

june04
Posts: 3
Joined: Fri 19 Aug 2011 05:44

The problem is not resolved

Post by june04 » Tue 23 Aug 2011 01:47

install ODAC 7.20.0.8

but this problem is not resolved...

give me a different answer, please

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 25 Aug 2011 15:20

Hello,

As I wrote earlier, we cannot reproduce the problem. The code works correctly even without explicitly specifying parameters. Please send a complete sample, reproducing the problem to alexp*devart*com, and we will try reproducing the problem again.

Post Reply