Operating System

Published on December 2016 | Categories: Documents | Downloads: 26 | Comments: 0 | Views: 206
of x
Download PDF   Embed   Report

While SQL is powerful, and SQL*Plus (Oracle’s proprietary SQL interface)includes commands and built-in functions not found in the ANSI standard, SQLremains more of a method of access to the database than a programming language.PL/SQL takes over where SQL leaves off by adding the features mentioned hereand more.NOTEDo not worry if you do not know what all of theprogramming features mentioned here are! That iswhat this book is for. They are explained in detailin later chapters.Virtually all SQL capabilities are possible with PL/SQL. In fact, as of Oracle 9iR1,the PL/SQL parser is the same as the SQL parser, ensuring that commands are treatedthe same regardless of where they are executed. Prior to Oracle 9iR1, you would findsome cases where a SQL statement was treated completely differently. Not so anymore.Let’s take the query of the BOOKS and AUTHORS tables that we did earlier anduse it in a PL/SQL example.-- Available online as part of PlsqlBlock.sqlSET SERVEROUTPUT ONDECLAREv_title books.title%TYPE;v_first_name authors.first_name%TYPE;v_last_name authors.last_name%TYPE;CURSOR book_cur ISSELECT b.title, a.first_name, a.last_nameFROM authors a, books bWHERE a.id = b.author1;BEGIN

Comments

Content

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close