SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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


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

Author
Message
lewis.ray
lewis.ray
SSC Rookie
SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)

Group: General Forum Members
Points: 40 Visits: 88
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
Lowell
Lowell
SSC Guru
SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)SSC Guru (67K reputation)

Group: General Forum Members
Points: 67301 Visits: 40889
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!
lewis.ray
lewis.ray
SSC Rookie
SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)SSC Rookie (40 reputation)

Group: General Forum Members
Points: 40 Visits: 88
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.
nick.mcdermaid
nick.mcdermaid
SSC Eights!
SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)SSC Eights! (804 reputation)

Group: General Forum Members
Points: 804 Visits: 782
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?
PaulB-TheOneAndOnly
PaulB-TheOneAndOnly
SSChampion
SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)SSChampion (13K reputation)

Group: General Forum Members
Points: 13255 Visits: 4639
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search