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

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

Code Conversion from MSSQL into Oracle

From: VIVEK_SHARMA <VIVEK_SHARMA_at_infosys.com>
Date: Thu, 11 Dec 2003 03:49:25 -0800
Message-ID: <F001.005D98B7.20031211034925@fatcity.com>


Content-Type: multipart/alternative;
 boundary="----_=_NextPart_001_01C3BFDC.4E8D0B9D" ------_=_NextPart_001_01C3BFDC.4E8D0B9D
Content-Type: text/plain;
 charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

=20

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

=20

SAMPLE :-


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

=20

DECLARE cur_temp_GEMT CURSOR FOR select

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

=20

OPEN cur_temp_GEMT =20

        =20

FETCH NEXT FROM cur_temp_GEMT INTO

      @branch_id,@entity_id

     =20

WHILE @@FETCH_STATUS =3D 0 =20

BEGIN =20

=20

UPDATE GEMT SET other_party_name=3D(SELECT name from GEAT where = branch_id
=3D_at_branch_id and entity_id=3D_at_entity_id and addr_type=3D'1' and entity_type=3D'D') where entity_id=3D_at_entity_id and branch_id =3D = @branch_id

=20

FETCH NEXT FROM cur_temp_GEMT INTO

      @branch_id,

      @entity_id

=20

=20

END =20

CLOSE cur_temp_GEMT

DEALLOCATE cur_temp_GEMT

=20

=20

------_=_NextPart_001_01C3BFDC.4E8D0B9D
Content-Type: text/html;
 charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html>

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">

<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">

<style>
<!--

 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal

	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{font-family:"Courier New";
	color:red;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}

-->
</style>

</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:red'>Are there = any TOOLs
for converting Sample Code (like the following) from MSSQL into = Oracle?</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:red'>SAMPLE = :-</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>--------</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:red'>DECLARE = @entity_id
char(32), @branch_id char(9)</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>DECLARE&nbsp; cur_temp_GEMT CURSOR FOR select</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = branch_id,entity_id
from GEMT where other_party_name=3D'' and = entity_type=3D'D'</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:red'>OPEN = cur_temp_GEMT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:red'>FETCH = NEXT FROM cur_temp_GEMT
INTO</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = @branch_id,@entity_id</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:red'>WHILE @@FETCH_STATUS =3D 0</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>BEGIN</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:red'>UPDATE = GEMT SET other_party_name=3D(SELECT
name from GEAT where branch_id =3D_at_branch_id and entity_id=3D_at_entity_id = and&nbsp; addr_type=3D'1'
and entity_type=3D'D') where entity_id=3D_at_entity_id and branch_id =3D = @branch_id</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:red'>FETCH = NEXT FROM cur_temp_GEMT
INTO</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = @branch_id,</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = @entity_id</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>END</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier New";color:red'>CLOSE = cur_temp_GEMT</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>DEALLOCATE cur_temp_GEMT</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

<p class=3DMsoNormal><font size=3D2 color=3Dred face=3D"Courier =
New"><span
style=3D'font-size:10.0pt;font-family:"Courier = New";color:red'>&nbsp;</span></font></p>

</div>

</body>

</html>

=00
------_=_NextPart_001_01C3BFDC.4E8D0B9D--

------=_NextPartTM-000-81119ebe-049b-4c45-b472-db4cf818660a--

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: VIVEK_SHARMA
  INET: VIVEK_SHARMA_at_infosys.com

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 - 05:49:25 CST

Original text of this message

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