Excel VBA - Oracle SQL Datatype not supported Error

ron011994

New Member
Joined
Aug 17, 2015
Messages
5
Hi All,

I have been trying to download SQL Scripts through excel. It was successful at first but when I tried to run the below script it prompts a Datatype not supported error.
I am using an ADO connection for this.

Below is the code to call SQL script.


Dim sql As String
sql = ThisWorkbook.Sheets("Scripts").Cells(2, 7)
Call GetDataFromADO(sql, ThisWorkbook.Sheets("temp").Range("p2"), Sheets("temp"))
Sheets("temp").Select

and here is the SQL script.

Select PERSONPERMID,COMPANYNAME,COMPANYTITLE
from PEOPLEAUTHORITY.PERSONINFOFORCONCORDANCE
Where PERSONPERMID in (00000000)

<colgroup><col></colgroup><tbody>
</tbody>


Kindly note that when the above script is run via Oracle developer it does works.


Thanks in advance.

Ron
 
Did you use to_char() in your sql query? That would be the simplest fix for this problem.
Code:
Select PERSONPERMID, [COLOR=#0000ff]to_char(COMPANYNAME) company_name, to_char(COMPANYTITLE) company_title[/COLOR]
from PEOPLEAUTHORITY.PERSONINFOFORCONCORDANCE
Where PERSONPERMID in (00000000)
If that doesn't work I'll see if a change in VBA code with GetChunk helps.
 
Upvote 0

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Forum statistics

Threads
1,215,343
Messages
6,124,400
Members
449,156
Latest member
LSchleppi

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