Solved

SQL 2000 insert into an oracle database

Posted on 2006-10-28
5
263 Views
Last Modified: 2008-02-01
I have created a linked server to n oracle database which works fine i.e. I can pull data. However I want to insert data into this oracle table depending on rows returned from a SQL 2000 query:


1. select * from my table
2. insert results set into the oracle database table

How do I link these together using insert into openquery?
0
Comment
Question by:Netstore
  • 2
  • 2
5 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 17825604
insert into openquery(oracle_linked_server, 'select * from oracle_table where 1=0 ' )
  select * from mytable
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 17825626
INSERT INTO OPENQUERY( oracle , 'select Col1,Col2..from OracleTable) (Col1,Col2.. )
SELECT Col1,Col2..From myTable


0
 
LVL 5

Author Comment

by:Netstore
ID: 17825636
Cheers !!! Much simpler than I thought, thanks for the quick response !!
0
 
LVL 5

Author Comment

by:Netstore
ID: 17825717
Another quickie when I try and save this to a stored procedure I get an error 7405 - queries require the ANSI_NULLS and ANSI_WARNINGS to be set for the connection. Any ideas?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17825758
SET ANSI_NULLS ON
SET ANSI_WARNINGS ON

CREATE PROCEDURE ....
AS.

etc
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question