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

  1. rem
  2. rem $Header: bank_demo.sql,v 6.1 90/02/16 18:39:53 nsalah Exp $ bank_demo.sql Copyr (c) 1989 Oracle
  3. rem
  4. rem V6PLS10030,DISK$DEV2:[PLS1FREEZE.DEMO.10030]
  5. /* Shows how PL/SQL can run from within 3GLs such as C.  It shows how */
  6. /* PL/SQL can read and write from the C variables.                    */
  7.  
  8. set termout off
  9. START load_acct
  10. commit;
  11. set termout on
  12.  
  13. prompt >>>>>  Here are the accounts and balances in our ACCOUNTS table:
  14. select * from accounts;
  15.  
  16. prompt >>>>>  Here's the JOURNAL table that shows what transactions have
  17. prompt >>>>>  taken place.  It is currently empty:
  18. select * from journal;
  19.  
  20. prompt >>>>>  Now let's run a C program that has a PL/SQL procedure
  21. prompt >>>>>  embedded within it.  Look at the text of the original program
  22. prompt >>>>>  (BANK_DEMO.PC), and then run the BANK_DEMO program.
  23. prompt >>>>>  (Note how PL/SQL can read and set the values of the C variables.)
  24. prompt
  25. prompt >>>>>  When done, return to SQL*Plus by typing the exit command
  26. prompt >>>>>  at the operating system prompt.
  27. prompt >>>>>  Hit return to continue...
  28. pause
  29.  
  30. host
  31.  
  32. prompt >>>>>  Hit return to see the effects of your changes on the ACCOUNTS
  33. prompt >>>>>  table...
  34. pause
  35. select * from accounts;
  36.  
  37. prompt >>>>>  Hit return to see the changes logged in the JOURNAL table...
  38. pause
  39. select * from journal;
  40.