ORA-01460: unimplemented or unreasonable conversion requested

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
sinys
Posts: 186
Joined: Tue 21 Feb 2012 03:44

ORA-01460: unimplemented or unreasonable conversion requested

Post by sinys » Thu 05 Sep 2013 16:17

Delphi XE2, ODAC 9.0.2, Oracle 11.2.0.2.0

If input parameter size more 4000 than raised exception ORA-01460: unimplemented or unreasonable conversion requested.

Code: Select all

procedure TForm2.Button1Click(Sender: TObject);
var
  i : Integer;
  s : string;
begin
  OraSQL1.SQL.Text := 'declare x varchar2(32767); begin x := :v; end;';
  OraSQL1.ParamByName('v').DataType := ftString;
  OraSQL1.ParamByName('v').Size := 32767;

  s := '';
  for i := 1 to 4001 do  
    s := s + 'a';

  OraSQL1.ParamByName('v').AsString := s;
  OraSQL1.Execute;
end;

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

Re: ORA-01460: unimplemented or unreasonable conversion requested

Post by AlexP » Mon 09 Sep 2013 09:11

Hello,

To have the possibility to use string parameters greater than 4000, you should set the UseMaxDataSize global variable to False (the variable is declared in the OraClasses module)

MarkF
Posts: 211
Joined: Thu 02 Mar 2006 14:55

Re: ORA-01460: unimplemented or unreasonable conversion requested

Post by MarkF » Mon 09 Sep 2013 10:29

Couldn't he set the datatype of the bind to ftWideMemo (assuming Unicode)? That's how we bind plsqlstrings up to 32k.

-Mark Ford
Benthic Software

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

Re: ORA-01460: unimplemented or unreasonable conversion requested

Post by AlexP » Wed 11 Sep 2013 12:36

Hello,

The varchar parameter length is 4К by default. For work in PL/SQL blocks with parameters greater than 4K, UseMaxDataSize should be set to False, the parameter type doesn't affect its length

Post Reply