home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1990 / 03 / ssql / env.shr < prev    next >
Encoding:
Text File  |  1989-01-02  |  2.6 KB  |  62 lines

  1.          THE SSQL USER ENVIRONMENT
  2.  
  3.          EDIT - USING YOUR OWN TEXT EDITOR / WORD PROCESSOR
  4.  
  5.          Since it is difficult to learn a new environment with every new 
  6.          program, you can specify your very own text editor or word 
  7.          processor in a file called EDIT.FIL which is in the same 
  8.          directory as SSQL.  The current content of EDIT.FIL is:
  9.          C:\PCWRITE\ED
  10.          This means that the word processor chosen is PC-Write which is in 
  11.          the PCWRITE directory on drive C and the command used to invoke 
  12.          PC-WRITE is ED.  You can replace the above line with the path and 
  13.          program name of your word processor.   The word processor must 
  14.          be capable of producing a simple text file as described below 
  15.          under CALL SCRIPT FILE. From within SSQL, you can type SQL 
  16.          commands from the SSQL prompt.  If you want to revise the 
  17.          previous prompt, you can type: 
  18.          edit <ENTER> 
  19.          and the previous SQL statement will be loaded into you word 
  20.          processor with the file name of RUN.  This assumes that the 
  21.          file name can follow the command for your text editor.  When 
  22.          you exit your word processor the revised statement is in the 
  23.          file RUN.  To call the file type: 
  24.          @run <ENTER> 
  25.          This is what is typically known as a script file.  More details 
  26.          below. 
  27.          
  28.          @ - CALL SCRIPT FILE
  29.  
  30.          Now you have the ability to create a text file with a SQL 
  31.          command and call the text file from SSQL by preceeding the file 
  32.          name with a "@".  The file must be text only, no special 
  33.          wordprocessing formats allowed.  PC-Write is an excellent 
  34.          choice because it is always produces standard text.  If you use 
  35.          WordPerfect, save the file using Text Out (Ctrl-F5).  If you 
  36.          use Wordstar, I feel sorry for you but anyway, use the non-
  37.          document form. 
  38.  
  39.          Now you can create a file called MGRORG which contains:
  40.  
  41.          select name
  42.          from emp
  43.          where enum in
  44.            (select mgrn
  45.             from emp
  46.             where enum in
  47.               (select sn
  48.                from sales,cust
  49.                where cc = code
  50.                  and name = 'Organomice'));
  51.  
  52.          From SSQL, you would simply type:
  53.          @MGRORG
  54.          The file you created would be displayed on the screen and then 
  55.          the result would appear.
  56.  
  57.          By the way, the above select statement answers one of the 
  58.          questions in the appendix.
  59.  
  60.                                ENV-1
  61.  
  62.