Monday, December 26, 2011

Mini User’s Guide for SQL*Plus Oracle SQL*Plus Programming Examples


EECS 484 10/3/2005 1 Mini User’s Guide for SQL*Plus T. J. Teorey Table of Contents Oracle/logging-in 1 Nested subqueries 5 SQL create table/naming rules 2 Complex functions 6 Update commands 3 Save a query/perm table 6 Select commands 3 Special commands 6 Set operations 4 SQL views 9 Built-in functions 4 Index 10 Oracle Oracle 8.1.6 resides on a Sun Sparc10 node. However, you do not need to login directly to this machine, but think of it as a database server to be accessed from another machine, for example, canoe.engin.umich.edu. Logging in to UNIX and Oracle SQL*Plus login: password: your-unix-node% source /usr/caen/oracle/local/muscle your-unix-node% sqlplus Enter user-name: Enter password: /*You are now in SQL*Plus and can start issuing SQL*Plus commands*/ SQL> select * from employee; /*example of an sqlplus command*/ SQL> grant connect to your-oracle-id identified by your-new-password; /*change password*/ Input and Output Files for Oracle To save the transcript of an sqlplus session or part of a session: SQL> set echo on; /*displays SQL code with results of the query*/ SQL> spool ; /*filename will be appended with .1st if a postfix is not provided*/ SQL> spool off; /*will turn off the transcript spooling. You can now print the file with the instructions provided below*/ To read in a file: SQL> start ; or SQL> @; where filename must be a OpSys file ending with .sql (the .sql may or may not be supplied to Oracle, but must be part of the name of the file). Print Oracle Results To print on a Sun or IBM the users can say: lpr -P printer_names (2340eecss2,2341eecsh1,4327eecss1,4327eecss2,4440eecss1,4440eecsm1) HP: lp -d Access from any…


Website: www.eecs.umich.edu | Filesize: 29kb
No of Page(s): 11
Download Mini User’s Guide for SQL*Plus Oracle SQL*Plus Programming Examples.pdf