home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / usr / sybase / doc / isql.man < prev    next >
Encoding:
Text File  |  1993-04-22  |  9.5 KB  |  265 lines

  1.  
  2.   1                       Version 4.0 -- 1/15/89                    isql
  3.   ______________________________________________________________________
  4.  
  5.   NAME:  isql
  6.  
  7.   FUNCTION:
  8.        Interactive SQL parser to SQL Server.
  9.  
  10.   SYNTAX:
  11.        isql [-e] [-p] [-i] [-n]
  12.        [ -c cmdend] [ -h headers] [ -w columnwidth] [ -s colseparator]
  13.        [ -t timeout] [ -m errorlevel]
  14.        [ -H hostname] [ -U username] [ -P password]
  15.        [ -I interface] [-S server]
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.   isql                    Version 4.0 -- 1/15/89                       2
  25.   ______________________________________________________________________
  26.        To terminate a command: go
  27.  
  28.        To clear the query buffer: reset
  29.  
  30.        To call the editor: vi
  31.  
  32.        To execute an operating system command: !! command
  33.  
  34.        To exit from  isql: quit or exit
  35.  
  36.   PARAMETERS:
  37.        -e -  echoes input.
  38.        -p -  prints out performance statistics.
  39.        -i -  tags all isql input and output with the process ID  number.
  40.            It can be used for tracing multi-user tests.
  41.        -n -  removes numbering and the  prompt  symbol  (>)  from  input
  42.            lines.
  43.  
  44.  
  45.  
  46.   3                       Version 4.0 -- 1/15/89                    isql
  47.   ______________________________________________________________________
  48.        -c cmdend -  allows the user to reset the command terminator.  By
  49.            default,  commands  are  terminated and sent to SQL Server by
  50.            entering go on a line by itself.  When you reset the  command
  51.            terminator,  do not use SQL reserved words or characters that
  52.            have special meaning to the operating  system,  whether  pre-
  53.            ceded by a backslash or not.
  54.        -h headers -  allows the user to specify how many rows  to  print
  55.            between  column  headings.   The default is to print headings
  56.            only once for each set of query results.
  57.        -w columnwidth -  allows the user to set  the  screen  width  for
  58.            output.   The  default is 80 characters.  When an output line
  59.            has reached its maximum screen width, it is broken into  mul-
  60.            tiple lines.
  61.        -s colseparator -  allows the user to reset the column  separator
  62.            character, which is blank by default.  To use characters that
  63.            have special meaning to the operating system (e.g., |, ;,  &,
  64.            <,  >),  enclose  them  in  quotes  or  precede  them  with a
  65.  
  66.  
  67.  
  68.   isql                    Version 4.0 -- 1/15/89                       4
  69.   ______________________________________________________________________
  70.            backslash, \.
  71.        -t timeout -  allows the user to specify the  number  of  seconds
  72.            before  a  command  times out.  If no timeout is specified, a
  73.            command runs indefinitely; however, the default  timeout  for
  74.            logging in to isql is 60 seconds.
  75.        -m errorlevel -  allows the user to customize  display  of  error
  76.            messages.   For  errors  of  the  severity level specified or
  77.            higher, no error text  is  displayed.   The  message  number,
  78.            state,  and  error level are displayed.  For errors of levels
  79.            lower than the specified level, nothing is displayed.
  80.        -H hostname -  allows the user to specify a host  name,  changing
  81.            the  value in the dynamic system table sysprocesses, if he or
  82.            she logs in from a different computer than usual.  If no host
  83.            name is specified, the current computer name is assumed.
  84.        -U username -  allows the user to specify a login  name.   Logins
  85.            are case sensitive.
  86.        -P password -  allows the user to specify a password.  If the  -P
  87.  
  88.  
  89.  
  90.   5                       Version 4.0 -- 1/15/89                    isql
  91.   ______________________________________________________________________
  92.            flag is not given, isql prompts for a password.   If  the  -P
  93.            flag  is  given  at  the  end of the command line without any
  94.            password, isql uses the default password  (NULL).   Passwords
  95.            are case sensitive.
  96.        -I interface -  allows the user to specify the name and  location
  97.            of  the interfaces file that is (optionally) searched as part
  98.            of the process of connecting to SQL Server.  The  named  file
  99.            contains  the  name  and  network  address of every available
  100.            SQL Server on the network.  If this option is not used,  isql
  101.            looks for a file named interfaces.
  102.        -S server -  allows the user to specify the name of the  particu-
  103.            lar  SQL Server with which to connect.  This is the name that
  104.            SQL Server looks up in the interfaces file.
  105.  
  106.   EXAMPLES:
  107.        1) isql -p -s#
  108.  
  109.  
  110.  
  111.  
  112.   isql                    Version 4.0 -- 1/15/89                       6
  113.   ______________________________________________________________________
  114.        2) isql -Ujoe
  115.  
  116.           Password:
  117.  
  118.           1>select *
  119.           2>from authors
  120.           3>where city = "Oakland"
  121.           4>go
  122.  
  123.           Executes the command.
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.   7                       Version 4.0 -- 1/15/89                    isql
  135.   ______________________________________________________________________
  136.        3) isql -Ujoe -Pabracadabra
  137.  
  138.           1>select *
  139.           2>from authors
  140.           3>where city = "Oakland"
  141.           4>vi
  142.  
  143.           Puts you in a text file where you can edit  the  query.   When
  144.           you  write  and  save the file, you are returned to isql.  The
  145.           query is displayed.  Type go to execute it.
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.   isql                    Version 4.0 -- 1/15/89                       8
  157.   ______________________________________________________________________
  158.  
  159.        4) isql -U alma -P
  160.  
  161.           1>select *
  162.           2>from authors
  163.           3>where city = "Oakland"
  164.           4>reset
  165.           1>quit
  166.  
  167.           The reset clears the query buffer.  The quit  keyword  returns
  168.           you to the operating system.
  169.  
  170.   COMMENTS:
  171.  
  172.        o The isql program is invoked directly from the operating system.
  173.          The  isql  program  accepts  SQL  commands  and  sends  them to
  174.          SQL Server.  The results are formatted and printed on  standard
  175.          output.  The isql program exits with quit or exit.
  176.  
  177.  
  178.   9                       Version 4.0 -- 1/15/89                    isql
  179.   ______________________________________________________________________
  180.  
  181.        o Terminate a command by typing a line beginning with the command
  182.          terminator.   The  default  command  terminator is go.  You may
  183.          follow the command terminator with an integer  to  specify  how
  184.          many  times  the  command should be run.  For example, to cause
  185.          this command to be executed 100 times, type:
  186.  
  187.            select x = 1
  188.            go 100
  189.  
  190.          The results are displayed once, at the end of execution.
  191.        o The user may call an editor on  the  current  query  buffer  by
  192.          entering  ``vi''  as  the  first word on a line.  The editor is
  193.          defined in the EDITOR environment  variable.   The  default  is
  194.          ``vi''.
  195.  
  196.        o Operating system commands may also be executed  by  starting  a
  197.          line with two ``!'' followed by the command.
  198.  
  199.  
  200.   isql                    Version 4.0 -- 1/15/89                      10
  201.   ______________________________________________________________________
  202.  
  203.        o The existing query buffer can be cleared by typing reset as the
  204.          first  thing  on  a  line by itself.  It will cause any pending
  205.          input to be discarded.
  206.        o The command terminator (go by default), and  commands  such  as
  207.          reset, vi, !!, exit and quit are recognized only if they appear
  208.          at the very beginning of a line, immediately following the isql
  209.          prompt.   Anything entered on that line after these keywords is
  210.          disregarded by isql.
  211.  
  212.        o Control-C performs a reset, but can be entered  anywhere  on  a
  213.          line.   The  effect  is to cancel the current query, and return
  214.          the user to ``1>''.
  215.        o To use isql interactively, give the command isql  (and  any  of
  216.          the optional flags) at your operating system prompt.
  217.  
  218.        o You can read in a host file containing a query for execution by
  219.          isql like this:
  220.  
  221.  
  222.   11                      Version 4.0 -- 1/15/89                    isql
  223.   ______________________________________________________________________
  224.          isql -U alma -P < input_file_name
  225.  
  226.          The file must include command terminator(s).  The  results  are
  227.          displayed on the user's terminal.
  228.  
  229.          You can read in an operating system file containing a query and
  230.          direct the results to another file, like this:
  231.  
  232.             isql -U alma -P < input_file_name > output_file-name
  233.  
  234.        o When using isql interactively, you can read a  host  file  into
  235.          the  command buffer with :r filename.  Do not include a command
  236.          terminator in the file; enter the terminator interactively once
  237.          you have finished editing.
  238.        o You can include comments in a Transact-SQL statement  submitted
  239.          to  SQL Server  by isql.  Open a comment with ``/*''.  Close it
  240.          with ``*/''.  Comments can be nested.
  241.  
  242.  
  243.  
  244.   isql                    Version 4.0 -- 1/15/89                      12
  245.   ______________________________________________________________________
  246.          For example:
  247.  
  248.             select au_lname, au_fname
  249.             /*retrieve authors' last and first names*/
  250.             from authors, titles, titleauthor
  251.             where authors.au_id = titleauthor.au_id
  252.             and titles.title_id = titleauthor.title_id
  253.             /*this is a three-way join that links authors
  254.             **to the books they have written.*/
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.