STORED PROCEDURES IN PL/SQL

Posted by Anonymous 0 komentar
Download free Stored Procedures in PL/SQL.pdf Many modern databases support a more procedural approach to databases—they allow you to write procedural code to work with data. Usually, it takes the form of SQL interweaved with the more familiar IF statements, etc. Note that this has nothing to do with accessing the database. You can access any database from virtually any language. What we’re talking about is the code that is executed by the database server. While there are many various ‘database’ languages, we will only talk about the primary two: T-SQL, which is supported by SQL Server and Sybase, and PL/SQL, which is supported by Oracle. Many other languages may be supported. For example, Oracle allows you to write stored procedures and triggers in Java, etc.

Besides plain vanilla SQL, Oracle supports PL/SQL. The PL stands for Procedural Language, which means you can have things like IF statements, loops, variables, and other procedural things along with declarative SQL statements. PL/SQL.

Just as most procedural languages, PL/SQL has some sort of variables. The types of variables are plain SQL column types that you’re all used to. You can also refer to a type of a particular column explicitly by specifying the fully qualified column name (tablename.columname) followed by %TYPE. For example: PRODUCT.PRICE%TYPE. Similarly, we can refer to a particular row as a single type. Again, you declare it by referring to a database table directly: PRODUCT%ROWTYPE. This would refer to a single record stored in the PRODUCT table. Along with the above mentioned, some common types are: BOOLEAN, DATE, NUMBER, CHAR, and VARCHAR2.

here

0 komentar:

Post a Comment