Chinaunix首页 | 论坛 | 博客
  • 博客访问: 56375
  • 博文数量: 18
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 200
  • 用 户 组: 普通用户
  • 注册时间: 2013-03-01 13:27
个人简介

学习是一种信仰

文章分类

全部博文(18)

文章存档

2016年(8)

2015年(8)

2013年(2)

我的朋友

分类: DB2/Informix

2013-07-24 19:41:05

执行脚本运行报错,单独建表完全没有问题,请各位大神帮忙找出原因:

#!/usr/bin/ksh

. /home/$INSTNAME/sqllib/db2profile

cd $SH_OPER_DIR

PATH=.:$PATH
export PATH

echo "=============== Begin at "`date +%Y%m%d%H%M%S`" ==============="

#当前月,YYYYMM
MM=`month.pl`

#上3月
LLLM=`month.pl -4`

#下下月
TM=`month.pl +1|cut -b3-6`
NYYYYMM=`month.pl +1`


#连接数据库
db2 connect to $DBNAME

if [ $? -ne 0 ]; then
echo "数据库连接失败"
exit
fi

#创建下月表
echo "=============== #UMPAY.TEST_YYMM# ==============="
create table UMPAY.TEST_${TM} (
       EVENTID BIGINT not null,
       EVENTIDENTIFIER CHAR(32) not null default '',
       EVENTINFO  VARCHAR(256) not null default '',
       CLIENTTIME  CHAR(16) not null default '',
       TERMINALID  CHAR(16) not null default '',
       CLIENTVERSIONID CHAR(32) not null default '',
       MERID CHAR(8) not null default '',
       TRADENO  CHAR(32) not null default '',
       VALID CHAR(1)  not null default '1',
       INUSER CHAR(32)  not null default '',
       MODUSER CHAR(32) not null default '',
       INTIME TIMESTAMP not null DEFAULT CURRENT TIMESTAMP,
       MODTIME TIMESTAMP not null DEFAULT CURRENT TIMESTAMP,
       INDATE CHAR(8) not null default '',
       primary key (EVENTID));

报错信息:line 33: syntax error near unexpected token `('
               line 33: `create table UMPAY.T_WLESS_EVENT_INFO_${TM} ('

阅读(647) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~