C# - How to get oracle long raw type value

ghz 1years ago ⋅ 871 views

Question

How to get long raw type value with C#?


Answer

Since you haven't posted any code, I don't know how much you know. I'm going to assume you already understand how to execute a query and get back a result set using OracleDataReader.

There is one gotcha with LONG and LONG RAW columns. You must set theInitialLONGFetchSize property of your OracleCommand to a non-zero value.

The default value of InitialLONGFetchSize is zero, which means no data will be retrieved for LONG or LONG RAW columns. If you set it to -1, all data will be retrieved . You might not want to do this for large values. If you set it to anything above zero, that's how many bytes will be intially fetched and cached.

You should read the documentation for InitialLONGFetchSize, because there are some other details you need to know.