What is the syntax for querying an oracle linked table in access 2007

  • I have an oracle linked table in an access 2007 database that is linked via an odbc connection.

    I have not used access much and am unsure of the structure and syntax of a select statement to a linked table. Could someone please provide and example of one.

    Thanks

  • Access has linked servers?

    i think i just read your question wrong.

    If you've correctly set up an Oracle Linked server, you can first use sp_tables_ex MyOracle and you should see a list of some tables.

    You posted in a SQL server web site, and talked about Linked servers, which are in SQL server as well....

    after that, it's going to require specifics concerning the data there, but it would look something like this:

    --list all the tables and their names

    EXEC sp_tables_ex MyOracle

    GO

    select * from MyOracle..SCOTT.EMP

    select * from MyOracle..USERNAME.TABLENAME

    select * from MyOracle..MFHDS.GMACT

    From SQl Server,

    Access linked servers look almost exactly the same, but with no user

    EXEC sp_tables_ex MyAccess

    select * from MyAccess...Invoices;

    however, I have not gotten a 64 bit Access Linked server to work yet; as far as i know the ACE driver is broken as far as Access, but works for Excel.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Maybe I was't all that clear.

    Let me expand on the problem.

    I have an oracle linked table in an access 2007 database.

    I created the linked table with an odbc.

    when I run the following statement I get an error saying "sytax error near from"

    select column1, column2

    from linked table.

    I was wondering if I need to us an openquery or openrowset in the statement.

    Thanks for the help on this.

  • MS Access does not have OPENQUERY or OPENROWSET. Those are SQL Server keywords.

    This is a SQL Server/Oracle forum. You need to clarify whether you are talking about MS Access or SQL Server.

    What happens when you double click your linked table in MS Access - does it show data?

    What happens when you create a query in MS Access - does it work and show data?

  • lewis.ray (1/29/2013)


    I have an oracle linked table in an access 2007 database.

    I created the linked table with an odbc.

    when I run the following statement I get an error saying "sytax error near from"

    select column1, column2

    from linked table.

    I really doubt that's the actual select statement you are running. Please copy/paste both the statement and the full error message.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply