软件开发db2分区

初学者创建分区表报错

求帮助:不知道是哪里错了。
我用Oracle VM VirtualBox虚拟机装了Red Hat linux 和 DB2 v10.5。
然后执行:
[db2inst2@James ~]$ db2sampl -name Petter
[db2inst1@James ~]$ db2 connect to petter
[db2inst1@James ~]$ db2

然后在db2下创建分区表的时候报错,是哪一步错了?
db2 =>CREATE TABLE lineitem
(
        l_orderkey      DECIMAL(10,0) NOT NULL,
        l_partkey       INTEGER,
        l_suppkey       INTEGER,
        l_linenumber    INTEGER,
        l_quantity      DECIMAL(12,2),
        l_extendedprice DECIMAL(12,2),
        l_discount      DECIMAL(12,2),
        l_tax           DECIMAL(12,2),
        l_returnflag    CHAR(1),
        l_linestatus    CHAR(1),
        l_shipdate      DATE,
        l_commitdate    DATE,
        l_receiptdate   DATE,
        l_shipinstruct  CHAR(25),
        l_shipmode      CHAR(10),
        l_comment       VARCHAR(44)
) PARTITION BY RANGE(l_shipdate)
  ( starting minvalue,
        PART JAN1992 STARTING '1992-01-01'      ENDING '1992-06-30',
        PART JAN1993 STARTING '1992-07-01'      ENDING '1992-12-31',
        PART JAN1994 STARTING '1993-01-01'      ENDING '1993-06-30',
        PART JAN1995 STARTING '1993-07-01'      ENDING '1993-12-31',
                                ending maxvalue );DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "maCREATE" was found following "ending ".
Expected tokens may include:  "JOIN ".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "(" was found following "BEGIN-OF-STATEMENT".
Expected tokens may include:  "".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "l_orderkey      DECIMAL" was found following
"BEGIN-OF-STATEMENT".  Expected tokens may include:  "".
SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "INTEGER" was found following "l_partkey
".  Expected tokens may include:  "JOIN ".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "INTEGER" was found following "l_suppkey
".  Expected tokens may include:  "JOIN ".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "INTEGER" was found following "l_linenumber
".  Expected tokens may include:  "JOIN ".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "l_quantity      DECIMAL" was found following
"BEGIN-OF-STATEMENT".  Expected tokens may include:  "".
SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "l_extendedprice DECIMAL" was found following
"BEGIN-OF-STATEMENT".  Expected tokens may include:  "".
SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "l_discount      DECIMAL" was found following
"BEGIN-OF-STATEMENT".  Expected tokens may include:  "".
SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "l_tax           DECIMAL" was found following
"BEGIN-OF-STATEMENT".  Expected tokens may include:  "".
SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "l_returnflag    CHAR" was found following
"BEGIN-OF-STATEMENT".  Expected tokens may include:  "".
SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "l_linestatus    CHAR" was found following
"BEGIN-OF-STATEMENT".  Expected tokens may include:  "".
SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "DATE" was found following "l_shipdate      ".
Expected tokens may include:  "JOIN ".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "DATE" was found following "l_commitdate    ".
Expected tokens may include:  "JOIN ".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "DATE" was found following "l_receiptdate   ".
Expected tokens may include:  "JOIN ".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "l_shipinstruct  CHAR" was found following
"BEGIN-OF-STATEMENT".  Expected tokens may include:  "".
SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "l_shipmode      CHAR" was found following
"BEGIN-OF-STATEMENT".  Expected tokens may include:  "".
SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "l_comment       VARCHAR" was found following
"BEGIN-OF-STATEMENT".  Expected tokens may include:  "".
SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token ")" was found following "BEGIN-OF-STATEMENT".
Expected tokens may include:  "".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "minvalue" was found following "( starting ".
Expected tokens may include:  "JOIN ".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "JAN1992" was found following "PART ".  Expected
tokens may include:  "JOIN ".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "JAN1993" was found following "PART ".  Expected
tokens may include:  "JOIN ".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "JAN1994" was found following "PART ".  Expected
tokens may include:  "JOIN ".  SQLSTATE=42601
db2 => DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0104N  An unexpected token "JAN1995" was found following "PART ".  Expected
tokens may include:  "JOIN ".  SQLSTATE=42601
参与2

1同行回答

友军杀手友军杀手其它昱谷
好吧,常识性错误。命令行界面不是 windows的图形界面。不能直接在命令行里输入SQL指令。需要另存为sql文档,然后用 db2 -tvf 调用文档执行显示全部
好吧,常识性错误。命令行界面不是 windows的图形界面。不能直接在命令行里输入SQL指令。需要另存为sql文档,然后用 db2 -tvf 调用文档执行收起
软件开发 · 2015-09-15
浏览1647

提问者

友军杀手
其它昱谷

问题状态

  • 发布时间:2015-09-14
  • 关注会员:1 人
  • 问题浏览:3341
  • 最近回答:2015-09-15
  • X社区推广