| Start |
|---|
Hello World Command The |
| Definition of PLSQL PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database (since version 7), TimesTen in-memory database (since version 11.2.1), and IBM DB2 (since version 9.7). The basic unit in PL/SQL is called a block, which is made up of three parts: a declarative part, an executable part, and an exception-building part. Declarations - This section starts with the keyword DECLARE. It is an optional section and defines all variables, cursors, subprograms, and other elements to be used in the program. Executable Commands - This section is enclosed between the keywords BEGIN and END and it is a mandatory section. It consists of the executable PL/SQL statements of the program. It should have at least one executable line of code, which may be just a NULL command to indicate that nothing should be executed. Exception Handling - This section starts with the keyword EXCEPTION. This section is again optional and contains exception(s) that handle errors in the program. Every PL/SQL statement ends with a semicolon (????. PL/SQL blocks can be nested within other PL/SQL blocks using BEGIN and END. In anonymous block, only executable part of block is required, other parts are not nessesary. Below is example of simple anonymous code, which does not do anything but perform without error reporting. Missing excecutable instruction leads to an error, becouse PL/SQL does not support empty blocks. For example, excecution of code below leads to an error: Application will raise error: Symbol " * " in line below keyword "END;" means, that the block which ends with this block is empty or bad constructed. Every execution block needs instructions to do, even if it does nothing, like in our example. |
| Difference between %TYPE and %ROWTYPE.
%ROWTYPE: Used to declare a record with the same types as found in the specified table, view or cursor (= multiple columns). |
| About PLSQL PL/SQL stands for Procedural Language extensions to SQL. PL/SQL is available only as an "enabling technology" within other software products; it does not exist as a standalone language. You can use PL/SQL in the Oracle relational database, in the Oracle Server, and in client-side application development tools, such as Oracle Forms. Here are some of the ways you might use PL/SQL:
|
| Create or replace a view In this example we are going to create a view. Example 1: Example 2: To call this views in a query you can use a select statement. |
| Create a table Below we are going to create a table with 3 columns. RemarksThis section provides an overview of what plsql is, and why a developer might want to use it. It should also mention any large subjects within plsql, and link out to the related topics. Since the Documentation for plsql is new, you may need to create initial versions of those related topics. |
Read Article
https://develop.horje.com/learn/1434/reference