12.07.2015 Views

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

Solution Guide for Migrating Oracle on UNIX to SQL Server - Willy .Net

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

188 Developing: Applicati<strong>on</strong>s — <str<strong>on</strong>g>Migrating</str<strong>on</strong>g> <str<strong>on</strong>g>Oracle</str<strong>on</strong>g> <strong>SQL</strong> and PL/<strong>SQL</strong>first parameter is datatype. The sec<strong>on</strong>d parameter is <str<strong>on</strong>g>for</str<strong>on</strong>g> the column <strong>to</strong> be <str<strong>on</strong>g>for</str<strong>on</strong>g>matted. Thethird parameter is the desired <str<strong>on</strong>g>for</str<strong>on</strong>g>mat. Please see the list of <str<strong>on</strong>g>for</str<strong>on</strong>g>mats and thecorresp<strong>on</strong>ding <str<strong>on</strong>g>for</str<strong>on</strong>g>mula in Table 11.16.Table 11.16: CONVERT Functi<strong>on</strong> Formats in <strong>SQL</strong> <strong>Server</strong>WITH CENTURY (YYYY)INPUT/OUTPUT0 OR 100 (*) MON DD YYYY HH:MIAM (OR PM)101 MM/DD/YY102 YY.MM.DD103 DD/MM/YY104 DD.MM.YY105 DD-MM-YY106DD MON YY107 MON DD, YY108 HH:MM:SS9 OR 109 (*)DEFAULT + MILLISECONDS110MON DD YYYY HH:MI:SS:MMMAM (ORPM)MM-DD-YY111 YY/MM/DD112 YYMMDD13 OR 113 (*) DD MON YYYY HH:MM:SS:MMM(24H)114 HH:MI:SS:MMM(24H)20 OR 120 (*) YYYY-MM-DD HH:MI:SS(24H)21 OR 121 (*) YYYY-MM-DD HH: MI: SS.MMM (24H)130* DD MON YYYY HH:MI:SS:MMMAM131* DD/MM/YY HH:MI:SS:MMMAMC<strong>on</strong>diti<strong>on</strong>al Functi<strong>on</strong>sC<strong>on</strong>diti<strong>on</strong>al functi<strong>on</strong>s are used <strong>to</strong> compare values or <strong>to</strong> evaluate a Boolean expressi<strong>on</strong>.Table 11.17 compares these functi<strong>on</strong>s between <str<strong>on</strong>g>Oracle</str<strong>on</strong>g> and <strong>SQL</strong> <strong>Server</strong>.Table 11.17: C<strong>on</strong>diti<strong>on</strong>al Functi<strong>on</strong>s in <str<strong>on</strong>g>Oracle</str<strong>on</strong>g> and <strong>SQL</strong><str<strong>on</strong>g>Oracle</str<strong>on</strong>g> Descripti<strong>on</strong> <str<strong>on</strong>g>Oracle</str<strong>on</strong>g> <strong>SQL</strong> <strong>Server</strong> <strong>SQL</strong> <strong>Server</strong>Functi<strong>on</strong> Example Functi<strong>on</strong> ExampleNVL To return a NVL (SALARY, ISNULL ISNULLdefault value if 0) returns 0 if(SALARY, 0)the expressi<strong>on</strong> the column returns 0 if theis nullvalue (SALARYcolumn) is nullcolumn value(SALARYcolumn) is nullNVL2 To return a NVL2 (Salary, CASECASE SALARYvalue if the Salary*2, 0) WHEN nullexpressi<strong>on</strong> isnull or nullreturns twotimes thesalary if not nulland 0 if nullTHEN 0ELSESALARY*2END

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!