Solved

ADO and Oracle CLOBs

Posted on 2006-07-01
6
1,349 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks I will look into it and let you know.
Are there any known differences between the Microsoft and Oracle Providers?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:JeffStone
Comment Utility
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
Comment Utility
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
Comment Utility
thanks
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

744 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

16 Experts available now in Live!

Get 1:1 Help Now