-1

I am trying to get a CLOB out of an Oracle database and I can't get it to work.

I have tried

TO_CHAR(SUBSTR(FieldName,0,4000))  

and

select dbms_lob.substr(FieldName,4000,1) part1, 
       dbms_lob.substr(FieldName,4001,6000) part2  

then Concatenate with no joy.

I am quite new to this, can anyone assist?

TheGameiswar
  • 27,855
  • 8
  • 56
  • 94
  • check this link:http://stackoverflow.com/questions/3790379/how-to-query-a-clob-column-in-oracle , might help – TheGameiswar Apr 04 '17 at 16:22
  • 4
    Possible duplicate of [How to query a CLOB column in Oracle](http://stackoverflow.com/questions/3790379/how-to-query-a-clob-column-in-oracle) – Dan Bracuk Apr 04 '17 at 16:25
  • 1
    What do you mean by "get a CLOB out of an Oracle database"? Out, where? To a file? to Excel? to what, exactly? –  Apr 04 '17 at 16:33

1 Answers1

0

In your first answer, you tried using to_char(substr()).. I think you don't need the to_char. substr should return a character string.
I recently worked on a project to create an email. Database was Oracle 11g. The email text body was stored in a CLOB. I wrote a (standard) C program to do the job. First, I declared a character array of 30k bytes for the email body. My SQL was straightforward:

EXEC SQL
  Select txt_email_body
    into :mailText
    from email_request
   where  .....

txt_email_body was the CLOB. mailText was the 30k char array in the C program.

Marvin
  • 1