2

I need to store a lot of text in a field in an SDE registered business table (an ITable, not a featureclass) - let's say 10,000 words roughly. I am using Oracle 10g and ArcSDE 9.1.

I am programming with ArcObjects 9.2 sp6.

It looks like the only option might be to use a BLOB as a CLOB is not usable with 9.1 (shame).
Can you use a BLOB in this way and how would you do it in ArcObjects code?

2
  • Is that 10,000 words per record? Why not as Raw? do you need it really to be ESRI object? or can you use a reference table that is just native DB.
    – D.E.Wright
    Aug 24, 2011 at 21:03
  • Could you a reference table - but that would be a bit annoying and generate more code. It has to be an ESRI object as I need to return an ObjectID when I insert a record. It would be 10,000 words per record too.
    – Vidar
    Aug 24, 2011 at 21:09

2 Answers 2

2

Yes, you can use either a Blob or LONG_RAW per the docs edndocs to support a huge block of text, you really want to make sure you parse your text well before it goes in so you don't have any compromised information in the string.

You will have to handle the storing yourself; since its looking like that assumes you are inserting something binary.

1
  • Do you know how you go about storing? Is it something to do with IMemoryBlobStream?
    – Vidar
    Aug 24, 2011 at 21:28
2

I think I have some kind of solution - but not sure if it's that elegant, but nothing else jumps out.

Does this look right to you?, your feedback is welcome.

StrArray strArray = new StrArrayClass();
strArray.Add("This is a load of mumbo jumbo that goes on for ages...");
IPersistStream persistStream = (IPersistStream)strArray;
IMemoryBlobStream2 memoryBlobStream = new MemoryBlobStreamClass();
persistStream.Save(memoryBlobStream, 0);
rowBuffer.set_Value(fooIndex, (System.Object)memoryBlobStream);
3
  • It is more common practice to store propertysets in blobs, but then again I've never used it with such large objects. If you port this to 10, I've seen a bug with deserializing. You also might need to deal with flushing if you're using an insert cursor. I think it flushes every 500 inserts by default. Aug 24, 2011 at 22:33
  • Cheers for that Kirk - I'll bear that one in mind.
    – Vidar
    Aug 25, 2011 at 9:12
  • Actually, this is the way to do it. @Kirk: are you worried he will run out of memory before the cursor flushes (a valid concern). You can force the flushing using the Flush method on the cursor Object. Don't do it too often, since you loose optimizations that you get by bunching your inserts and updates together. Oct 19, 2011 at 18:39

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.