Question

SQL Query and Oracle => Error: "Data type is not supported"

Asked by: AidenA

I have a query on an Oracle database. Two of my queries work fine, they are just 'select * from table' queries... nothing complicated.

The third query, however, doesn't work. The sql is below. The recordset rs should have the correct connection string. And also, another person who works in India tried it on his end and said it worked fine...

I just have the oracle client on my computer so that i can query the database which is on a server.

I've no idea what this error is or how to fix it... can anyone explain?

thanks, Aiden

myString = "SELECT * FROM BIC.ACE_Data"
      
rs.Open(myString)

                                  
1:
2:
3:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-08-06 at 04:26:40ID24630982
Tags

SQL

,

Oracle

Topics

SQL Query Syntax

,

Oracle CRM

,

.NET

,

SQL Reporting

,

Oracle Database

Participating Experts
5
Points
500
Comments
24

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Oracle and ASP
    Hello everyone, I have a couple questions about how to use ASP with Oracle 8i 8.15. The two I have questions here is the first one: How to make a SQL statement within ASP and pass that into ORACLE, getting the results to dump to HTML. The second question is how to make a PL-...
  2. Recordset from Oracle
    Hi Folks, I have asked this question before but it seems no one replied to it. Any how I will put htis up for you once again. I need to know if a procedure(stored off course) can return a resultset in VB. I am working on a package written in Sybase and there Sybase stored ...
  3. SQL server to Oracle
    i have a system which is developed using vb and connected to Microsoft SQL Server database. it is fine. but now i need to make the system compatible with oracle. i hit a problem when i try to update a field of a recordset that select records from 2 or more table using thi...
  4. Oracle Procedure return recordset
    Hi there experts, I migrated from Sql Server 7.0 to ORALCE Version 7.3.4 VB 6.0 was accessing the sql server db and retrieving recordsets from stored procedures how can i accomplish this with oracle as the back end thank u for taking the time to read this please help...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: rizwanidreesPosted on 2009-08-06 at 04:39:03ID: 25032102

SQL :=

SELECT * FROM BIC.dbo.ACE_Data


ORACLE

SELECT * FROM BIC.dbo.ACE_Data

SELECT * FROM ACE_Data Will work for both but it depends on your connection settings

 

by: AidenAPosted on 2009-08-06 at 04:52:41ID: 25032169

thanks, but i'm not sure what you are saying there?

remember, i already have two identical queries, but selecting different tables which work fine. They have the format that i have mentioned. What is the error that is returned?

 

by: rizwanidreesPosted on 2009-08-06 at 04:55:47ID: 25032190

the error is about invalid database name of table name in this case either BIC or ACE_Data are not correct

 

by: AidenAPosted on 2009-08-06 at 06:03:09ID: 25032741

humm, no this doesn't seem to be the problem. I tried changing the name with one of the select queries that works to see what kind of an error an invalid table name throws up, but the error in this case is 'ORA-00942: table or view does not exist'

So, that is not the error I'm getting. The table definitely exists then, I can confirm that now and that the name is correct... very strange. I mean, I think my code is probably ok, so I can only guess that there is some problem with the oracle client perhaps... maybe some kind of incompatability with the server database? I've no idea really i'm just guessing but i can't see any error in the code

 

by: rizwanidreesPosted on 2009-08-06 at 07:05:08ID: 25033473

Can you share your connection string?

Try selecting columns one by one field i.e.

SELECT FIELD1 FROM BIC.ACE_DATA

it will give you which column of table is giving error


 

by: bittiPosted on 2009-08-06 at 07:11:18ID: 25033532

What are the version of Oracle Client and Oracle Server ?

Please, use sqlplus (or any other tool that support the command desc) and send me the result of :

desc BIC.ACE_Data;

Deivid

 

by: AidenAPosted on 2009-08-06 at 07:30:07ID: 25033765

yeah good idea...

humm, tried to do "SELECT ICO1 FROM BIC.ACE_Data" and got the error 'ORA-00904: "ICO1": invalid identifier'.

Tried with a different columnname: "SELECT 'Customer Name' FROM BIC.ACE_Data" and it worked actually, except that when i look at what was returned... there are 15,000 rows which all say 'Customer Name' ??? at least that's what comes out when i do a CopyFromRecordset(rs) into excel to see what's in the recordset

 

by: AidenAPosted on 2009-08-06 at 08:03:48ID: 25034246

I'm not sure of the versions at the moment. I will have to check tomorrow and let you know if that's ok. What does the command desc do?

I'm not totally sure what you mean by use sql plus. At the moment I am using the code below in .net vs 2005, but not too familiar with accessing oracle databases. Until now i've  just been working with accessing access databases

'web.config
'connection string
<add key="BICServer" value="Provider=MSDAORA;Data Source=bicsite.world;User Id=AIDEN;Password=xxxx; Min Pool Size=10;Connection Lifetime=120;Connection Timeout=120;Incr Pool Size=5;Decr Pool Size=2"/>
 
'Then in my forms codebehind
Dim strBICServer As String = ConfigurationManager.AppSettings("BICServer")
      
strBICConnection = strBICServer
 
      If cnnBIC.State = 0 Then cnnBIC.Open(strBICConnection)
 
      'Opening a new recordset in this case
      rs.ActiveConnection = cnnBIC
 
MySQL = "SELECT * FROM BIC.ACE_Data"
rs.Open(MySQL)
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:

Select allOpen in new window

 

by: rizwanidreesPosted on 2009-08-06 at 08:41:38ID: 25034715

 

by: AidenAPosted on 2009-08-07 at 02:27:39ID: 25041054

Hi,

