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 7051857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:18:49+00:00 2026-05-28T03:18:49+00:00

I have the data like (7A+5dfAA7D…) alphabet and numbers. Its length is greater than

  • 0

I have the data like (7A+5dfAA7D…) alphabet and numbers. Its length is greater than two lack characters. So I can’t update that clob column using update because it throws an error saying the string literal too long.

How to update the values?

please help me.

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-05-28T03:18:50+00:00Added an answer on May 28, 2026 at 3:18 am

    Here is part of some java code that inserts data from a file into a CLOB column. The trick is to first insert an empty_clob() value and then to update the record.

    try {
                /* Register the Oracle driver */
                DriverManager.registerDriver(new OracleDriver());
    
                /* Establish a connection to the Oracle database. I have used the Oracle Thin driver.
                  jdbc:oracle:thin@host:port:sid, "user name", "password" */
    
                conn = DriverManager.getConnection(connectString, userName, passWord);
    
                /* Set auto commit to false, it helps to speed up things, by default JDBC's auto commit feature is on.
                   This means that each SQL statement is commited as it is executed. */
    
                conn.setAutoCommit(false);
                stmt = conn.createStatement();
    
                /* Insert all the data, for the BLOB column we use the function empty_blob(), which creates a locator for the BLOB datatype.
                   A locator is an object that ponts to the actual location of the BLOB data in the database. A locator is essential to manipulate BLOB data. */
    
                query = "INSERT INTO CLOB_TABLE (id,data_clob,bestandsnaam,dt_geplaatst) " +
                        "VALUES(" + ID + ", empty_clob(),\'" + fileName + "\',sysdate)";
    
                //System.out.println(query);
    
                stmt.execute(query);
    
                /* Once the locator has been inserted, we retrieve the locator by executing a SELECT statement 
                   with the FOR UPDATE clause to manually lock the row. */
    
                query = "SELECT DATA_CLOB FROM CLOB_TABLE WHERE ID=\'" + ID + "\' FOR UPDATE";
    
                //System.out.println(query);
                rs = stmt.executeQuery(query);
                //System.out.println("Select statement uitgevoerd");
    
                if (rs.next()) {
    
                    /* Once a locator has been retrieved we can use it to insert the binary data into the database. */
                    CLOB clob = (CLOB)((OracleResultSet)rs).getClob(1);
                    os = clob.getAsciiOutputStream();
                    final File f = new File(fileName);
                    is = new FileInputStream(f);
                    final byte[] buffer = new byte[clob.getBufferSize()];
                    int bytesRead = 0;
                    while ((bytesRead = is.read(buffer)) != -1) {
                        os.write(buffer, 0, bytesRead);
                    }
                    clob = null;
                    returnValue = 0;
                }
    
    
            } catch
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table like this: Application,Program,UsedObject It can have data like this: A,P1,ZZ
Given I have data like the following, how can I select and group by
I have data like date, name, counts How can I get the date interval
I have data like the following: var data = [{ id: 1, date: new
I have data like below AAAAAA BBBBBB CCCCCC DDDDDD EEEEEE Now there is a
I have data like: <td>USERID</td> <td>NAME</td> <td>RATING</td> I want to transform it into: <userid></userid>
I have data like this: Team | goal a | 5 b | 8
Say I have data like this: <option value=abc >Test - 123</option> <option value=def >Test
I have MYSQL data like this id | number 1 | 3 4 |
I have some data like this : 1 TC1 PASS 2 TC2 FAIL 3

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.