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

bcp文档,自己看吧

作者:闵涛 文章来源:闵涛的学习笔记 点击数:2661 更新时间:2009/4/22 23:09:20
ore thoroughly in the System Administration Guide.
-z language
is the official name of an alternate language the server uses to display bcp prompts and messages. Without the -z flag, bcp uses the server's default language.
You can add languages to an Adaptive Server during installation or afterwards, using either the langinstall utility (or langinst in Windows NT) or the sp_addlanguage stored procedure.
The following error message appears if an incorrect or unrecognized language is named with the -z parameter:
Unrecognized localization object. Using default value 'us_english'.
Starting copy...
=> warning.
-v
displays the version number of bcp and a copyright message and returns to the operating system.
-A packet_size
specifies the network packet size to use for this bcp session. For example:
bcp pubs2..titles out table_out -A 2048
sets the packet size to 2048 bytes for this bcp session. packet_size must be between the values of the default network packet size and maximum network packet size configuration variables, and it must be a multiple of 512.
Use network packet sizes larger than the default to improve the performance of large bulk-copy operations.
-J client_charset
specifies the character set to use on the client. bcp uses a filter to convert input between client_charset and the Adaptive Server character set.
-J client_charset requests that Adaptive Server convert to and from client_charset, the character set used on the client.
-J with no argument sets character set conversion to NULL. No conversion takes place. Use this if the client and server use the same character set.
Omitting -J sets the character set to a default for the platform, which may not necessarily be the character set that the client is using.. Table 6-2 lists platform defaults.
Default character sets for different platforms  
Platform Default Character Set
Sun Solaris, Digital UNIX, NCR, RS/6000 iso_1
HP-UX roman8
OS/2, Novell NetWare 386 cp850
Macintosh mac

