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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:14:59+00:00 2026-06-15T03:14:59+00:00

I have TABLE1 with columns COL1 , COL2 defined as LongVarChar in Oracle. Every

  • 0

I have TABLE1 with columns COL1,COL2 defined as LongVarChar in Oracle.

Every time user loads a record to TABLE1, COL1 will have the old value and COL2 will have the old value + new value. i.e.

For ex:

COL1            COL2
                Bat
Bat             Bat Ball
Bat Ball        Bat Ball Wicket
Bat Ball Wicket Bat Ball Wicket Stump

To get the only new value, i am planning to delete contents of COL2 from COL1 contents..I think this is a pretty bad idea..

I tried the usual “-” operator and it says "Expected Numeric but received CLOB"

But does any one any better idea or how to accomplish this?

Thanks so much

  • 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-15T03:15:00+00:00Added an answer on June 15, 2026 at 3:15 am

    Assuming you mean Varchar2, and (as in your example), each old value is separated by an additional space, then something like this should work:

    SELECT SUBSTR(col2, NVL(LENGTH(col1)+2,0)) "New Value" FROM TABLE1
    

    eg:

    select substr('Bat', nvl(length(null)+2,0)) from dual;
    

    results in ‘Bat’

    select substr('Bat Ball', nvl(length('Bat')+2,0)) from dual;
    

    results in ‘Ball’


    But if you’re actually talking about a CLOB datatype, then substitute:

    dbms_lob.substr( colX, 4000, 1) 
    

    instead of colX (where X is 1 or 2)

    [This will give you the first 4000 bytes of the CLOB – in order to get more, you’d have to use PL/SQL]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query say, select col1,col2 from table1; which return 2 columns of
I have a select statement returning 5 columns: select col1,col2,col3,col4,col5 from table1; col1 col2
So I have two tables. Table1 have two columns, col1 and col2, where col1
I have table called Table1 with columns, col1 and col2 with col1 having weblinks
I have a table with columns say col1, col2, col3 . The table has
I have a table with four Columns: Col1, Col2, Col3, and Col4. Col1, Col2,
I have a table, for example, mytable. It has several columns: col1, col2, col3.
If I have a table1 with columns table1.user and table1.site, how can I return
I have a table like this Table1 Col1 Col2 Col3 Col4 Col5 Col6 Col7
I have three tables table1, table2, table3 with col1, col2 and identity ID column.

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.