From commits-return-8014-archive-asf-public=cust-asf.ponee.io@trafodion.apache.org Tue Jul 3 23:13:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id C9D34180632 for ; Tue, 3 Jul 2018 23:13:02 +0200 (CEST) Received: (qmail 7022 invoked by uid 500); 3 Jul 2018 21:13:01 -0000 Mailing-List: contact commits-help@trafodion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: commits@trafodion.apache.org Delivered-To: mailing list commits@trafodion.apache.org Received: (qmail 5421 invoked by uid 99); 3 Jul 2018 21:13:00 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Jul 2018 21:13:00 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EB45CE10DF; Tue, 3 Jul 2018 21:12:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: dbirdsall@apache.org To: commits@trafodion.apache.org Date: Tue, 03 Jul 2018 21:13:43 -0000 Message-Id: In-Reply-To: <3411318e022b4ee38e6407eb51bf9c36@git.apache.org> References: <3411318e022b4ee38e6407eb51bf9c36@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [45/51] [partial] trafodion-site git commit: Merge [TRAFODION-3094] PR 1587 Add DELETE examples to SQL Reference http://git-wip-us.apache.org/repos/asf/trafodion-site/blob/81dd6cba/docs/2.3.0/command_interface/index.html ---------------------------------------------------------------------- diff --git a/docs/2.3.0/command_interface/index.html b/docs/2.3.0/command_interface/index.html index 75c4f36..f6e3171 100644 --- a/docs/2.3.0/command_interface/index.html +++ b/docs/2.3.0/command_interface/index.html @@ -1,10872 +1,10872 @@ - - - - - - - -Command Interface Guide - - - - - - -
-
-
-
-

License Statement

-
-
-

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file -distributed with this work for additional information regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with -the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

-
-
-

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License.

-
-
-
-

Acknowledgements

-
-
-

Microsoft®, Windows®, Windows NT®, Windows® XP, and Windows Vista® are -U.S. registered trademarks of Microsoft Corporation. Intel® and Intel® -Itanium® are trademarks of Intel Corporation in the U.S. and other -countries. Java® is a registered trademark of Oracle and/or its -affiliates. Motif, OSF/1, UNIX®, X/Open®, and the X device is a -trademark of X/Open Company Ltd. in the UK and other countries.

-
-
-

OSF, OSF/1, OSF/Motif, Motif, and Open Software Foundation are trademarks of -the Open Software Foundation in the U.S. and other countries. -© 1990, 1991, 1992, 1993 Open Software Foundation, Inc.

-
-
-

The OSF documentation and the OSF software to which it relates are derived in -part from materials supplied by the following: © 1987, 1988, 1989 -Carnegie-Mellon University. © 1989, 1990, 1991 Digital Equipment -Corporation. © 1985, 1988, 1989, 1990 Encore Computer Corporation. © 1988 Free -Software Foundation, Inc. © 1987, 1988, 1989, 1990, 1991 Hewlett-Packard -Company. © 1985, 1987, 1988, 1989, 1990, 1991, 1992 International -Business Machines Corporation. © 1988, 1989 Massachusetts Institute of -Technology. © 1988, 1989, 1990 Mentat Inc. © 1988 Microsoft Corporation. -© 1987, 1988, 1989, 1990, 1991, -1992 SecureWare, Inc. © 1990, 1991 Siemens Nixdorf Informations systeme -AG. © 1986, 1989, 1996, 1997 Sun Microsystems, Inc. © 1989, 1990, 1991 -Transarc Corporation.

-
-
-

OSF software and documentation are based in part -on the Fourth Berkeley Software Distribution under license from The -Regents of the University of California. OSF acknowledges the following -individuals and institutions for their role in its development: Kenneth -C.R.C. Arnold, Gregory S. Couch, Conrad C. Huang, Ed James, Symmetric -Computer Systems, Robert Elz. © 1980, 1981, 1982, 1983, 1985, 1986, -1987, 1988, 1989 Regents of the University of California. OSF MAKES NO -WARRANTY OF ANY KIND WITH REGARD TO THE OSF MATERIAL PROVIDED HEREIN, -INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE. OSF shall not be liable for errors -contained herein or for incidental consequential damages in connection -with the furnishing, performance, or use of this material.

-
-
-
-

Revision History

-
- ---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
VersionDate

2.2.0

TBD

2.1.0

May 1, 2017

2.0.1

July 7, 2016

2.0.0

June 6, 2016

1.3.0

January, 2016

