• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

SQL 2000 insert into an oracle database

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
Netstore
Asked:
Netstore
  • 2
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
insert into openquery(oracle_linked_server, 'select * from oracle_table where 1=0 ' )
  select * from mytable
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
INSERT INTO OPENQUERY( oracle , 'select Col1,Col2..from OracleTable) (Col1,Col2.. )
SELECT Col1,Col2..From myTable


0
 
NetstoreAuthor Commented:
Cheers !!! Much simpler than I thought, thanks for the quick response !!
0
 
NetstoreAuthor Commented:
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
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
SET ANSI_NULLS ON
SET ANSI_WARNINGS ON

CREATE PROCEDURE ....
AS.

etc
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now