Page 1 of 1

ODAC Update Query Error (Direct Mode)

Posted: Fri 19 Aug 2011 05:52
by june04
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

i found answer...

Posted: Fri 19 Aug 2011 06:49
by june04
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????

Posted: Fri 19 Aug 2011 08:21
by AlexP
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.

The problem is not resolved

Posted: Tue 23 Aug 2011 01:47
by june04
install ODAC 7.20.0.8

but this problem is not resolved...

give me a different answer, please

Posted: Thu 25 Aug 2011 15:20
by AlexP
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.