Importing Data from Oracle for CLOB data Type

bhanupraveen

New Member
Joined
May 2, 2012
Messages
5
Hi,

I have a scenario where in i need to connect to Oracle and get data from a table which contains CLOB datatype value. Below is my code:

Dim ConnectionString As String
Dim SQL_String As String
Set con = New ADODB.Connection
Set recset = New ADODB.Recordset
Oracle_Data_Source = "perf01"
Oracle_User = "PERF_OWNER"
Oracle_Password = "PERF_OWNER"
ConnectionString = "Provider=msdaora;Data Source=" + Oracle_Data_Source + "; User Id=" + Oracle_User + "; Password=" + Oracle_Password

con.ConnectionString = ConnectionString
con.Open con.ConnectionString

SQL_String = "select ID,dbms_lob.substr(bus_key,25,10) from MDI_WORK"

recset.Open SQL_String, con, adOpenStatic, adLockReadOnly

Do While Not recset.EOF
Debug.Print recset.Fields(0).Value
Debug.Print recset.Fields(1).Value
Loop

When i try to execute this code, getting "Application Defined or Object Defined error '1004'", Pls help me.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,215,972
Messages
6,128,030
Members
449,414
Latest member
sameri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top