转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 数据库 >> SyBase >> 正文
usage of bcp command.(快来看)。         ★★★★

usage of bcp command.(快来看)。

作者:闵涛 文章来源:闵涛的学习笔记 点击数:3550 更新时间:2009/4/22 23:09:59
s "\t" and  used for all columns except the last one), and a newline (entered  as "\n" and used for the last field in  a row). Other terminators are: "\0" (the  null terminator), "\" (backslash), and "\r" (Return).  When choosing a terminator, be sure that its pattern does not appear  in any of your character data.
For example, if you used tab terminators with a string that  contained a tab, bcp would not be able to identify  which tab represents the end of the string. bcp always  looks for the first possible terminator, so, in this example it  would find the wrong one.
When a terminator or prefix is present, it affects the length  of data transferred. If the length of an entry being copied out  to a file is less than the storage length, it is immediately followed  by the terminator or the prefix for the next field. The entry is  not padded to the full storage length (char, nchar,  and binary data is returned from Adaptive Server already padded  to the full length).
When bcp is copying in from a file, data  is transferred until either the number of bytes indicated in the "Length" prompt  has been copied or the terminator is encountered. Once the number  of bytes equal to the specified length has been transferred, the  rest of the data is flushed until the terminator is encountered.  When no terminator is used, the table storage length is strictly  observed.
稵able 4-4  and Table 4-5  show the interaction  of prefix lengths, terminators, and field length on the information  in the file. "P" indicates the prefix in the stored  table; "T" indicates the terminator; and dashes,  (--) show appended spaces. An ellipsis (...) indicates that the  pattern repeats for each field. The field length is 8 bytes for  each column; "string" represents the 6-character  field each time.
?
Table   4-4:  Adaptive Server char data
?
Table   4-5:  Other datatypes converted to char storage
稵he file storage type and length of a column do  not have to be the same as the type and length of the column in  the database table. [If the types and formats copied in  are incompatible with the structure of the database table, the copy  fails.
稦ile storage length generally indicates the maximum  amount of data that can be transferred for the column, excluding  terminators and/or prefixes.
稺hen copying data into a table, bcp observes  any defaults defined for columns and user-defined datatypes. However, bcp ignores  rules in order to load data at the fastest possible speed.
穊cp considers any data column  that can contain a null value to be variable length, so use either  a length prefix or a terminator to denote the length of each row  of data.
稤ata written to a host file in its native format  preserves all of its precision. datetime and float values  preserve all of their precision, even when they are converted to  character format. Adaptive Server stores money values  to a precision of one ten-thousandth of a monetary unit. However,  when money values are converted to character  format, their character format values are recorded only to the nearest  two places.
稡efore copying data that is in character format  from a file into a database table, check the datatype entry rules  in the Adaptive Server Reference Manual. Character data that is being  copied into the database with bcp must conform  to those rules. Note especially that dates in the undelimited format (yy)yymmdd may  result in overflow errors if the year is not specified first.
稺hen you send host data files to sites that use  terminals different from your own, inform them of the datafile_charset that  you used to create the files.


 zengcarter 回复于:2002-09-27 12:06:54 怎不弄个中文的?读起太慢了!

 月冷西湖 回复于:2002-09-27 13:15:52 很好的东西。

 2195113 回复于:2002-09-27 13:30:22 有中文的早就弄上去了。


 klutz 回复于:2002-10-22 11:17:04 用BCP可以字段级选择记录吗?

 dangsl 回复于:2002-10-23 09:12:34 在sybase网站上有PDF格式的中文文档

 pptt 回复于:2002-11-07 15:17:00 给一个下载地址啊!^_^谢谢了

 edit 回复于:2002-11-07 16:42:07 [quote][b]下面引用由[u]klutz[/u]在 [i]2002/10/22 11:17am[/i] 发表的内容:[/b]
用BCP可以字段级选择记录吗?
[/quote]

这点上就不如informix了,informix unload 命令可以写select 语句。

bcp只能整个表倒出导入,但可以用 -F -L 指定起始和结束的行数


 

上一页  [1] [2] [3] [4] [5] 


[办公软件]如何实现Office工具栏、菜单以及菜单命令重命名  [办公软件]如何在Office文档(大)括号内输入多行文字
[办公软件]如何在office(PowerPoint,Word,Excel)中制作带圈的…  [办公软件]批量删除Office文档(word,excle,powerpoint)中的超…
[办公软件]Office(Word,Excel)密码破解软件(Office Password…  [办公软件]如何让低版本的Office也能顺利编辑2007文档
[办公软件]设置office艺术字的形状  [办公软件]如何将Office菜单设置、工具设置、宏设置等应用到…
[办公软件]在Office(word,excel)中输入各级钢筋符号的方法  [办公软件]打开Office文档就提示安装的原因及解决方案
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · Sql Server  · MySql
    · Access  · ORACLE
    · SyBase  · 其他
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台