Compare the Difference Between Similar Terms

Difference Between

Home / Technology / IT / Database /Difference Between PL-SQL and T-SQL

Difference Between PL-SQL and T-SQL

June 14, 2011Posted byIndika

PL-SQL vs T-SQL

t - sql(Transact SQL) is an extension of SQL developed by Microsoft. T-SQL is used in Microsoft SQL Server. PL/SQL (Procedural Language/Structured Query Language) is also a procedural extension for SQL developed by Oracle. PL/SQL is a main programming language embedded in the Oracle database.

PL/SQL

SQL PL / SQL是一种程序上的扩展by Oracle. PL/SQL programs are built up of blocks, which is the basic unit of PL/SQL. PL/SQL provides support for variables, loops (WHILE loops, FOR loops, and Cursor FOR loops), conditional statements, exceptions and arrays. A PL/SQL program contains SQL statements. These SQL statements include SELECT, INSERT, UPDATE, DELETE, etc. SQL statements like CREATE, DROP, or ALTER are not allowed in PL/SQL programs. PL/SQL functions can contain PL/SQL statements and SQL statements and it returns a value. PL/SQL procedures on the other hand cannot contain SQL statements and it does not return a value. PL/SQL also supports some object oriented programming concepts such as encapsulation, function overloading and information hiding. But it does not support inheritance. In PL/SQL, packages can be used to group functions, procedures, variables, etc. Packages allow code reusing. Using PL/SQL code on Oracle server would lead to improved performance, since the Oracle server pre-compiles the PL/SQL code before actually executing it.

t - sql

t - sqlis an extension of SQL developed by Microsoft. T-SQL extends SQL by adding several features such as procedural programming, local variables and supporting functions for string/ data processing. These features makes T-SQL Turing complete. Any application, which needs to communicate with Microsoft SQL server, needs to send a T-SQL statement to the Microsoft SQL Server. T-SQL provides flow control capabilities using the following keywords: BEGIN and END, BREAK, CONTINUE, GOTO, IF and ELSE, RETURN, WAITFOR, and WHILE. Furthermore, T-SQL allows a FROM clause to be added to DELETE and UPDATE statements. This FROM clause would allow inserting joins in to DELETE and UPDATE statements. T-SQL also allows inserting multiples rows in to a table using the BULK INSERT statement. This would insert multiple rows in to a table by reading an external file containing data. Using BULK INSERT improves performance than using separate INSERT statements for each row that needs to be inserted.

What is the difference between PL/SQL and T-SQL?

PL / SQL程序扩展the SQL provided by Oracle and it is used with the Oracle database server, while T-SQL is an extension of SQL developed by Microsoft and it is mainly used with Microsoft SQL Server. There are some differences between the data types in PL/SQL and T-SQL. For example T-SQL has two data types called DATETIME and SMALL-DATETIME, while PL/SQL has a single data type called DATE. Furthermore, to obtain the functionality of the DECODE function in PL/SQL, the CASE statement has to be used in T-SQL. Also, instead of SELECT INTO statement in T-SQL, the INSERT INTO statement has to be used in PL/SQL. In PL/SQL, there is a MINUS operator, which could be used with SELECT statements. In T-SQL the same results can be obtained by using the NOT EXISTS clause with the SELECT statements.

Related posts:

Difference Between SQL and Microsoft SQL Server Difference Between SQL and T-SQL Difference Between SQL Server 2008 and Express Difference Between Explicit Cursor and Implicit Cursor Difference Between Data Mining and Query Tools

Filed Under:DatabaseTagged With:Microsoft,Microsoft SQL Server,Oracle,Oracle database server,PL SQL,PL/SQL,t - sql,Transact SQL

About the Author:Indika

Indika, BSc.Eng, MSECE Computer Engineering, PhD. Computer Science, is an Assistant Professor and has research interests in the areas of Bioinformatics, Computational Biology, and Biomedical Natural Language Processing.

Leave a ReplyCancel reply

Your email address will not be published.Required fields are marked*

Request Article

Featured Posts

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and SARS

Difference Between Coronavirus and SARS

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Covid 19

Difference Between Coronavirus and Covid 19

You May Like

Difference Between Full Time and Part Time Studies

Difference Between Full Time and Part Time Studies

Difference Between Top 10 Android Phones Released in 2011

Difference Between Religion and Theology

Difference Between Religion and Theology

Difference Between Invoice and Tax Invoice

Difference Between Invoice and Tax Invoice

Difference Between Rod and Cone Cells

Difference Between Rod and Cone Cells

Latest Posts

  • What is the Difference Between Solution Suspension and Emulsion
  • What is the Difference Between Constipation and Diarrhea
  • What is the Difference Between Soil Texture and Soil Structure
  • What is the Difference Between Appendicitis and Crohn’s Disease
  • What is the Difference Between Vacuum Pump and Compressor
  • What is the Difference Between Soil and Clay
  • Home
  • Vacancies
  • About
  • Request Article
  • Contact Us

Copyright © 2010-2018Difference Between. All rights reserved.Terms of Useand Privacy Policy:Legal.