Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8828071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:31:26+00:00 2026-06-14T07:31:26+00:00

I am looking to read in the data that is stored as a CLOB

  • 0

I am looking to read in the data that is stored as a CLOB value in my Oracle database. The contents simply are HTML that renders emails that we send through our CRM application. I want to re-create images of the email to include in my reports on crm performance.

I can successfully read the data into SPSS using the following query, which converts the CLOB to a string of length (32750).

GET DATA
  /TYPE=ODBC
  /CONNECT='DSN=<MYDSN>;UID=<USER>;PWD=mypassword;Host=myhost;Port=myport;SID='+
    'SID'
  /SQL='SELECT *  FROM mytable'
  /ASSUMEDSTRWIDTH=32750.
CACHE.
EXECUTE.
DATASET NAME clob_query WINDOW=FRONT.

What I am looking to do is perform a similar query but read the data into R. I attempted the following query and got the error below:

> SQL <-"SELECT to_char(CONTENT) as content from REL_EMAIL_TEMPLATE"
> ds <- sqlQuery(ch, SQL, as.is=T, stringsAsFactors=F)
> ds
[1] "HY000 22835 [Oracle][ODBC][Ora]ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 5923, maximum: 4000)\n"
[2] "[RODBC] ERROR: Could not SQLExecDirect 'SELECT to_char(CONTENT) as content from REL_EMAIL_TEMPLATE'"   

I am not sure how I can make the “buffer” larger, but figure that because I accomplish this in SPSS that R must be able to do this as well.

Many thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:31:27+00:00Added an answer on June 14, 2026 at 7:31 am

    I feel like I must have attempted this solution before posting, but I came back to this problem and was able to get it running.

    The only difference this time around is that I only tried to pull 1 record into R using a WHERE clause.

    Here is my query:

    SQL <- "SELECT TO_CHAR(CONTENT) FROM RELATEMGR.REL_EMAIL_TEMPLATE WHERE primary_key = 1"
    body <- sqlQuery(ch, SQL, stringsAsFactors=F)
    

    Weird. Not sure if a different version of R matters either, but at least this got me to where I needed to be.

    Just for completeness sake:

    > sessionInfo()
    R version 2.15.0 (2012-03-30)
    Platform: i386-pc-mingw32/i386 (32-bit)
    
    locale:
    [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252   
    [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
    [5] LC_TIME=English_United States.1252    
    
    attached base packages:
    [1] stats     graphics  grDevices utils     datasets  methods   base     
    
    other attached packages:
    [1] RODBC_1.3-6
    
    loaded via a namespace (and not attached):
    [1] tools_2.15.0
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im looking to read the contents of a webpage that is secured with a
I'm looking for a data type in SQL Server 2008 Express that can stored
I'm looking for an editor that can read and write remote PHP files via
I am looking into making a c# program that will read in the logcat
I am looking for a library that allows me to read an Excel document
I'm looking for the best way to store XMLs in a Oracle Database. Currently
I'm looking to read from a XML file which is stored within a zip
I am looking for a way to put large arrays of data (stored inside
I am looking for a scheme-less database to store roughly 10[TB] of data on
I'm working with a weird database schema : the data I'm looking for is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.