Embed
Email

PLSQL basics

Document Sample
PLSQL basics
Shared by: HC111214205458
Categories
Tags
Stats
views:
13
posted:
12/14/2011
language:
pages:
2
Darko Petrovic – PL/SQL Homework 1 solution







Homework Week #1

PL/SQL Virtual Training

1. Circle the programming language meeting the criteria



3GL PL/SQL SQL

4GL PL/SQL SQL

Is proprietary to Oracle Corporation PL/SQL SQL

Nonprocedural PL/SQL SQL

Procedural PL/SQL SQL

Is ANSI-compliant PL/SQL SQL



2. In your own words, describe why a procedural language like PL/SQL is needed.



PL/SQL is needed to solve limitations of SQL.



3.Complete the following chart defining the syntactical requirements for a PL/SQL block:



Optional or Mandatory? What is included in this section?



DECLARE – Optional – Various declarations

BEGIN - Mandatory – SQL and PL/SQL statements

EXCEPTION - Optional – Behavior on errors

END; - Mandatory – end of program



4. Which of the following PL/SQL blocks execute successfully? For the blocks that fail, explain

why they fail



A. BEGIN END;



B. DECLARE amount INTEGER(10); END;



C. DECLARE BEGIN END;



D. DECLARE amount NUMBER(10); BEGIN DBMS_OUTPUT.PUT_LINE(amount); END;

Darko Petrovic – PL/SQL Homework 1 solution





5. In Application Express:



A. Create and execute a simple anonymous block that outputs your name.



BEGIN

DBMS_OUTPUT.PUT_LINE ('Darko Petrovic');

END;









B. Create and execute a simple anonymous block that does the following:



• Declares a variable of datatype DATE and populates it with the date that is six months from

today



DECLARE

v_date DATE := ADD_MONTHS(sysdate, 6);

BEGIN

DBMS_OUTPUT.PUT_LINE(v_date);

END;



• Outputs “In six months, the date will be: .”



DECLARE

v_date DATE := ADD_MONTHS(sysdate, 6);

BEGIN

DBMS_OUTPUT.PUT_LINE('In six months, the date will be:' );

DBMS_OUTPUT.PUT_LINE(v_date);

END;


Related docs
Other docs by HC111214205458
INTER SWISS
Views: 4  |  Downloads: 0
FUMIGACIONES D�ANGELI
Views: 1  |  Downloads: 0
Building Block Implementation
Views: 2  |  Downloads: 0
PowerPoint Presentation - Diapositiva 1
Views: 1  |  Downloads: 0
Application
Views: 0  |  Downloads: 0
Formulario 1
Views: 2  |  Downloads: 0
REP�BLICA DE COLOMBIA
Views: 0  |  Downloads: 0
Las causas del desempleo
Views: 5  |  Downloads: 0
91030 Apply measurement in solving problems
Views: 0  |  Downloads: 0
By registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!