-
-
-
-

1. About This Document

-
-
-

This guide describes how to use the Trafodion Command Interface (trafci) on a client workstation to connect to and query a Trafodion database. -The trafci enables you to run SQL statements interactively or from script files.

-
-
-

1.1. Intended Audience

-
-

This guide is intended for database administrators and support personnel who are maintaining and monitoring a Trafodion database.

-
-
-
-

1.2. New and Changed Information

-
-

This manual shows updated versions for Trafodion Release 2.3.0.

-
-
-
-

1.3. Notation Conventions

-
-

This list summarizes the notation conventions for syntax presentation in this manual.

-
-
-
    -
  • -

    UPPERCASE LETTERS

    -
    -

    Uppercase letters indicate keywords and reserved words. Type these items exactly as shown. Items not enclosed in brackets are required.

    -
    -
    -
    -
    SELECT
    -
    -
    -
  • -
  • -

    lowercase letters

    -
    -

    Lowercase letters, regardless of font, indicate variable items that you supply. Items not enclosed in brackets are required.

    -
    -
    -
    -
    file-name
    -
    -
    -
  • -
-
-
-
-
    -
  • -

    [ ] Brackets

    -
    -

    Brackets enclose optional syntax items.

    -
    -
    -
    -
    DATETIME [start-field TO] end-field
    -
    -
    -
    -

    A group of items enclosed in brackets is a list from which you can choose one item or none.

    -
    -
    -

    The items in the list can be arranged either vertically, with aligned brackets on each side of the list, or horizontally, enclosed in a pair of brackets and separated by vertical lines.

    -
    -
    -

    For example:

    -
    -
    -
    -
    DROP SCHEMA schema [CASCADE]
    -DROP SCHEMA schema [ CASCADE | RESTRICT ]
    -
    -
    -
  • -
  • -

    { } Braces

    -
    -

    Braces enclose required syntax items.

    -
    -
    -
    -
    FROM { grantee [, grantee ] ... }
    -
    -
    -
    -

    A group of items enclosed in braces is a list from which you are required to choose one item.

    -
    -
    -

    The items in the list can be arranged either vertically, with aligned braces on each side of the list, or horizontally, enclosed in a pair of braces and separated by vertical lines.

    -
    -
    -

    For example:

    -
    -
    -
    -
    INTERVAL { start-field TO end-field }
    -{ single-field }
    -INTERVAL { start-field TO end-field | single-field }
    -
    -
    -
  • -
  • -

    | Vertical Line

    -
    -

    A vertical line separates alternatives in a horizontal list that is enclosed in brackets or braces.

    -
    -
  • -
-
-
-
-
{expression | NULL}
-
-
-
-
-
    -
  • -

    … Ellipsis

    -
    -

    An ellipsis immediately following a pair of brackets or braces indicates that you can repeat the enclosed sequence of syntax items any number of times.

    -
    -
    -
    -
    ATTRIBUTE[S] attribute [, attribute] ...
    -{, sql-expression } ...
    -
    -
    -
    -

    An ellipsis immediately following a single syntax item indicates that you can repeat that syntax item any number of times.

    -
    -
    -

    For example:

    -
    -
    -
    -
    expression-n ...
    -
    -
    -
  • -
  • -

    Punctuation

    -
    -

    Parentheses, commas, semicolons, and other symbols not previously described must be typed as shown.

    -
    -
    -
    -
    DAY (datetime-expression)
    -@script-file
    -
    -
    -
    -

    Quotation marks around a symbol such as a bracket or brace indicate the symbol is a required character that you must type as shown.

    -
    -
    -

    For example:

    -
    -
    -
    -
    "{" module-name [, module-name] ... "}"
    -
    -
    -
  • -
-
-
-
-
    -
  • -

    Item Spacing

    -
    -

    Spaces shown between items are required unless one of the items is a punctuation symbol such as a parenthesis or a comma.

    -
    -
    -
    -
    DAY (datetime-expression) DAY(datetime-expression)
    -
    -
    -
    -

    If there is no space between two items, spaces are not permitted. In this example, no spaces are permitted between the period and any other items:

    -
    -
    -
    -
    myfile.sh
    -
    -
    -
  • -
  • -

    Line Spacing

    -
    -

    If the syntax of a command is too long to fit on a single line, each continuation line is indented three spaces and is separated from the preceding line by a blank line.

    -
    -
    -

    This spacing distinguishes items in a continuation line from items in a vertical list of selections.

    -
    -
    -
    -
    match-value [NOT] LIKE _pattern
    -   [ESCAPE esc-char-expression]
    -
    -
    -
  • -
