Click here to Skip to main content
15,885,278 members
Articles / Programming Languages / C# 4.0
Tip/Trick

Read clob from Oracle

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
5 Jan 2011CPOL 31K   2   3
Read clob from Oracle
What comes to your mind first when I say clob? Well, don't worry if you are not able to think anything about it. It’s nothing but a type used to store 4 GB of data in the database. I work with an Oracle db & today had to read a clob out parameter from Oracle procedure in .NET. Infact, I had to rewrite some code as the out param was initially of type varchar & then changed to clob. It’s a bit tricky & Google din’t come to my rescue this time & I figured it out using watch window of Visual Studio.

Code I had written when the out param was varchar is as below:

errorCode = Params[3].Value.ToString();


and re written as below to read a clob:

errorCode = ((Oracle.DataAccess.Types.OracleClob)(Params[3].Value)).Value.ToString();

Hope this snippet comes to your mind when you deal with Oracle datatypes like BFile, Blob, Clob, Binary, etc.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Dell
India India
I am a .Net developer working on C#,Asp.net,WCF,WF etc.I would like to utilize this space to share whatever I have come across so far working in .Net so that you can also learn & explore.

I hope you find these posts useful.I’d love to hear from you,so please post in your comments/feedback.

Visit my blog http://dotnetforyou.wordpress.com/ for more technical articles:

Comments and Discussions

 
QuestionThank You Pin
babila3-Jun-14 23:10
babila3-Jun-14 23:10 
GeneralThank you denzil76 Pin
Anupama Roy5-Jan-11 3:12
Anupama Roy5-Jan-11 3:12 
GeneralReason for my vote of 5 That was very informative Pin
denzil764-Jan-11 22:24
denzil764-Jan-11 22:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.