AutoSys                                                         1
Unicenter AutoSys JM Commands                              xql(8)
     xql - Provides access to the Sybase database
     xql -U username -P password -S data_server  -D  database  -C
     "command"|-f    input_file    [-d    delimiter]   [-h]   [-T
     timeout_interval] [-w column_width] [-x] [-?]
     A  Unicenter  AutoSys  Job  Management  (JM)  utility   that
     accesses  the Sybase dataserver from any properly configured
     client. xql can be used in  interactive  mode  to  interface
     with  the dataserver (like isql), as a command issued at the
     UNIX command line, or in a shell script (batch mode) to send
     requests to the server and output results.
     batch mode
     To execute xql in batch mode and send  results  to  standard
     output,  specify  either  the  -C  or -f option, or redirect
     standard input into xql. The -C option reads SQL input  from
     the command argument. The -f option reads SQL input from the
     file specified in input_file.  Batch  mode  is  particularly
     useful for embedding SQL statements inside of shell scripts.
     (An example script  is  given  below.)  When  using  the  -C
     option,  you  must  enter  "go"  to  mark the end of the SQL
     interactive mode
     To execute xql interactively, omit the -C  and  -f  options.
     The xql prompt looks similar to the following:
     The second token in the prompt (AUTOSYSDB in  this  example)
     displays  the  name of the data_server to which you are con-
     nected. The third token is the name of the database that you
     are  currently  in. At the xql prompt, enter commands in the
     form of Transact SQLSybases extended SQL language.  The  SQL
     can  extend across multiple lines. To execute the SQL, enter
     go on a new line. For example:
     1> select * from ujo_alamode 2> go
     Help is available in interactive mode by typing help at  the
     xql command prompt.
     There is a history feature which allows you to  re-use  past
     commands  stored  in  the  buffer. Also, an editing feature,
     which uses emacs or vi, is  available  to  edit  the  buffer
     before sending it to the server.
     To exit xql, enter exit  at  the  prompt  and  press  either
     <Return> or <Control+C>.
     xql is provided only for use with the Sybase  database.  Use
     zql to interact with the Oracle database.
     -U username
          The name of the Sybase user to log in as,  and  can  be
          any  valid  Sybase  user. This is typically autosys for
          the AutoSys user, or sa for the system administrator.
     -P password
          The Sybase password for the specified username.
     -S data_server
          The name of the Sybase data server to be accessed.  The
          default  value  is  taken from the environment variable
          $DSQUERY. If no server is specified and $DSQUERY is not
          defined, xql terminates.
     -D database
          The Sybase database to be accessed. The value is  taken
          from  the  $DSDB environment variable if no database is
          specified, If $DSDB is not defined, the  default  data-
          base  for  the  identified  user is taken from the user
          table in the master database. For the user sa, this  is
          typically master; for autosys, it is normally autosys.
     -C "command"
          An SQL statement to be passed to Sybase and executed in
          batch,  rather than interactive mode. The SQL statement
          must be wrapped in double  quotes.  Multiple  lines  of
          input,  as  well  as  multiple  Sybase commands, can be
          entered in a single call. (See the examples below.) You
          must enter go to mark the end of the SQL statement. xql
          sends the command to  the  dataserver,  and  sends  the
          results to standard output. This option is particularly
          useful for embedding SQL commands in shell scripts.
          SQL is not addressed in detail in  this  guide,  please
          see the Sybase SQL Users Guide for syntax details.
     -f input_file
          A text file containing SQL statements to be  passed  to
          Sybase,  to  be executed in batch, rather than interac-
          tive mode. xql sends  this  file  of  commands  to  the
          dataserver, and sends the results to standard output.
     -d delimiter
          The delimiter to be used for output, which  is  written
          to  standard  output. The default delimiter is the pipe
          symbol (|), which is placed between all output  fields.
          This  option is useful for creating a flat file of data
          that uses delimiters for processing at  a  later  time.
          The  delimiter  is  specified as a single character. Be
          sure not to use a character that your shell could  mis-
          takenly interpret, especially the asterisk symbol (*).
     -T timeout_interval
          Specifies a period of time, in seconds, after which xql
          terminates the session if no activity has occurred. Any
          number of seconds may be specified. To specify that xql
          should  never  terminate  the  session,  specify 0. The
          default is 60 seconds.
     -h   Indicates that  the  output  will  not  contain  header
     -w column_width
          Specifies the width of the columns to  display  in  the
     -x   Displays the xql version information.
     -?   Displays the xql usage statement.
     The following examples assume that the  Sybase  account  and
     password  are myauto and autopswd respectively. The examples
     also assume that the dataserver defaults to  AUTOSYSDB,  and
     the database defaults to autosys.
     To select the job ID and  job  name  (the  field  names  are
     assigned  by  AutoSys)  from  the  job  table in the default
     dataserver and database, enter the following:
          xql -Umyauto -Pautopswd
     Then, at the xql prompt, enter:
          1> select joid,
          2> job_name
          3> from job
          4> go
     Assuming that there are only three jobs, the output is:
          joid job_name
     To exit the interactive session, enter:
           1> exit
     To obtain the same information in batch mode  by  specifying
     the SQL statement at the command line, enter:
          xql -Umyauto -Pautopswd -C "select joid, job_name from job"
     The output, with the default delimiter, appears as follows:
     For further technical assistance with this command,  contact
     Technical  Support  at  <http://supportconnect.ca.com> for a
     complete list of locations and phone numbers. Technical sup-
     port is available 24 hours a day, 7 days a week.
     Copyright (c) 2006 CA. All rights reserved.
     archive_events(8), as_info(8), as_safetool(8), as_server(8),
     auto_svcdesk(8),  autoaggr(8),  autodwp(8),  autocal_asc(8),
     autoflags(8),  autorep(8),  autosec_test(8),  autostatad(8),
     autostatus(8), autosys(8), autosyslog(8), autosys_secure(8),
     autotimezone(8),  autotrack(8),  chase(8),   chk_auto_up(8),
     clean_files(8),  cron2jil(8),  DBMaint(8),  dbstatistics(8),
     eventor(8),   get_auto_event(8),   jil(8),    job_delete(8),
     job_depends(8), monbro(8), sendevent(8), time0(8), zql(8)
(:Rating1: 70:) (:nl:)(:notopmenu:) (:nofootmenu:)

(:rater name="this page" :)Autosys.ManXql

(:Rating1: 100:)