-
-
-
-

1.4. Comments Encouraged

-
-

We encourage your comments concerning this document. We are committed to providing documentation that meets your -needs. Send any errors found, suggestions for improvement, or compliments to user@trafodion.apache.org.

-
-
-

Include the document title and any comment, error found, or suggestion for improvement you have concerning this document.

-
-
-
-
-
-

2. Introduction

-
-
-

The Trafodion Command Interface (trafci) is a command-line interface that you download and install on a client workstation that has the -Trafodion JDBC Type 4 Driver installed. Operating systems that support the JDBC driver include Windows and Linux. The JDBC driver connects -trafci on a client workstation to a Trafodion database.

-
-
-

trafci Connected to a Trafodion Database

-
-
-

trafci enables you to perform daily administrative and database management tasks by running SQL statements or other commands -interactively or from script files. You can also run trafci from a Perl or Python command line or from Perl or Python programs.

-
-
-
-
-

3. Install and Configure

-
-
-

3.1. Install trafci

-
-

To install trafci on a client workstation, follow the procedures in the -Trafodion Client Installation Guide. -Ensure that you set up the Java Path per the instructions in that guide.

-
-
-
-

3.2. Test trafci Launch

-
-
    -
  1. -

    Launch trafci and verify that you can connect to the database. For -instructions, see Launch trafci.

    -
    -

    This window should appear:

    -
    -
    -

    image

    -
    -
  2. -
  3. -

    If you cannot launch trafci or connect to the database, verify that:

    -
    -
      -
    • -

      The database platform is available and running, and the port number is correct for the database platform.

      -
    • -
    • -

      The Java path is set to the correct location. See Verify and Set the Java Path.

      -
    • -
    • -

      You installed the trafci and JDBC software files correctly.

      -
    • -
    -
    -
  4. -
-
- -
-
-
-
-

4. Launch trafci

-
-
-

This chapter describes how to launch trafci from the Window or Linux environment of a client workstation. -For information about launching trafci from Perl or Python, see Run trafci from Perl or Python.

-
-
- - - - - -
- - -Before launching trafci, make sure that you have set the Java path to the correct location. -See Verify and Set Java Path. -
-
-
-

4.1. Launch trafci on Windows Workstation

-
-
    -
  1. -

    Find the Windows launch file, trafci.cmd, in the bin folder:

    -
    -

    Navigate to bin folder

    -
    -
  2. -
  3. -

    Double-click the trafci.cmd file.

    -
    -

    trafci appears, prompting you to enter the host name or IP address of the database platform, your user name, and password. -See Log In to Database Platform.

    -
    -
  4. -
-
-
-
-

4.1.1. Create trafci.cmd Shortcut

-
-

To enable a user to launch trafci from a shortcut icon on the desktop:

