dbTalk Databases Forums  

New to DTS and need to take the next step

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss New to DTS and need to take the next step in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ken McClaren
 
Posts: n/a

Default New to DTS and need to take the next step - 07-27-2004 , 03:33 PM






I'm trying to convert an Oracle Database process to SQL Server.

The original process ran from a UNIX cron and executed an Oracle Stored
procedure that updated a table in a remote database and then updated the
local database to reflect the changes. Here is the code:

CREATE OR REPLACE PROCEDURE "PROD"."MAX_TRANS" AS
CURSOR upd_cur IS
SELECT
TRNSTS,
ORIGIN,
PRTNUM,
PRTDSC,
UPCCOD,
COMCOD,
NDCCOD,
....
FROM usr_prt_ext
WHERE trnsts IN ('I','U')
AND prtfam IS NOT NULL
AND untwgt IS NOT NULL
AND qltcod IS NOT NULL
AND typcod IS NOT NULL
AND prtnum IS NOT NULL
FOR UPDATE OF TRNSTS ;
upd_rec upd_cur%ROWTYPE;
BEGIN
OPEN upd_cur;
LOOP
FETCH upd_cur INTO upd_rec;
EXIT WHEN upd_cur%NOTFOUND;
INSERT INTO usr_PRT_EXT@dcs values (
upd_rec.TRNSTS,
upd_rec.ORIGIN,
upd_rec.PRTNUM,
upd_rec.PRTDS
....
upd_rec.CLRWAY);
UPDATE usr_prt_ext
SET trnsts = null
WHERE current of upd_cur;
END LOOP;
CLOSE upd_cur;
commit;
END;

The first half of this statement was easy. I just went to the DTS import
wizard, imported the tables then modified that same script to update the
remote table based on the where clause above. The problem I'm having is that
I don't know how to implement the above update statement. How do I update
the Oracle table to reflect the migration of this data? Remember this is
really the first time I've ever used DTS to do this type of work. Please be
detailed in your response.
tks
ken.



Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.