DATA Step, Macro, Functions and more

Oracle error ORA-22835

Reply
New Contributor
Posts: 3

Oracle error ORA-22835

I am trying to read an Oracle view using Windows Base SAS.  The SAS error log is returning and error message "Error fetching from cursor.  ORACLE error is ora-22835.  Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 4254, maximum: 4000).  SAS read 210000 observations before abnormally terminating.  Does anyone know a solution to this issue?

 

Thanks,  tmg02 

Super Contributor
Posts: 251

Re: Oracle error ORA-22835

Can you show your query? At least the bit where you're referencing a CLOB column (I assume that's the problem).

 

In the meantime, if you don't need to read the whole of the column, a substr may help.

New Contributor
Posts: 3

Re: Oracle error ORA-22835

Hi Laurie,

 

Thanks for offering to help.  I'm not actually referencing the CLOB column.  The code references the Oracle view and I assume that one of the fields in this view is a CLOB or BLOB.  I'm not sure which field is throwing the error, but SAS successfully reads over 200,000 records before throwing the error.  Unfortunately, there is no data dictionary available for the view and IT is not willing to provide one.  Maybe I should start with a proc contents to see what is actually stored on Oracle?

 

-Todd

Super Contributor
Posts: 251

Re: Oracle error ORA-22835

proc contents will certainly help for a start. It might give some clues.
Super User
Posts: 9,681

Re: Oracle error ORA-22835

You can drop that column if it does not mean anything.
OR
you can convert it into CHAR at ORACLE side, and import it into SAS .

create view xx as
select ......,tochar(CLOB) as new


New Contributor
Posts: 3

Re: Oracle error ORA-22835

How do I figure out which field in the view is causing the error? I only have read rights on the Oracle view so I need to have a SAS solution. Thanks for your help. Much appreciated.
Super Contributor
Posts: 251

Re: Oracle error ORA-22835

[ Edited ]

I don't have Oracle access here, but you may be able to investigate the metadata Oracle table all_tab_columns where table_name = your table. That will show the column types.

 

Alternatively, proc contents on the Oracle view or do a subset extract:

proc sql outobs=10000;
create table x 
   from connection to oracle( 
etc etc
);
(or from view of Oracle table, of course) quit;

then do a contents on that.

 

Ask a Question
Discussion stats
  • 6 replies
  • 192 views
  • 0 likes
  • 3 in conversation