The following error message appears if an incorrect or unrecognized character set is named with the -J parameter:
Unrecognized localization object. Using default value 'iso_1'.
Starting copy...
=> warning.
For more information about character sets and associated flags, see the System Administration Guide.
-T text_or_image_size
allows you to specify, in bytes, the maximum length of text or image data that Adaptive Server sends. The default is 32K. If a text or an image field is larger than the value of -T or the default, bcp does not send the overflow.
-E
explicitly specifies the value of a table's IDENTITY column.
By default, when you bulk copy data into a table with an IDENTITY column, bcp assigns each row a temporary IDENTITY column value of 0. This is effective only when copying data into a table. bcp reads the value of the ID column from the data file, but does not send it to the server. Instead, as bcp inserts each row into the table, the server assigns the row a unique, sequential, IDENTITY column value, beginning with the value 1. If you specify the -E flag when copying data into a table, bcp reads the value from the data file and sends it to the server which inserts the value into the table. If the number of rows inserted exceeds the maximum possible IDENTITY column value, Adaptive Server returns an error.
The -E parameter has no effect when you are bulk copying data out. Adaptive Server copies the ID column to the data file, unless you use the -N parameter.
You cannot use the -E and -g flags together.
-g id_start_value
specifies the value of the IDENTITY column to use as a starting point for copying data in.
You cannot use the -g and -E flags together.
-N
skips the IDENTITY column. Use this parameter when copying data in if your host data file does not include a placeholder for the IDENTITY column values, or when copying data out, if you do not want to include the IDENTITY column information in the host file.
You cannot use both -N and -E parameters when copying data in.
-X
specifies that, in this connection to the server, the application initiates the login with client-side password encryption. bcp (the client) specifies to the server that password encryption is desired. The server sends back an encryption key, which bcp uses to encrypt your password, and the server uses the key to authenticate your password when it arrives.
If bcp crashes, the system creates a core file that contains your password. If you did not use the encryption option, the password appears in plain text in the file. If you used the encryption option, your password is not readable.
-M label_name "label_value"
(secure SQL server only) enables multilevel users to set the session labels for the bulk-copy. Valid values for label_name are:
curread (current read level) is the initial level of data that you can read during this session. curread must dominate curwrite.
curwrite (current write level) is the initial sensitivity level that will be applied to any data that you write during this session.
maxread (maximum read level) is the maximum level at which you can read data. This is the upper bound to which you as a multilevel user can set your curread during the session. maxread must dominate maxwrite.
maxwrite (maximum write level) is the maximum level at which you can write data. This is the upper bound to which you as a multilevel user can set your curwrite during a session. maxwrite must dominate minwrite and curwrite.
minwrite (minimum write level) is the minimum level at which you can write data. This is the lower bound to which you as a multilevel user can set curwrite during a session. minwrite must be dominated by maxwrite and curwrite.
label_value is the actual value of the label, expressed in the human-readable format used on your system (for example, "Company Confidential Personnel").
-labeled
(secure SQL server only) indicates that the data you are importing already has labels in the first field of every record.
For exporting data this option indicates that you want the sensitivity label of every row to be copied out as the first field.
-K keytab_file
specifies the path to the keytab file used for authentication in DCE.
-R remote_server_principal
specifies the principal name for the server as defined to the security mechanism. By default, a server's principal name matches the server's network name (which is specified with the -S parameter or the DSQUERY environment variable). Use the -R parameter when the server's principal name and network name are not the same.
-V security_options
specifies network-based user authentication. With this option, the user must log in to the network's security system before running the utility. In this case, users must supply their network user name with the -U option; any password supplied with the -P option is ignored.
-V can be followed by a security_options string of key-letter options to enable additional security services. These key letters are:
c - Enable data confidentiality service
i - Enable data integrity service
m - Enable mutual authentication for connection establishment
o - Enable data origin stamping service
r - Enable data replay detection
q - Enable out-of-sequence detection
-Z security_mechanism
specifies the name of a security mechanism to use on the connection.
Security mechanism names are defined in the $SYBASE/install/libtcl.cfg configuration file. If no security_mechanism name is supplied, the default mechanism is used. For more information on security mechanism names, see the description of the libtcl.cfg file in the Open Client/Server Configuration Guide.
-Q
provides backward compatibility with bcp version 10.0.4 for copying operations involving nullable columns.
Examples
Example 1
Copies data out of the publishers table in character format (using char for all fields) using the -c parameter. The -t field_terminator parameter ends each field with a comma, and the -r row_terminator parameter ends each line with a Return. bcp prompts only for a password:
In UNIX platforms:
bcp pubs2..publishers out pub_out -c -t , -r \r
The first backslash before the final "r" escapes the second so that only one backslash is printed.
In Windows NT:
bcp pubs2..publishers out pub_out -c -t , -r \r
Example 2
Copies data from the publishers table to a file named pub_out for later reloading into Adaptive Server. Press Return to accept the defaults specified by the prompts. The same prompts appear when you copy data into the publishers table:
bcp pubs2..publishers out pub_out
Password:
Enter the file storage type of field pub_id [char]:
Enter prefix length of field pub_id [0]:
Enter length of field pub_id [4]:
Enter field terminator [none]:
Enter the file storage type of field pub_name [char]:
Enter prefix length of field pub_name [1]:
Enter length of field pub_name [40]:
Enter field terminator [none]:
Enter the file storage type of field city [char]:
Enter prefix length of field city [1]:
Enter length of field city [20]:
Enter field terminator [none]:
Enter the file storage type of field state [char]:
Enter prefix length of field state [1]:
Enter length of field state [2]:
Enter field terminator [none]:
In UNIX, you are then asked:
Do you want to save this format information in a
     file? [Y-n] y
Host filename [bcp.fmt]: pub_form
Starting copy...
3 rows copied.
 Clock Time (ms.): total = 1 Avg = 0 (3000.00 rows per sec.)
E

上一页  [1] [2] [3]  下一页


没有相关教程
教程录入: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……
    咸宁网络警察报警平台