免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8371 | 回复: 5
打印 上一主题 下一主题

求助,在SYBASE IQ中怎么用loca table 向表中导数据! [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-16 17:05 |只看该作者 |倒序浏览
我的表结构是:
create table  pe(
no varchart(4),
type varchart(5),
value  decimal(18,2))

文件格式是:
8404|!20004|!147500000.00
7404|!20504|!147600000.00
6404|!20074|!247500000.00


请问怎么写load table 语句呀
非常感谢!

论坛徽章:
0
2 [报告]
发表于 2007-07-17 09:00 |只看该作者
load table pe
(
no  '|!',
type  '|!',
value  '\x0a'
)
FROM '/path/file_name'
QUOTES  OFF
ESCAPES OFF

论坛徽章:
0
3 [报告]
发表于 2007-07-17 10:23 |只看该作者

回复 #2 chenfeng825 的帖子

小弟非常感谢!
不在按上述写的执行,出现错误提示,提示信:
Could not execute statement.
ASA Error -1013027:Number of bytes(512)for column from an input file has exceeded the maximum allowed(4).
--(db_RecScanner.cxx 43
Sybase error code=21,SQLState="QCA27"
Line 1,column 1
小弟是初学,希望各位大哥多多指教!

论坛徽章:
0
4 [报告]
发表于 2007-07-25 16:09 |只看该作者
主要还是文本文件的格式引起的。
检查你的文本文件格式是unix的, 还是dos的
unix格式:
         load table pe            
          (
             no  '|!',
             type  '|!',
             value  '\x0a'
          )
FROM '/path/file_name'
QUOTES  OFF
ESCAPES OFF

dos格式:

         load table pe            
          (
             no  '|!',
             type  '|!',
             value  '\x0d\x0a'
          )
FROM '/path/file_name'
QUOTES  OFF
ESCAPES OFF

论坛徽章:
0
5 [报告]
发表于 2007-08-10 10:38 |只看该作者
你的导入文件最后一行少个回车吧?

论坛徽章:
0
6 [报告]
发表于 2011-05-31 15:49 |只看该作者
大家好。
    我也踫到類似的問題,我的操作系統環境是AIX,執行load table時提示如下錯誤:
Msg 21, Level 14, State 0:
ASA Error -1013027: Number of bytes (2) for a column from an input file has
exceeded the maximum allowed (32767).
-- (db_RecScanner.cxx 725)

      load table语句如下:
load table smmc_olapuser.nti_cdr_20110201
(
    nti_code      '|',
    msgid         '|',
    src_locate    '|',
    dst_locate    '|',
    smcid         '|',
    src           '|',
    dst           '|',
    state         '|',
    deviceno      '|',
    recv_time     '|',
    done_time     '|',
    coding        '|',
    content       '|',
    src_type      '|',
    dst_type      '|',
    delivery_time '|',
    expire_time   '|',
    alarm_type    '|',
    alarm_time    '|',
    alarm_resp    '|',
    during        '|',
    flag          '\n'   --(或'\0a')
)
from '/opt/smmc/data1/nti_cdr_20110201.bcp'
escapes off
quotes off
notify 1000000
with checkpoint on

      后用“>”取nti_cdr_20110201.bcp的前10行,执行时却无报错,但在nti_cdr_20110201表里仍查不到相关记录,不知道是啥原因。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP