If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Help with DTS for datatransfer from Oracle to SQL server

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-12-05, 13:46
BeijingPinkGirl BeijingPinkGirl is offline
Registered User
 
Join Date: Aug 2005
Posts: 16
Question Help with DTS for datatransfer from Oracle to SQL server

Greetings,
I have been trying this for a few days still could not make it work. I am new here and please help! Any suggestions/comments are highly appreciated!

I created a simple DTS package in Enterprise Mgr to select a data set from Oracle server and transfer them to SQL 2000 server. Here is the select query for data transfer.

Code:
select * from ord_fx where trade_date='7-Oct-2005'
It works fine and transfer the correct data set.

Now I want to have updated data transfered on daily basis and revise the query:

Code:
declare CurrDate date :=round(sysdate);
select * from ord_FX
where status_Flag is null
and to_date(Entry_date, 'DD-MM-YYYY'>='CurrDate';
However, I got the following error message when I click on Preview... button.
Attached Files
File Type: doc Error in DTS .doc (36.0 KB, 64 views)
Reply With Quote
  #2 (permalink)  
Old 10-12-05, 14:04
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
This gets a bit funky to explain, but I'll give it a good shot...

When you compose a query using a linked server within Microsoft SQL, the query itself is interpreted according to the Transact-SQL syntax rules (it is actually done at the OLE-DB level, but the rules are almost exactly the same). The results of that interpretation form the query plan, and an equivalent query is actually passed to the provider for the linked server.

In order to be able to use the Oracle specific syntax like TO_DATE, you'll need to use Microsoft SQL's OPENQUERY function.

-PatP
Reply With Quote
  #3 (permalink)  
Old 10-12-05, 14:32
BeijingPinkGirl BeijingPinkGirl is offline
Registered User
 
Join Date: Aug 2005
Posts: 16
Pat,
Thank you for your reply. I am not sure if I fully understand.
Just want to be clear attached please see the screenshots I am using to create DTS package by using query. You mean I can use MS SQL language instead of Oracle sytex to transfer data set?

Or I have to create separate SP and call sp from DTS query window?
Many thanks
Reply With Quote
  #4 (permalink)  
Old 10-12-05, 14:33
BeijingPinkGirl BeijingPinkGirl is offline
Registered User
 
Join Date: Aug 2005
Posts: 16
Here is the screenshots.
Attached Files
File Type: doc QueryInDTS.doc (106.0 KB, 75 views)
Reply With Quote
  #5 (permalink)  
Old 10-13-05, 14:18
Pat Phelan Pat Phelan is offline
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,605
Let's continue this in your thread in the Microsoft SQL Forum.

-PatP
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On