The overview for PL/SQL

http://www-db.stanford.edu/~ullman/fcdb/oracle/or-plsql.html

Using Oracle PL/SQL
  • Variables and Types
  • Sample PL/SQL Programs
  • Control Flow in PL/SQL
  • Cursor
  • Procedures
  • Discovering Errors
  • Printing variables
  • Note:Materials here did not include informations about trigger.


    Basic Structure of PL/SQL :
    PL/SQL stands for procedural language/SQL,PL/SQL extends SQL by adding constructs found in procedural languages,Resulting in a structural languages that more powerful than SQL.The basic unit in PL/SQL is block.All PL/SQL programs make up of blocks,which can be nested within each other.Typically, each block performs a logical action in her programs. A block has the following structure:

    Declare
    --Declarative section: variables,types,and local subprograms,
    Begin
    --Executable section:Procedural and SQL statements go here.
    --This is the only section that is requried.
    Excetption
    --Exception handling section:error handling statement go here.
    End;

    Only the executable section is requried, the other sections are optional, The SQL satements allowed in PL/SQL are INSERT,SELECT,UPDATE,DELETE and other serveral data manipulation constructs plus some transcation control. Howover, The SELECT has a  special form in which a single tuple is placed in a variable;More on the later, Data definition statements like CREATE DROP,ALTER are not allowed, The executable section also contains constructs such as assignments, branches,loops,procedure calls,and trigger,wich are all described below (except trigger). PL/SQL  are not case sensitive. C# style comments(/**/) may be used.

    posted @ 2005-01-19 10:06  23热爱,自学业余码农。  阅读(305)  评论(0)    收藏  举报