Page 1 of 1

ORA-01460: unimplemented or unreasonable conversion requested

Posted: Thu 05 Sep 2013 16:17
by sinys
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;

Re: ORA-01460: unimplemented or unreasonable conversion requested

Posted: Mon 09 Sep 2013 09:11
by AlexP
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)

Re: ORA-01460: unimplemented or unreasonable conversion requested

Posted: Mon 09 Sep 2013 10:29
by MarkF
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

Re: ORA-01460: unimplemented or unreasonable conversion requested

Posted: Wed 11 Sep 2013 12:36
by AlexP
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