Well it seems like i shouldn't have a problem because apparently the Oracle server I am accessing is 9i and the client on my machine is also 9i... so i guess that's why the other queries work fine. So i'm not really sure what the problem is...

 

by: AidenAPosted on 2009-08-07 at 04:25:16ID: 25041570

just searching the web... i found another person with this exact problem. the way they solved it was to use oraclecommand.... but it seems like i can't add this to my website... only for win apps... so it doesn't appear in my toolbox when i add it to my website. Is there anyway to use this... or a better way to attach to an oracle database from a website then using the oledb connection which seems a bit dodgy

 

by: mrjoltcolaPosted on 2009-08-12 at 16:36:37ID: 25084291

Try upgrading the Oracle client to 10g, along with the .NET data provider for 10g. 10g client will work against a 9i database, and the client is much more mature and bug-free.

 

by: mwvisa1Posted on 2009-08-12 at 16:38:17ID: 25084306

I haven't seen this mentioned yet, but sorry for duplication if it is.

Try specifying your column names explicitly.  As you are adding each column to the list note the data type of the column.  Since you are using 'SELECT *' you may be retrieving a data type that is not compliant with ADO or whatever you are using to connect.  You may be able to get around it by converting/casting to a similar / supported data type.  

If this is a standard data type in your opinion, then check to see if there is an updated driver but your connection string is calling on the old provider name / format.

Here is a good resource for that: http://www.connectionstrings.com/oracle

Hope that helps.

 

by: mwvisa1Posted on 2009-08-12 at 16:38:50ID: 25084311

Ah, MJC beat me to saying update your client. :)

 

by: mrjoltcolaPosted on 2009-08-12 at 16:41:56ID: 25084335

:) I agree on specifying the colums explicitly, I suspect there is a BLOB or LONG or XML type in the mix as well. It would help to describe the table. Any SQL tool (sqlplus, toad, SQL Developer) is capable of describing the table structure.

 

by: AidenAPosted on 2009-08-13 at 06:06:49ID: 25087718

ok i managed to solve this. I used sql+ to view the data types, and i can see that there are a number of CLOB data types present. Then i got the administrator of the server to change them to varchars which did the trick.

Thanks! Aiden

 

by: markgeerPosted on 2009-08-13 at 06:09:23ID: 25087746

When you tried this query: "SELECT 'Customer Name' FROM BIC.ACE_Data", the result was exactly what I expect Oracle to give you.  That is, Oracle will give you as many rows in the result set as there are records in the table, and since you asked Oracle to give you exactly 'Customer Name', that is exactly what it will give you on each row.  That is not the syntax to use in Oracle if what you really want is the contents of a column named: customer_name.

When you connect to Oracle from an applcation that uses ODBC or .net, you have to be careful of two things:
1. Case sensitivity of table/column names (or not)
2. Fully-qualified object names.
 
By default, Oracle table and column names are not case-sensitive (and they do not contains spaces, but they may contain the underscore character between words).  They are usually all upper-case values, and as long as you use Oracle tools, you can refer to tables and/or columns in Oracle in any case, or mixed case and you do *NOT* need to use double quotes aorund Oracle table or column names then.  A problem comes with Microsoft tools for connecting to databases, since they tend to be case-sensitive for table and column names, and they tend to use double quotes around table and/or column names.  When Oracle sees double quotes around table or column names, the case of the name in the quotes must exactly match the value in the Oracle database, or Oracle will return the 'ORA-00942: table or view does not exist' error if it thinks the table name you provided is not valid, or the 'ORA-00904: ... invalid identifier' if it thinks the column name you provided is not valid.

 In Oracle, a fully-qualified table name includes the owner (also called a "schema" in Oracle) of the table, plus a dot (a period character) followed by the table name itself.  So, "BIC.ACE_Data" could be a valid, fully-qualified reference to a table in Oracle, assuming that the owner (schema) name is: "BIC" and that the table_name is: "ACE_DATA".  You don't always need to use that full [schema].[table_name] syntax in Oracle however.  If you log in to Oracle as the schema owner ("BIC" in this case) you never need to use the "BIC." prefix for objects that "BIC" owns.  Or, if an Oracle DBA created a public synonym named "ACE_DATA" for the table: "ACE_DATA" that is owned by "BIC", then no matter which Oracle username you use when you log in, you can simply use "ACE_DATA" to refer to the table.

Also, if you do not log in to Oracle as the table owner ("BIC") you could get the 'ORA-00904: table or view does not exist error' if BIC has not granted permission on the ACE_DATA table to the username that you do log in to Oracle with (or to a role that your username has).

 

by: mwvisa1Posted on 2009-08-13 at 06:11:46ID: 25087767

Good news, Aiden.

You are very welcome.  Just glad to be of some assistance in the matter.  

Best regards and happy coding,

Kevin

 

by: mwvisa1Posted on 2009-08-13 at 06:13:37ID: 25087791

markgeer: was that meant for a different question.  If so, I can delete this comment from here and then you can repost in the correct question.

 

by: AidenAPosted on 2009-08-13 at 06:14:53ID: 25087803

thanks very much for that, unfortunately i closed the question already, but the information you give is very useful so i appreciate that.

sorry about that, thanks again.

 

by: AidenAPosted on 2009-08-13 at 06:16:57ID: 25087826

you can leave comment there... it is still useful to look back on later, thanks

 

by: mwvisa1Posted on 2009-08-13 at 06:17:16ID: 25087831

Never mind, I see now you were responding to comments from before the call for experts in the posts.  My initial reaction was because the question was not about the "SELECT 'Customer Name' ..." but I see that now.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...