Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

SQL 2000 insert into an oracle database

Posted on 2006-10-28
5
261 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

808 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