Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

What is the syntax for querying an oracle linked table in access 2007 Expand / Collapse
Author
Message
Posted Tuesday, January 29, 2013 8:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, February 4, 2014 7:43 AM
Points: 5, Visits: 56
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
Post #1413103
Posted Tuesday, January 29, 2013 9:08 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:03 PM
Points: 12,895, Visits: 32,091
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1413121
Posted Tuesday, January 29, 2013 9:22 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, February 4, 2014 7:43 AM
Points: 5, Visits: 56
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.

Post #1413137
Posted Thursday, February 7, 2013 8:45 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 3, 2014 12:36 AM
Points: 178, Visits: 574
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?

Post #1417441
Posted Friday, February 8, 2013 8:18 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Tuesday, January 28, 2014 8:15 AM
Points: 3,065, Visits: 4,639
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.
Post #1417736
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse