home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a524 / 37.ddi / demo / demo3.sql < prev    next >
Encoding:
Text File  |  1991-03-04  |  1.5 KB  |  61 lines

  1. rem
  2. rem $Header: demo3.sql,v 6.1 90/02/16 18:40:04 nsalah Exp $ demo3.sql Copyr (c) 1989 Oracle
  3. rem
  4. rem V6PLS10030,DISK$DEV2:[PLS1FREEZE.DEMO.10030]
  5. /*        SCRIPT: DEMO3                                         */
  6. /* Shows how PL/SQL is tightly bound to the data dictionary.  This    */
  7. /* procedure uses %TYPE to guarantee that variable definitions will   */
  8. /* match specified column definitions.  If the definition of the      */
  9. /* specified column changes, the variable definition will auto-       */
  10. /* matically change accordingly.                                      */
  11.  
  12. set termout off
  13. START load_inv
  14. delete from temp;
  15. commit;
  16. set termout on
  17.  
  18. prompt >>>>>  Here's our inventory table once again:
  19. prompt >>>>>  (Note: The length of the PRODUCT column is 15.)
  20. select * from inventory_table;
  21.  
  22. prompt >>>>>  Hit return to load our PL/SQL procedure to get the name of
  23. prompt >>>>>  part number 2741:
  24. pause
  25.  
  26. GET demo3_pls
  27. .
  28. prompt
  29. prompt >>>>>  Hit return to run this, and then look at the TEMP table...
  30. pause
  31.  
  32. START demo3_pls
  33. /
  34. select message from temp;
  35.  
  36. prompt >>>>>  Hit return to alter the inventory table (change the definition
  37. prompt >>>>>  of the PRODUCT column from CHAR(15) to CHAR(35) , and give 
  38. prompt >>>>>  product 2741 a more descriptive name)...
  39. pause
  40.  
  41. GET alter
  42. .
  43. START alter
  44. /
  45.  
  46. GET longname
  47. .
  48. START longname
  49. /
  50.  
  51. select * from inventory_table;
  52.  
  53. prompt >>>>>  Hit return to run our PL/SQL procedure again, and note that it
  54. prompt >>>>>  will automatically get the FULL name of product 2741...
  55. pause
  56.  
  57. START demo3_pls
  58. /
  59.  
  60. select message from temp;
  61.