-
-
-
    -
  1. -

    Right-click the desktop and select New>Shortcut:

    -
    -

    Select trafci.cmd file

    -
    -
    -
  2. -
  3. -

    Type the location of trafci.cmd within double quotes (") or click Browse to locate that file, and then click Next:

    -
    -

    Select shortcut from menu

    -
    -
    -

    For the locations of the installed trafci software files, -see the Trafodion Client Installation Guide.

    -
    -
  4. -
  5. -

    Type a name for the shortcut and click Finish:

    -
    -

    Name shortcut

    -
    -
    -
  6. -
  7. -

    If desired, specify optional launch parameters for the shortcut:

    -
    -
      -
    1. -

      Right-click the shortcut icon and select Properties:

      -
      -

      Select properties

      -
      -
    2. -
    3. -

      Select the Shortcut tab.

      -
    4. -
    5. -

      In the Target box, insert a space after "…\Trafodion Command Interface\bin\trafci.cmd" -and add the optional launch parameters:

      -
      -

      Add optional launch parameters

      -
      -
      -

      For more information, see Optional Launch Parameters.

      -
      -
    6. -
    7. -

      Click OK.

      -
    8. -
    -
    -
  8. -
  9. -

    To launch trafci, double-click the shortcut icon.

    -
    -

    trafci appears. If you did not set the optional launch parameters, trafci prompts you to enter the -host name or IP address of the database platform, your user name, and password. -See Log In to Database Platform.

    -
    -
  10. -
-
-
-
-
-
-

4.2. Launch trafci on Linux Workstation

-
-

In the terminal window, enter:

-
-
-
-
./<trafci-installation-directory>/trafci/bin/trafci.sh
-
-
-
-

<trafci-installation-directory> is the directory where you installed the trafci software files. -For more information, -see the Trafodion Client Installation Guide.

-
-
-

4.2.1. Set trafci.sh PATH

-
-

To enable a user to launch trafci anywhere on the client workstation:

-
-
-
    -
  1. -

    Open the user profile (.profile or .bash_profile for the Bash shell) in the -$HOME directory.

    -
    -
    -
    cd $HOME
    -vi .profile
    -
    -
    -
  2. -
  3. -

    In the user profile, set the PATH environment variable to include the path of the trafci.sh file.

    -
    -
    -
    export PATH=/<trafci-installation-directory>/trafci/bin/: ...
    -
    -
    -
    -

    trafci-installation-directory is the directory where you installed the trafci software files. -For more information, -see the Trafodion Client Installation Guide. -Check that no space is after the colon (:) in the path.

    -
    -
    - - - - - -
    - - -In the C shell, use the setenv command instead of export. -
    -
    -
  4. -
  5. -

    To activate the changes, either log out and log in again or execute the user profile.

    -
    -
    -
    . .profile
    -
    -
    -
    -
  6. -
  7. -

    On the command line, execute the trafci.sh file to launch trafci:

    -
    -
    -
    trafci.sh
    -
    -
    -
    -

    trafci appears, prompting you to enter the host name or IP address of the database platform, your user name, and password. -See Log In to Database Platform.

    -
    -
    - - - - - -
    - - -To enable all users to launch trafci anywhere on the system, create a symbolic link to the -trafci.sh file in the /usr/bin or /usr/local/bin directory: -
    -
    -
    -
    -
    ln -s ./<trafci-installation-directory>/trafci/bin/trafci.sh /usr/bin/trafci.sh
    -
    -
    -
  8. -
-
-
-
-

4.2.2. Preset the Optional Launch Parameters

-
-

To preset the optional launch parameters for each session, use an alias in the shell command.

-
-
-
-
alias trafci='trafci.sh -h 16.123.456.78:23400 -u user1 -p xxxxxx'
-
-
-
-

You can add the alias, trafci, to the user profile, or you can enter it at a command prompt. -For more information about the optional launch parameters, -see Use Optional Launch Parameters.

-
-
-
-
-
-

4.3. Log In to Database Platform

-
-

4.3.1. Log In Without Login Parameters

-
-

If you launch trafci and do not specify login parameters on the command line, follow these steps:

-
-
-
    -
  1. -

    After you launch trafci, trafci shows the welcome banner and prompts you to enter the host name -or IP address of the database platform:

    -
    -
    -
    Host Name/IP Address: _
    -
    -
    -
    -

    Enter a host name:

    -
    -
    -
    -
    host-name[.domain-name][:port-number]
    -
    -
    -
    -
      -
    • -

      If you do not specify the domain name, trafci uses the domain of the client workstation.

      -
    • -
    • -

      If you do not specify a port number, trafci uses the default port umber, which is 23400.

      -
      -

      Or enter an IP address:

      -
      -
      -
      -
      IP-address[:port-number]
      -
      -
      -
    • -
    -
    -
  2. -
  3. -

    Enter your directory-service (or LDAP) user name. User names are case-insensitive.

    -
  4. -
  5. -

    Enter your password. Passwords are case-sensitive.

    -
  6. -
  7. -

    After you finish logging in to the database platform, the SQL prompt appears:

    -
    -
    -
    Connected to Trafodion
    -
    -SQL>
    -
    -
    -
  8. -
-
-
-

At the prompt, you can enter an SQL statement or an interface command. -For more information, see Run Interactive Commands in trafci.

-
-
- - - - - -
- - -trafci allows you to reenter the login values, with a maximum of three retries, -before it closes the session. For more information, see Retry Login. -
-
-
-
-

4.3.2. Use Login Parameters

-
-

To avoid entering a host name, user name, or password each time you launch trafci, use these login parameters:

-
-
-
    -
  • -

    -h or -host

    -
  • -
  • -

    -u or -user

    -
  • -
  • -

    -p or -password

    -
  • -
-
-
-

Example: Windows Login

-
-
-
-
cd <trafci-installation-directory>\Trafodion Command Interface\bin
-
-trafci.cmd -h 16.123.456.78:23400 -u user1 -p xxxxxx
-
-
-
-

Example: Linux Login

-
-
-
-