SQL PL: Difference between revisions

Content deleted Content added
mNo edit summary
mNo edit summary
Line 4:
}}
 
'''SQL PL''' stands for [[SQL|Structured Query Language]] Procedural Language and was developed by IBM as a set of commands that extend the use of SQL in the [[IBM DB2]] (DB2 UDB Version 7) database system.<ref>[http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.apdv.sql.doc/doc/c0011916.htm IBM Info Center]</ref> It provides [[procedural programming|procedural programmability]] in addition to the querying commands of SQL. It is a subset of the SQL Persistent Stored Modules ([[SQL/PSM]]) language standard. PL/SQL includes procedural language elements such as conditions and loops. It allows declaration of constants and variables, procedures and functions, types and variables of those types, and triggers. It can handle exceptions (runtime errors). Arrays are supported involving the use of PL/SQL collections. One can create PL/SQL units such as procedures, functions, packages, types, and triggers, which are stored in the database for reuse by applications that use any of the Oracle Database programmatic interfaces.<ref>{{Cite journal|title=PL/SQL|url=https://en.wikipedia.org/w/index.php?title=PL/SQL&oldid=708618436|journal=Wikipedia, the free encyclopedia|language=en}}</ref>
 
===== IBM DB2 =====
Line 10:
 
===== Raima RDM 14.0 =====
The RDM SQL Programming Language (SQL PL) is based on the ANSI/ISO SQL Persistent Stored Modules (PSM) specification (ISO/IEC 90756-4:2008). It provides a high-level language in which stored procedures and functions can be easily written, compiled and called within the RDM SQL system. In earlier versions of RDM SQL, except for a rudimentary stored procedure capability, all such programming needed to be done through a standard programming language API such as either the native RDM SQL API or ODBC for C/C++ or JDBC for Java programs.<ref>{{Cite web|url=http://docswww.raima.com/rdme/14_0/#SQLPL/SQLPL-Intro.htm|title=Raima Technical Whitepaper (RDM 14.0)Homepage|last=|first=|date=|website=|publisher=|access-date=}}</ref>
 
== Similar Languages ==
PL/SQL works analogously to the embedded procedural languages associated with other relational databases. For example, Sybase ASE and Microsoft SQL Server have Transact-SQL, PostgreSQL has PL/pgSQL (which emulates PL/SQL to an extent), and IBM DB2includes SQL Procedural Language,<sup>[2]</sup> which conforms to the ISO SQL’s SQL/PSM standard.
 
The designers of PL/SQL modeled its syntax on that of Ada. Both Ada and PL/SQL have Pascal as a common ancestor, and so PL/SQL also resembles Pascal in several aspects. However, the structure of a PL/SQL package does not resemble the basic Object Pascalprogram structure as implemented by a Borland Delphi or Free Pascal unit. Programmers can define public and private global data-types, constants and static variables in a PL/SQL package.<sup>[3]</sup>
 
PL/SQL also allows for the definition of classes and instantiating these as objects in PL/SQL code. This resembles usage in object-oriented programming languages like Object Pascal, C++ and Java. PL/SQL refers to a class as an "Abstract Data Type" (ADT) or "User Defined Type" (UDT), and defines it as an Oracle SQL data-type as opposed to a PL/SQL user-defined type, allowing its use in both the Oracle SQL Engine and the Oracle PL/SQL engine. The constructor and methods of an Abstract Data Type are written in PL/SQL. The resulting Abstract Data Type can operate as an object class in PL/SQL. Such objects can also persist as column values in Oracle database tables.
 
PL/SQL is fundamentally distinct from Transact-SQL, despite superficial similarities. Porting code from one to the other usually involves non-trivial work, not only due to the differences in the feature sets of the two languages,<sup>[4]</sup> but also due to the very significant differences in the way Oracle and SQL Server deal with concurrency and locking. There are software tools available that claim to facilitate porting including Oracle Translation Scratch Editor,<sup>[5]</sup> CEITON MSSQL/Oracle Compiler <sup>[6]</sup> and SwisSQL.<sup>[7]</sup>
 
The StepSqlite product is a PL/SQL compiler for the popular small database SQLite.
 
==References==
Line 17 ⟶ 28:
== External links ==
*[http://www.sqlpl-guide.com SQL PL Guide for developing Stored Procedures in DB2]
*[http://docs.raima.com/rdme/14_0/#SQLPL/SQLPL-Intro.htm Raima Technical Documentation]
 
== Software in SQL-PL ==