Cand3lasville

  • Home
    • About Us
  • Article
    • Programming
    • Entertainment
    • Sites
    • Poem
    • News
    • Español
    • Uncategorized
  • Programming
    • Java
    • SQL
  • Entertainment
    • Books
    • Audiobooks
    • Podcast
    • Computers
    • Games
    • Movies
    • TV Shows
    • Music

Basic Differences between Oracle and SQL Servers

Posted on July 26, 2013 by Robert A. Bernard Jr. Posted in Article, Computers, SQL .

Basic Differences between Oracle and SQL Servers

If you work with Oracle as well as SQL Server then you would sometimes need the cross functionality of certain codes. You may be working with a code in Oracle and then you will need to recreate the query in SQL only to find out that the code you are using does not translate. This may also happen the other way. You may be working on a query for SQL servers and when you want to replicate that into Oracle then it does not translate.

It is try that both systems are using the Structured Query Language or SQL but these systems are slightly different. This is because SQL Server uses Transact Structured Query Language or T-SQL while Oracle uses procedural language extension to Structured Query Language or PL/SQL. Based on the 2005 article by Margaret Rouse, T-SQL or Transact Structured Query Language is a set of programming extensions from Sybase and Microsoft that add unique features to the this programming language. Margaret Rouse also talks about PL/SQL to add procedural language extensions to the SQL programming language.

Therefore, both of these systems took the basic SQL programming language and added what each felt it was necessary to make it work for them. This explains, if you ever worked between these two systems, why the main code you with is the same but main other pieces of code have to be translated between these two systems. As an example to this let us consider the scenario where you need a number that may be between 3 to 5 characters long to be standard. You may have a report that requires that all these numbers to be 5 character’s long.

Here is what we could right in T-SQL:

USE COMPANYEMPLOYEES
GO

SELECT EMP_NUM
      ,EMPLOYEE_NAME

FROM GGO.EMPLOYEE_TABLE

GO
;

This code may produce the following data:

EMP_NUM EMPLOYEE_NAME
23 John Doe
1541 Jane Doe
245 John Smith
12342 Jane Smith
2 Joe Smith

 

However, if you write the code this way:

USE COMPANYEMPLOYEES
GO

SELECT RIGHT(REPLICATE('0',5) 
           + RTRIM(LTRIM(EMP_NUM)),5) AS "EMPLOYEE #"
      ,EMPLOYEE_NAME AS “EMPLOYEE NAME”

FROM GGO.EMPLOYEE_TABLE

GO
;

Then you will see this:

EMP_NUM EMPLOYEE #
00023 John Doe
01541 Jane Doe
00245 John Smith
12342 Jane Smith
00002 Joe Smith

As you can see the employee numbers are now all 5 characters long. Now if you would write this in PL/SQL to get the same result then things would be different. It will look something like this:

SELECT LPAD(EMP_NUM,5,'0') AS "EMPLOYEE #"
      ,EMPLOYEE_NAME AS "EMPLOYEE NAME"

FROM GGO.EMPLOYEE_TABLE

;

As you can see the grammar between these two languages are similar but the difference are apparent.

 

Works Cited

Rouse , M. (2008, October). PL/SQL (procedural language extension to Structured Query Language). Retrieved July 26, 2013, from SearchOracle: http://searchoracle.techtarget.com/definition/PL/SQL

Rouse, M. (2005, September). T-SQL (Transact-SQL). Retrieved July 26, 2013, from SearchSQLServer: http://searchsqlserver.techtarget.com/definition/T-SQL

Tags: extensions, Language, Microsoft, oracle, PL/SQL, procedural, procedural language extensions, procedural language extensions to the SQL programming language, Query, SQL Programming Language, SQL Server, Structured, Structured Query Language, T-SQL, Transact, Transact Structured Query Language .
« Introduction to Java Programming without IDE
Apple Product and Services Case Study in Technology Innovation »

Tags

amazon Apple Article barnes blog case study compile compiler dominican republic dominicans ereader Español essay extensions google wave site email chat networking ide immigration internet java kindle Language Microsoft migration Mobile noble nook oracle pc personal computer PL/SQL poem procedural procedural language extensions procedural language extensions to the SQL programming language Query reader SQL Programming Language SQL Server Structured Structured Query Language T-SQL technology Transact Transact Structured Query Language wordpress

Recent Comments

  • Gregory Smith on Energy Resource Plan
  • Robert A. Bernard Jr. on Immigration of Dominicans to the US
  • Robert A. Bernard Jr. on Immigration of Dominicans to the US
  • Curious on Immigration of Dominicans to the US
  • Frank on Burmese Pythons Invasion of the Florida Everglades

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Archives

Categories

Links

  • Digame's Diary
  • Rocio's Healing Touch, LLC
  • Rayguns & Six-Shooters

Recent Posts

  • The Last Starfighter (1984)
  • Discovery
  • Professional Association for SQL Servers
  • Apple Product and Services Case Study in Technology Innovation
  • Basic Differences between Oracle and SQL Servers

Categories

  • Article (60)
    • Poem (15)
  • Entertainment (120)
    • Books (16)
      • Audiobooks (3)
      • Podcast (12)
    • Computers (62)
    • Games (9)
    • Movies (8)
    • Music (2)
    • TV Shows (8)
  • Español (5)
  • News (22)
  • Programming (3)
    • Java (1)
    • SQL (2)
  • Sites (92)
  • Uncategorized (83)

Categories

  • Article
  • Audiobooks
  • Books
  • Computers
  • Entertainment
  • Español
  • Games
  • Java
  • Movies
  • Music
  • News
  • Podcast
  • Poem
  • Programming
  • Sites
  • SQL
  • TV Shows
  • Uncategorized

Recent Comments

  • Gregory Smith on Energy Resource Plan
  • Robert A. Bernard Jr. on Immigration of Dominicans to the US
  • Robert A. Bernard Jr. on Immigration of Dominicans to the US
  • Curious on Immigration of Dominicans to the US
  • Frank on Burmese Pythons Invasion of the Florida Everglades
July 2013
S M T W T F S
 123456
78910111213
14151617181920
21222324252627
28293031  
« Jun   Apr »

CyberChimps WordPress Themes

2014© Robert A Bernard Jr.