How to get clob from oracle 11g RRS feed

  • Question

  • I wrote a program to get clob in my oracle, here is how i have done,

    public static void readLob(string file, OracleLob lob, int bufferSize) //bufferSize=8*1024
    using (FileStream fs = new FileStream(file, FileMode.Create, FileAccess.Write))
    int readCount = 0;
    byte[] buffer = new byte[bufferSize];
    readCount = lob.Read(buffer, 0, bufferSize); //lob.Length = 10* 4096, why?
    fs.Write(buffer, 0, bufferSize);
    while (readCount > 0);

    The result was odd. I had "Hello world!" in the server, and after i got the string from CLOB and wrote them in to a file on my winXP OS, i found the file was much bigger than what i expected, and many spaces were appened in the file and the string "hello world!" was read more than once.

    any ideas, Thank you.

    by the way, my encoding parameters are as follows:


    Wednesday, March 3, 2010 10:21 AM