views:

113

answers:

1

Can someone help me construct the SQL that I need to query the Projects_dim table using the Linked Server "idwd"?

To test the connection, I ran a sample query using the linked server name. To access the tables on the linked server, I used a four-part naming syntax:

linked_server_name.catalog_ name.schema_name.table_name.

replacing the values, you get:

idwd.idwd.wimr.PROJECTS_DIM

of should it be the following?

idwd..wimr.PROJECTS_DIM

The database name is "idw" but the grid below shows a blank value under "catalog", which is one source of my confusion, though I believe that the more likely approach is to construct the syntax assuming that the catalog part of the qualified table name should be blank as in the following first example.

    select * from idwd..wimr.PROJECTS_DIM

    Server: Msg 7314, Level 16, State 1, Line 1
    OLE DB provider 'idwd' does not contain table '"wimr"."PROJECTS_DIM"'.  The table either does not exist or the current user does not have permissions on that table.

select * from idwd.idwd.wimr.PROJECTS_DIM

Server: Msg 7312, Level 16, State 1, Line 1
Invalid use of schema and/or catalog for OLE DB provider 'MSDAORA'. A four-part name was supplied, but the provider does not expose the necessary interfaces to use a catalog and/or schema.

Can someone suggest what I need to do to query this table?

I am using the MS OLEDB Driver for Oracle.

I thought perhaps there is an issue with case-sensitivity, so I tried this:

select * from IDWD..WIMR.PROJECTS_DIM


Server: Msg 7356, Level 16, State 1, Line 1
OLE DB provider 'MSDAORA' supplied inconsistent metadata for a column. Metadata information was changed at execution time.

and this:

select * from IDWD.IDWD.WIMR.PROJECTS_DIM

Server: Msg 7312, Level 16, State 1, Line 1
Invalid use of schema and/or catalog for OLE DB provider 'MSDAORA'. A four-part name was supplied, but the provider does not expose the necessary interfaces to use a catalog and/or schema.

I tried to create a linked server using each of the two likely drivers:

  1. Microsoft OLEDB Provider for Oracle
  2. Oracle Provider for OLEDB

..without luck.

Do you think it could be a driver issue?

alt text

A: 

Sounds like you may be on the right track thinking about this as an issue of case sensitivity. Quoting from the Microsoft support document How to set up and troubleshoot a linked server to an Oracle database in SQL Server regarding errors 7312, 7313, 7314:

If you receive these error messages, a table may be missing in the Oracle schema or you may not have permissions on that table. Verify that the schema name has been typed by using uppercase. The alphabetical case of the table and of the columns should be as specified in the Oracle system tables.

On the Oracle side, a table or a column that is created without double quotation marks is stored in uppercase. If the table or the column is enclosed in double quotation marks, the table or the column is stored as is.

Joe Stefanelli