Introduction: PL/SQL and T-SQL are completely different programming languages and have different variable declarations, different syntax, built-in functions, and different programming capabilities. The only thing in common is that they are extensions of SQL and execution and storage within the database. PL/SQL is a procedural language used for Oracle relational database while T-SQL is a proprietary procedural language used for Microsoft SQL Server and Sybase .PL/SQL:PL/SQL stands for Procedure Language extension of SQL.PL/SQL is an extension of SQL originally developed by IBM for operations on relational databases. PL/SQL is a structured language that is used to manipulate data with the help of commands like SELECT, INSERT, CREATE AND GRANT. Much of the PL/SQL syntax is borrowed from Ada. Data Types: Numeric types store numeric data such as integers, floating points, real numbers, and represent quantities for performing calculations. The BINARY_INTEGER data type is identical to PLS_INTEGER. BINARY_INTEGER subtypes can be thought of as PLS_INTEGER subtypes BINARY_INTEGER Subtypes A base type is the data type from which a subtype is derived. A subtype associates a base type with a constraint and then defines a subset of valuesBINARY_FLOAT and BINARY_DOUBLE Data types are basically used for high-speed scientific computations. Calculations that involve special values that must be checked, rather than raising exceptions.PL/SQL handles transaction checking, temporary objects, system extended and stored procedures, conditional processing, exception and error handling, and other SQL features.Example 1:BEGINIF TO_CHAR ( SYSDATE, 'DAY') = 'MONDAY'THENHave a coffee at Starbucks;ELSEHave breakfast at college;AND...... middle of paper......n T-SQL is the IDENTY function.2. In PL/SQL, stored procedures are ATOMIC. If an error occurs within the stored procedures, it rolls back to the beginning. While in T-SQL you need to use TRY CATCH block as the stored procedure does not rollback automatically. Reference: • PL/SQL data types. (n.d.). PL/SQL data types. Retrieved April 1, 2014, from http://docs.oracle.com/cd/B19306_01/appd• http://en.wikipedia.org/wiki/PL/SQL• PL/SQL Tutorial. (n.d.). - PL/SQL programming made easy. Retrieved April 1, 2014, from http://plsql-tutorial.com/• PL/SQL. (n.d.). Oracle. Retrieved April 1, 2014, from http://www.oracle.com/technetwork/datab• T-SQL. (n.d.). What is it?. Retrieved April 1, 2014, from http://www.webopedia.com/TERM/T/T_SQL.• http://en.wikipedia.org/wiki/Transact-SQL.• http://www.tsql.info / • http://www.varindersandhu.in/2012/02/17/t-sql-vs-pl-sql/
tags