Access oracle table from sql server

Access oracle table from sql server

First and Foremost you need to create on DSN (Here OracleSvr)   to connect to Oracle from SQL server (Microsoft)
After creating the DSN and testing it the following commands can be used to select the data from the Oracle database

Here's the SELECT syntax: ( To be run in SQL Server )
SELECT * FROM OPENQUERY(OracleSvr, 'SELECT name, id FROM joe.titles')
 
Here's the UPDATE, INSERT, DELETE syntax:
UPDATE OPENQUERY (OracleSvr, 'SELECT name FROM joe.titles WHERE id = 101')
SET name = 'ADifferentName';
 
INSERT OPENQUERY (OracleSvr, 'SELECT name FROM joe.titles')
VALUES ('NewTitle');
 
DELETE OPENQUERY (OracleSvr, 'SELECT name FROM joe.titles WHERE name =
''NewTitle''');
 

Post a Comment

And that's all there is to it!

If anyone has any other questions or requests for future How To posts, you can either ask them in the comments or email me. Please don't feel shy at all!

I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.

Previous Post Next Post