0

i have an old oracle database in which there is a field of type LONG(max size is 2GB)

Now earlier it used to work fine but with time data we started putting was of size much more than 2GB so we started facing trouble.

I can not change the field type from LONG to CLOB since that will create a lot of trouble as innumerable changes will have to be made to the product to deal with the CLOB type.

Dividing data into chunks and then putting is an option but how do we do that??

Can someone suggest a way to handle this . Preferably code or a link to the code.

2
  • 1
    Which version of Oracle are you using? Commented Aug 3, 2010 at 10:37
  • i am using 10g................. Commented Aug 4, 2010 at 6:23

1 Answer 1

2

The problem is, at no point can you pass more than 2GB to a LONG variable. So your application has two choices:

  • split the big data into chunks before touching the database
  • sending the database a CLOB and letting the database handle it (say with a view and an INSTEAD OF trigger)

Which approach will work best for you depends on the details of your application. Give us more info and we can give you specific advice.

Actually there is a third option. The LONG and LONG RAW data types have been deprecated for well over a decade. Perhaps it is time to move on ...

Sign up to request clarification or add additional context in comments.

1 Comment

@Egalitarian - All that tells me is you should have bitten the bullet and moved to CLOBs a long time ago. It's a detail, not "the details of your application". What does your application do with these large amounts of data? How does it interact with the database? What language is it written in?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.