Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Code Conversion from MSSQL into Oracle

RE: Code Conversion from MSSQL into Oracle

From: Hallas, John, Tech Dev <John.Hallas_at_GB.VODAFONE.CO.UK>
Date: Thu, 11 Dec 2003 08:44:25 -0800
Message-ID: <F001.005D98F7.20031211084425@fatcity.com>


Steve Perry from this list produced a perl script to read a import file (rows=n) and produce formatted DDL. Whilst it is not perfect (as Steve agrees) it does give a good basis of where to start with processing and transforming a text input stream into a text output stream whilst making a small no of changes) - or ETL as it is called these days, using PERL as the mechanism.  

I host the zip file on my site at http://www.hcresources.co.uk/perlscript.shtml  

I hope someone finds it useful. If they do thank Steve.  

HTH   John

-----Original Message-----
Sent: 11 December 2003 12:55
To: Multiple recipients of list ORACLE-L

10 years ago or so, I wrote a 105 line script for the UNIX "sed" (a.k.a. "stream editor") command to convert Teradata "BTEQ" scripts into Oracle SQL*Plus. Painful, yet thrilling, and it took only about a day of concentration with the O'Reilly "Awk and Sed" book at hand.

I'll bet you can write something (whether in "sed" or "awk" or Perl or Java) faster than it takes you find a TransactSQL-to-PL/SQL converter...? And if you don't know Perl (probably the best choice) yet, this exercise could be the opportunity to put a huge new skill into the old skillset...

Just a thought...

on 12/11/03 4:49 AM, VIVEK_SHARMA at VIVEK_SHARMA_at_infosys.com wrote:

Are there any TOOLs for converting Sample Code (like the following) from MSSQL into Oracle?

SAMPLE :-


DECLARE @entity_id char(32), @branch_id char(9)

DECLARE cur_temp_GEMT CURSOR FOR select

        branch_id,entity_id from GEMT where other_party_name='' and entity_type='D'

OPEN cur_temp_GEMT         

FETCH NEXT FROM cur_temp_GEMT INTO

@branch_id,@entity_id
     

WHILE @@FETCH_STATUS = 0 BEGIN UPDATE GEMT SET other_party_name=(SELECT name from GEAT where branch_id =@branch_id and entity_id=@entity_id and addr_type='1' and entity_type='D') where entity_id=@entity_id and branch_id = @branch_id

FETCH NEXT FROM cur_temp_GEMT INTO

@branch_id,

@entity_id

END CLOSE cur_temp_GEMT

DEALLOCATE cur_temp_GEMT

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Hallas, John, Tech Dev
  INET: John.Hallas_at_gb.vodafone.co.uk

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Dec 11 2003 - 10:44:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US