Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Oracle <CLOB question

I need to retrieve a table from Oracle using VBA (i can do this
easily), but in this situation one of the entries in the table is a
<CLOB.

i tried:
DBMS_LOB.substr(My_COL,2000,1)

and this seemed to help (or at least got me a step closer i thought)
to my desired solution
but still I cannot read the data into excel (i want to display it as a
string or character in a cell).

error received in VBA:
Run-time error '1004':
Application-defined or object-defined error

any help would be great.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Oracle <CLOB question

Would help if you showed more code - including the connection string you're
using.
Some drivers are better than others with LOB columns.

Tim

"jason" wrote in message
...
I need to retrieve a table from Oracle using VBA (i can do this
easily), but in this situation one of the entries in the table is a
<CLOB.

i tried:
DBMS_LOB.substr(My_COL,2000,1)

and this seemed to help (or at least got me a step closer i thought)
to my desired solution
but still I cannot read the data into excel (i want to display it as a
string or character in a cell).

error received in VBA:
Run-time error '1004':
Application-defined or object-defined error

any help would be great.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Oracle <CLOB question

On Nov 19, 9:53*pm, "Tim Williams" wrote:
Would help if you showed more code - including the connection string you're
using.
Some drivers are better than others with LOB columns.

Tim

"jason" wrote in message

...



I need to retrieve a table from Oracle using VBA (i can do this
easily), but in this situation one of the entries in the table is a
<CLOB.


i tried:
DBMS_LOB.substr(My_COL,2000,1)


and this seemed to help (or at least got me a step closer i thought)
to my desired solution
but still I cannot read the data into excel (i want to display it as a
string or character in a cell).


error received in VBA:
Run-time error '1004':
Application-defined or object-defined error


any help would be great.


Set objSession = CreateObject
("OracleInProcServer.XOraSession")


Sql = "SELECT * FROM B"



Set OraDynaSet = objdatabase.DBCreateDynaSet(Sql, 0)

where B contains a clob column.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 298
Default Oracle <CLOB question

I've never used the Oracle data access objects - ADO has always been easier
(no extra installs for users)
Have you tried incorporating the DBMS_LOB.substr(My_COL,2000,1) into your
SQL ?

Eg:
Sql = "SELECT DBMS_LOB.substr(B.My_COL,2000,1) FROM B"

Can you run that in SQLPlus or some other query tool ?

Equivalent ADO code would be (untested):

Dim oConn as new adodb.connection , sConnString as string
Dim oRS as new adodb.recordset

sConnString = "Provider=OraOLEDB.Oracle;User Id =" & sUser & _
";Password=" & sPassword & _
";Data Source=" & sInstance

oConn.Open sConnString
oRS.Open "SELECT DBMS_LOB.substr(B.My_COL,2000,1) FROM B", _
oConn, adOpenStatic, adLockReadOnly

debug.print left(oRS("My_COL").value,100)



Tim


"jason" wrote in message
...
On Nov 19, 9:53 pm, "Tim Williams" wrote:
Would help if you showed more code - including the connection string
you're
using.
Some drivers are better than others with LOB columns.

Tim

"jason" wrote in message

...



I need to retrieve a table from Oracle using VBA (i can do this
easily), but in this situation one of the entries in the table is a
<CLOB.


i tried:
DBMS_LOB.substr(My_COL,2000,1)


and this seemed to help (or at least got me a step closer i thought)
to my desired solution
but still I cannot read the data into excel (i want to display it as a
string or character in a cell).


error received in VBA:
Run-time error '1004':
Application-defined or object-defined error


any help would be great.


Set objSession = CreateObject
("OracleInProcServer.XOraSession")


Sql = "SELECT * FROM B"



Set OraDynaSet = objdatabase.DBCreateDynaSet(Sql, 0)

where B contains a clob column.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA//Oracle Interfacing Question jason Excel Programming 1 November 16th 09 05:23 PM
SQL for Oracle David Excel Discussion (Misc queries) 4 September 26th 06 06:22 PM
SQL for Oracle David Excel Discussion (Misc queries) 2 September 26th 06 04:28 PM
calling oracle stored function with CLOB parameter Jlorga[_5_] Excel Programming 0 March 3rd 06 11:58 AM
Connect to Oracle using Microsoft ODBC for Oracle Kent Excel Programming 2 January 18th 06 03:53 AM


All times are GMT +1. The time now is 06:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"