home *** CD-ROM | disk | FTP | other *** search
- rem
- rem $Header: demo3.sql,v 6.1 90/02/16 18:40:04 nsalah Exp $ demo3.sql Copyr (c) 1989 Oracle
- rem
- rem V6PLS10030,DISK$DEV2:[PLS1FREEZE.DEMO.10030]
- /* SCRIPT: DEMO3 */
- /* Shows how PL/SQL is tightly bound to the data dictionary. This */
- /* procedure uses %TYPE to guarantee that variable definitions will */
- /* match specified column definitions. If the definition of the */
- /* specified column changes, the variable definition will auto- */
- /* matically change accordingly. */
-
- set termout off
- START load_inv
- delete from temp;
- commit;
- set termout on
-
- prompt >>>>> Here's our inventory table once again:
- prompt >>>>> (Note: The length of the PRODUCT column is 15.)
- select * from inventory_table;
-
- prompt >>>>> Hit return to load our PL/SQL procedure to get the name of
- prompt >>>>> part number 2741:
- pause
-
- GET demo3_pls
- .
- prompt
- prompt >>>>> Hit return to run this, and then look at the TEMP table...
- pause
-
- START demo3_pls
- /
- select message from temp;
-
- prompt >>>>> Hit return to alter the inventory table (change the definition
- prompt >>>>> of the PRODUCT column from CHAR(15) to CHAR(35) , and give
- prompt >>>>> product 2741 a more descriptive name)...
- pause
-
- GET alter
- .
- START alter
- /
-
- GET longname
- .
- START longname
- /
-
- select * from inventory_table;
-
- prompt >>>>> Hit return to run our PL/SQL procedure again, and note that it
- prompt >>>>> will automatically get the FULL name of product 2741...
- pause
-
- START demo3_pls
- /
-
- select message from temp;
-