Solved

ADO and Oracle CLOBs

Posted on 2006-07-01
6
1,352 Views
Last Modified: 2012-05-05
ok, I have a problem accessing an oracle CLOB from ADO / ASP.
Environment is Windows 2003 Server
I have setup a System DSN named dQA which uses the Microsoft ODBC for Oracle Driver

The connection and site has worked fine forever and a day.  We have recently decided to convert a field in one of our tables from a LONG to a CLOB.  I am now in the process of trying to debug / fix the ASP code to read the CLOB.  I have seen too much information ... some saying that it can not be done  or here is a solution ... and so I go down the path of it can be done.

Here is the SQL:
SELECT id AS msgID, Upper(to_text) AS msgToText, subj_text AS msgSubjText, status AS msgStatus, create_date AS create_date, modify_date AS modify_date, message_text AS msgMessageText, message_length AS msgMessageLen
FROM messages
WHERE message_type = 'XYZ'  
AND id = 417955  
AND to_date('04/21/2006','MM/DD/RRRR') < nvl(modify_date,create_date)  
ORDER BY Create_date desc

** message_text AS msgMessageText is  the CLOB field **

Getting an the following error:
Provider error '80004005'
Unspecified error
GetMessageInfo.vbs, line 63  ... which is the open

I don't even get to the chance to getChunk to read the CLOB field ...

The rest of the site is fine ... all other pages not accessing this new CLOB field are fine.

Any thoughts?

0
Comment
Question by:JeffStone
  • 3
  • 3
6 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 500 total points
ID: 17024167
You will have to switch to use the native Oracle provider.  The Microsoft provider does not support CLOBs
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17024181
Here is some relevant documentation on the subject:
INFO: Supportability of the Microsoft ODBC Driver/ OLE DB Provider for Oracle w.r.t Oracle 8.x
http://support.microsoft.com/kb/q239719/
INFO: Limitations of Microsoft Oracle ODBC Driver and OLEDB Provider
http://support.microsoft.com/kb/q244661/

Having said that, there are two things that may help:  
1. You may have "Show friendly HTTP error messages" checked in your browser which is preventing you from seeing the main error.
2. In general when using ADO, BLOBs should always be placed last in the Select list.
0
 

Author Comment

by:JeffStone
ID: 17024202
Thanks I will look into it and let you know.
Are there any known differences between the Microsoft and Oracle Providers?
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

Author Comment

by:JeffStone
ID: 17024272
thanks will be getting those pts to you shortly, another question if you please
after the open If there is no error and there is data I do the following:
  msgLen = CLng(objMsgRS(msgMessageLen))
  msgBody = objMsgRS(msgMessageText).GetChunk(msgLen)

but am getting the following error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
GetMessageInfo.vbs, line 72  ... which is the GetChunk.

any thoughts
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 17027078
The coorect syntax is:
msgBody = objMsgRS.Fields("msgMessageText").GetChunk(msgLen)

However, there is no need to use GetChunk to return the value in the column, especially if you are retrieving all of it and not parts at a time.  You should be able to refer to it directly, as you would any other column as in:
msgBody = objMsgRS.Fields("msgMessageText").Value

0
 

Author Comment

by:JeffStone
ID: 17027312
thanks
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now