<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sybase数据库技术，数据库恢复专家 &#187; BCP</title>
	<atom:link href="http://www.dbainfo.net/tag/bcp/feed" rel="self" type="application/rss+xml" />
	<link>https://www.dbainfo.net</link>
	<description>提供Sybase ASE及Sybase SQL Anywhere数据库修复服务，电话：13811580958(微信)，QQ：289965371！We have many years of experience in recovering data from damanged Sybase devices. Contact us by Phone: +86 13811580958 Wechat: 13811580958 Email: 289965371@qq.com</description>
	<lastBuildDate>Sat, 14 Jun 2025 16:28:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Sybase ASE 15.x版本中bcp和isql工具的新特性</title>
		<link>https://www.dbainfo.net/isqlbcp_news.htm</link>
		<comments>https://www.dbainfo.net/isqlbcp_news.htm#comments</comments>
		<pubDate>Tue, 20 Sep 2011 14:18:21 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[Sybase ASE]]></category>
		<category><![CDATA[BCP]]></category>
		<category><![CDATA[isql]]></category>
		<category><![CDATA[新特性]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/?p=1139</guid>
		<description><![CDATA[本博客中关于isql和bcp这2个工具的文章有： ISQL： Sybase ASE中用isql连接数据库失败时的错误信息所反馈的信息 ASE中的命令行实用工具isql的几个参数的使用方法 BCP： 关于BCP工具的使用，介绍三个方面的东西 关于Sybase中的快bcp ASE15.x的bcp能够实现按照条件导出表内数据 bcp导出数据时禁止字符集转化 快速生成bcp in导表命令行的方法 本文介绍Sybase ASE V15.x版本中isql和bcp这两个工具的新特性。在前面的博文：ASE中的命令行实用工具isql的几个参数的使用方法 中介绍了isql的几个新特性。 1 BCP 1.1 Skip number of rows: --skiprows (SDK 12.5.1 ESD #19) 1.2 Partition support for multiple-partition, multiple-file operations (ASE 15.0) 1.3 Computed columns: --hide-vcc / --show-fi (ASE 15.0) 1.4 Encrypted columns: -C (ASE 15.0 ESD #1 /&#160;SDK 12.5.1 [...]]]></description>
			<content:encoded><![CDATA[<p>本博客中关于isql和bcp这2个工具的文章有：</p>
<p>ISQL：</p>
<ol>
<li><a href="https://www.dbainfo.net/sybase-ase-isql-login-failed-feedbacks.htm" target="_blank">Sybase ASE中用isql连接数据库失败时的错误信息所反馈的信息<br />
		</a></li>
<li><a href="https://www.dbainfo.net/sybase-ase-cmdline-utility-isql-new-features.htm" target="_blank">ASE中的命令行实用工具isql的几个参数的使用方法<br />
		</a></li>
</ol>
<p>BCP：</p>
<ol>
<li><a href="https://www.dbainfo.net/bcp-utility-usages.htm" target="_blank">关于BCP工具的使用，介绍三个方面的东西<br />
		</a></li>
<li><a href="https://www.dbainfo.net/sybase-fast-bcp-utility.htm" target="_blank">关于Sybase中的快bcp<br />
		</a></li>
<li><a href="https://www.dbainfo.net/ase-15-bcp-out-table-by-conditions.htm" target="_blank">ASE15.x的bcp能够实现按照条件导出表内数据<br />
		</a></li>
<li><a href="https://www.dbainfo.net/bcp-out-disable-character-set-convertion.htm" target="_blank">bcp导出数据时禁止字符集转化<br />
		</a></li>
<li><a href="https://www.dbainfo.net/generate-bcp-in-table-syntax-fast.htm" target="_blank">快速生成bcp in导表命令行的方法<br />
		</a></li>
</ol>
<p>
	本文介绍Sybase ASE V15.x版本中isql和bcp这两个工具的新特性。在前面的博文：<a href="https://www.dbainfo.net/sybase-ase-cmdline-utility-isql-new-features.htm" target="_blank">ASE中的命令行实用工具isql的几个参数的使用方法 </a>中介绍了isql的几个新特性。</p>
<div class="sites-embed-align-left-wrapping-off">
<div class="sites-embed-border-off sites-embed" style="width:500px;">
<div class="sites-embed-content sites-embed-type-toc">
<div class="goog-toc sites-embed-toc-maxdepth-6">
<p><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-BCP"><strong>1 </strong>BCP</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Skip-number-of-rows:---skiprows-SDK"><strong>1.1 </strong>Skip number of rows: --skiprows (SDK 12.5.1 ESD #19)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Partition-support-for-multiple-part"><strong>1.2 </strong>Partition support for multiple-partition, multiple-file operations (ASE 15.0)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Computed-columns:---hide-vcc---show"><strong>1.3 </strong>Computed columns: --hide-vcc / --show-fi (ASE 15.0)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Encrypted-columns:--C-ASE-15.0-ESD-"><strong>1.4 </strong>Encrypted columns: -C (ASE 15.0 ESD #1 /&nbsp;SDK 12.5.1 ESD #5)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Initialization-strings:---initstrin"><strong>1.5 </strong>Initialization strings: --initstring (ASE 15.0 ESD #5)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Discard-file-support-for-rejected-r"><strong>1.6 </strong>Discard file support for rejected rows: -d (ASE 15.0 ESD #8)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Alternate-Sybase-home:--y-New-Featu"><strong>1.7 </strong>Alternate Sybase home: -y (New Features in&nbsp;15.0.2 ESD#5 / SDK 15.0 ESD#2)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-bcp64-for-64-bit-products-on-UNIX-p"><strong>1.8 </strong>bcp64 for 64-bit products on UNIX platforms (New Features in 15.5 ESD #9)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Usage"><strong>1.9 </strong>Usage</a></p>
<p><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-ISQL"><strong>2 </strong>ISQL</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-isql-external-error-status-return:-"><strong>2.1 </strong>isql external error status return: --retserverror (ASE&nbsp;15.0.2 ESD#4 /&nbsp;SDK 15.0 ESD#10)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Alternate-Sybase-home:--y-ASE-15.0."><strong>2.2 </strong>Alternate Sybase home: -y (ASE 15.0.2 ESD#5 / SDK 15.0 ESD#2)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Redirects-Append-the-output-of-the-"><strong>2.3 </strong>Redirects/Append the output of the T-SQL command to file_name (ASE 15.0.2 ESD#5 /&nbsp;SDK 15.0 ESD#12)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Pipes-the-output-of-the-T-SQL-comma"><strong>2.4 </strong>Pipes the output of the T-SQL command to an external command (ASE 15.0.2 ESD#5 /&nbsp;SDK 15.0 ESD#12)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Obfuscated-input:---conceal-ASE-15."><strong>2.5 </strong>Obfuscated input: --conceal (ASE 15.0 ESD #13)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Verbose-usage:---help-ASE-15.0-ESD-"><strong>2.6 </strong>Verbose usage:&nbsp;--help (ASE&nbsp;15.0 ESD #14)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Application-name:---appname-ASE-15."><strong>2.7 </strong>Application name: --appname (ASE 15.0.3 ESD#4 / OCS 15.0 ESD#17 / OCS 15.5)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Command-history:---history-ASE-15.0"><strong>2.8 </strong>Command history: --history (ASE 15.0.3 ESD#4 / OCS 15.0 ESD#18 / OCS 15.5)</a></p>
<p style="margin-left: 80px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Command-history"><strong>2.8.1 </strong>Command history</a></p>
<p style="margin-left: 80px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Listing-command-history"><strong>2.8.2 </strong>Listing command history</a></p>
<p style="margin-left: 80px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Recalling-and-reissuing-commands"><strong>2.8.3 </strong>Recalling and reissuing commands</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-isql64-for-64-bit-products-on-UNIX-"><strong>2.9 </strong>isql64 for 64-bit products on UNIX platforms (New Features 15.5 ESD #9)</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Usage1"><strong>2.10 </strong>Usage</a></p>
<p><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-Sources"><strong>3 </strong>Sources</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-New-Features-Open-Server-15.5-and-S"><strong>3.1 </strong>New Features Open Server&trade; 15.5 and SDK 15.5 for Windows, Linux, UNIX, and Mac OS X</a></p>
<p style="margin-left: 40px;"><a href="https://www.dbainfo.net/isqlbcp_news.htm#TOC-New-Features-Open-Server-15.0-and-S"><strong>3.2 </strong>New Features Open Server&trade; 15.0 and SDK 15.0 for Microsoft Windows, Linux, UNIX, and Mac OS X</a></p>
</p></div>
</p></div>
</p></div>
</div>
<div><span id="more-1139"></span></div>
<div>&nbsp;</div>
<div>
<hr /></div>
<h2><a name="TOC-BCP"></a>BCP</h2>
<div>&nbsp;</div>
<h3><a name="TOC-Skip-number-of-rows:---skiprows-SDK"></a>Skip number of rows: --skiprows (SDK 12.5.1 ESD #19)</h3>
<div>You can now use the new --skiprows parameter to skip the number of rows starting from the first row of an input file. This new feature provides BCP the ability to skip a specified number of rows before starting to copy from an input file. The valid range for --skiprows is between 0 and the actual number of rows in the input file. Providing an invalid value will display an error message.</p>
<p>	The new --skiprows parameter cannot co-exist with the -F option.</p>
<p>In the following example, BCP will ignore the first two rows of the input file titles.txt and start to copy from the third row.<br />
		<code>bcp pubs2..titles in titles.txt -U username -P password --skiprows 2</code></p>
<p>		&nbsp;</p>
<h3><a name="TOC-Partition-support-for-multiple-part"></a>Partition support for multiple-partition, multiple-file operations (ASE 15.0)</h3>
<p>&nbsp;</p>
<p></p>
<h3><a name="TOC-Computed-columns:---hide-vcc---show"></a>Computed columns: --hide-vcc / --show-fi (ASE 15.0)</h3>
<p>Two new parameters are included to support BCP computed columns:<br />
		--hide-vcc: Instructs BCP not to copy VCCs.<br />
		--show-fi: Instructs BCP to copy FIs.</p>
<p>
		&nbsp;</p>
<h3><a name="TOC-Encrypted-columns:--C-ASE-15.0-ESD-"></a>Encrypted columns: -C (ASE 15.0 ESD #1 /&nbsp;SDK 12.5.1 ESD #5)</h3>
<p>Currently, data is retrieved in plain text when BCP is running against a table that supports encrypted columns, and the user has permission to view the data in the columns.<br />
		The new BCP command line option (-C) allows bulk movement of cipher-text data for authorized users. For this to occur, you must use the -C option, and the table located on the server must support encrypted columns. This results in a SQL command, set ciphertext=on, to be sent to the server before initiating any bulk library routines to produce cipher-text.</p>
<p>&nbsp;</p>
<h3><a name="TOC-Initialization-strings:---initstrin"></a>Initialization strings: --initstring (ASE 15.0 ESD #5)</h3>
<p>	In the following example, replication is disabled when titles.txt data is transferred into the pubs2 titles table:<br />
	<code>bcp pubs2..titles in titles.txt &ndash;-initstring &ldquo;set replication off&rdquo; </code></p>
<p></p>
<h3><a name="TOC-Discard-file-support-for-rejected-r"></a>Discard file support for rejected rows: -d (ASE 15.0 ESD #8)</h3>
</div>
<div>In the following example, BCP&nbsp;creates the discard file reject_titlesfile.txt:<br />
	<code>bcp pubs2..titles in titlesfile.txt -d reject_</code></div>
<div><font color="#006000" face="monospace"><br />
	</font>If you use multiple input files, one discard file is created for every input file that has an erroneous row. If there are no rejected rows, no discard file is created.<br />
	If bcp reaches the maximum errors allowed and stops the operation, the bcp logs all the rows from the beginning of the batch until the failed row.<br />
	Currently, the bcp option -e errorfile logs the rows rejected due to conversion or format errors into an error file. ESD #8 extends the functionality of this option to log all rejected rows including those resulting from inserting duplicate rows when unique constraint is present, inserting into a table-partition that doesn&rsquo;t fit the partition criteria, and truncation of data.</p>
<p></p>
<h3><a name="TOC-Alternate-Sybase-home:--y-New-Featu"></a>Alternate Sybase home: -y (New Features in&nbsp;15.0.2 ESD#5 / SDK 15.0 ESD#2)</h3>
</div>
<div>You can now set an alternate Sybase home directory using the new isql and bcp option -y.</p>
<p></p>
<h3><a name="TOC-bcp64-for-64-bit-products-on-UNIX-p"></a>bcp64 for 64-bit products on UNIX platforms (New Features in 15.5 ESD #9)</h3>
</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<h3><a name="TOC-Usage"></a>Usage</h3>
<p><code>bcp [[database_name.]owner.]table_name [: [ partition_id | slice_number ] |</code><br />
	<code>partition partition_name] {in | out} datafile</code><br />
	<code>[-f formatfile]</code><br />
	<code>[-e errfile] </code><br />
	<code>[-d discardfileprefix]</code><br />
	<code>[-F firstrow]</code><br />
	<code>[-L lastrow]</code><br />
	<code>[-b batchsize]</code><br />
	<code>[-m maxerrors]</code><br />
	<code>[-n]</code><br />
	<code>[-c]</code><br />
	<code>[-t field_terminator]</code><br />
	<code>[-r row_terminator]</code><br />
	<code>[-U username]</code><br />
	<code>[-P password]</code><br />
	<code>[-I interfaces_file]</code><br />
	<code>[-S server]</code><br />
	<code>[-a display_charset]</code><br />
	<code>[-z language]</code><br />
	<code>[-A packet_size]</code><br />
	<code>[-J client_charset]</code><br />
	<code>[-T text_or_image_size]</code><br />
	<code>[-E]</code><br />
	<code>[-g id_start_value]</code><br />
	<code>[-N]</code><br />
	<code>[-W]</code><br />
	<code>[-X]</code><br />
	<code>[-M LabelName LabelValue] </code><br />
	<code>[-labeled]</code><br />
	<code>[-K keytab_file]</code><br />
	<code>[-R remote_server_principal]</code><br />
	<code>[-C]</code><br />
	<code>[-V [security_options]]</code><br />
	<code>[-Z security_mechanism]</code><br />
	<code>[-Q]</code><br />
	<code>[-Y]</code><br />
	<code>[-y sybase directory]</code><br />
	<code>[-x trusted.txt_file]</code><br />
	<code>[--maxconn maximum_connections</code><br />
	<code>[--show-fi]</code><br />
	<code>[--hide-vcc]</code><br />
	<code>[--colpasswd [[[database_name.[owner].table_name.]column_name</code><br />
	<code>[password]]]</code><br />
	<code>[--keypasswd [[database_name.[owner].]key_name [password]]]</code></p>
<div><font color="#000000" face="Arial"><span style="line-height:normal;white-space:pre-wrap;font-size:15px"><br />
	</span></font></div>
<div>
<p>&nbsp;</p>
<hr />
<p>&nbsp;</p>
<h2><a name="TOC-ISQL"></a>ISQL</h2>
</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<h3><a name="TOC-isql-external-error-status-return:-"></a>isql external error status return: --retserverror (ASE&nbsp;15.0.2 ESD#4 /&nbsp;SDK 15.0 ESD#10)</h3>
<div>In this example, isql encounters a server error of severity 16. Since the --retserverror option is specified, isql returns &ldquo;2&rdquo; to the calling shell, prints &ldquo;Msg 207&rdquo; to stderr, and exits. As before, isql prints the full server error message to stdout. The same behavior applies to Windows, where you will find the return value of &ldquo;2&rdquo; in %ERRORLEVEL%:</p>
<p>	<code>$ isql -Uguest -Pguestpwd -SmyASE --retserverror&nbsp;</code><code>2&gt; isql.stderr</code><br />
	<code>1&gt; select no_column from sysobjects</code><br />
	<code>2&gt; go</code><br />
	<code>Msg 207, Level 16, State 4: </code><br />
	<code>Server &#39;myASE&#39;, Line 1: </code><br />
	<code>Invalid column name &#39;no_column&#39;.</code></div>
<p>
	<code>$ echo $?</code><br />
	<code>2</code><br />
	<code>$ cat isql.stderr</code><br />
	<code>Msg 207</code></p>
<p>	&nbsp;</p>
<div>
<div>
<h3 style="border-bottom:rgb(201,208,230) 1px dotted;font-family:Trebuchet MS, arial, sans-serif;color:rgb(119,119,119);font-size:1.4em;font-weight:normal"><a name="TOC-Alternate-Sybase-home:--y-ASE-15.0."></a>Alternate Sybase home: -y (ASE 15.0.2 ESD#5 / SDK 15.0 ESD#2)</h3>
</p></div>
<div>You can now set an alternate Sybase home directory using the new isql and bcp option -y.</div>
<div>
		&nbsp;</div>
<div>
<h3><a name="TOC-Redirects-Append-the-output-of-the-"></a>Redirects/Append the output of the T-SQL command to file_name (ASE 15.0.2 ESD#5 /&nbsp;SDK 15.0 ESD#12)</h3>
<p>		Example 1:</p></div>
<div>Writes the output of the select @@servername command to the file myserver.txt, or overwrites that file if it already exists:<br />
		<code>1&gt; select @@servername</code><br />
		<code>2&gt; go &gt; myserver.txt</code></p>
<p>		Example 2:</p></div>
<div>Writes the output of the select @@version command to the new file myserver.txt, or appends it to that file if it already exists:<br />
		<code>1&gt; select @@version</code><br />
		<code>2&gt; go &gt;&gt; myserver.txt</code></div>
<div><font color="#006000" face="monospace"><br />
		</font></div>
<div><font color="#006000" face="monospace"><br />
		</font></p>
<div style="background-color:transparent">
<h3><a name="TOC-Pipes-the-output-of-the-T-SQL-comma"></a>Pipes the output of the T-SQL command to an external command (ASE 15.0.2 ESD#5 /&nbsp;SDK 15.0 ESD#12)</h3>
</p></div>
<p>		Example:<br />
		Pipes the output of the sp_who command to grep and returns the lines that contain the string &#39;sa&#39;:<br />
		<code>1&gt; sp_who</code><br />
		<code>2&gt; go | grep sa</code></p>
<div style="background-color:transparent"></p>
<h3><a name="TOC-Obfuscated-input:---conceal-ASE-15."></a>Obfuscated input: --conceal (ASE 15.0 ESD #13)</h3>
</p></div>
<div style="background-color:transparent">&nbsp;</div>
<div style="background-color:transparent">With the new --conceal command line option, you can hide your input during an isql session. The --conceal option is useful when entering sensitive information, such as passwords. The syntax for the --conceal option is:<br />
			<code>isql --conceal [&#39;:?&#39; | &#39;wildcard&#39;]</code></div>
<div style="background-color:transparent">
			Example 1:</div>
<div style="background-color:transparent">Changes password without displaying the password entered. This example uses &ldquo;old&rdquo; and &ldquo;new&rdquo; as prompt labels:<br />
			<code>$ isql -Uguest -Pguest -Smyase --conceal</code><br />
			<code>1&gt; sp_password</code><br />
			<code>2&gt; :? old</code><br />
			<code>3&gt; ,</code><br />
			<code>4&gt; <img src='https://www.dbainfo.net/wp-content/uploads/image/smilies/icon_question.gif' alt=':?:' class='wp-smiley' /> ? new</code><br />
			<code>5&gt; go</code><br />
			<code>old</code><br />
			<code>new</code><br />
			<code>Confirm new</code><br />
			<code>Password correctly set.</code><br />
			<code>(return status = 0)</code></p>
<p>			Example 2:</p></div>
<div style="background-color:transparent">Changes password without displaying the password entered. This example uses the default wildcard as the prompt label:<br />
			<code>$ isql -Uguest -Pguest -Smyase --conceal</code><br />
			<code>1&gt; sp_password</code><br />
			<code>2&gt; :?</code><br />
			<code>3&gt; ,</code><br />
			<code>4&gt; <img src='https://www.dbainfo.net/wp-content/uploads/image/smilies/icon_question.gif' alt=':?:' class='wp-smiley' /> ?</code><br />
			<code>5&gt; go</code><br />
			<code>:?</code><br />
			<code>:?</code><br />
			<code>Confirm :?</code><br />
			<code>Password correctly set.</code><br />
			<code>(return status = 0)</code><br />
			&nbsp;</div>
<div style="background-color:transparent">Example 3:</div>
<div style="background-color:transparent">Activates a role for the current user. This example uses a custom wildcard and the prompt labels &ldquo;role&rdquo; and &ldquo;password:&rdquo;<br />
			<code>$ isql -UmyAccount --conceal &#39;*&#39;</code><br />
			<code>Password:</code><br />
			<code>1&gt; set role</code><br />
			<code>2&gt; * role</code><br />
			<code>3&gt; with passwd</code><br />
			<code>4&gt; ** password</code><br />
			<code>5&gt; on</code><br />
			<code>6&gt; go</code><br />
			<code>role</code><br />
			<code>password</code><br />
			<code>Confirm password</code><br />
			<code>1&gt;</code></p>
<p></p>
<h3><a name="TOC-Verbose-usage:---help-ASE-15.0-ESD-"></a>Verbose usage:&nbsp;--help (ASE&nbsp;15.0 ESD #14)</h3>
<p></p>
<h3><a name="TOC-Application-name:---appname-ASE-15."></a>Application name: --appname (ASE 15.0.3 ESD#4 / OCS 15.0 ESD#17 / OCS 15.5)</h3>
<p>			The new isql option --appname allows you to change the default application name isql to the isql client application name. <br />
			<code>isql -Usa -P&hellip; --appname my_app_name</code></p>
<p>			The specified value appears in sysprocesses.program_name</p></div>
<div style="background-color:transparent">
			Why is this useful ?<br />
			&ndash; Various ASE features are related to this application name:</p>
<ul>
<li>Resource limits (sp_add_resource_limit; since ASE 11.5)</li>
<li>Temporary database bindings (sp_tempdb)</li>
<li>Workload Manager (Logical Clusters) in ASE CE</li>
</ul>
<p>			&ndash; Testing these features can be problematic if you cannot set the application name to&nbsp;an arbitrary value; this was not always easy to do (ocs.cfg)</p></div>
<div style="background-color:transparent">&nbsp;</div>
<div style="background-color:transparent">&ndash;&nbsp;This feature simplifies:</p>
<ul>
<li>Testing of Adaptive Server cluster routing rules for incoming client connections based on the client application name.</li>
<li>Switching between alternative settings for isql in $SYBASE/$SYBASE_OCS/config/ocs.cfg, such as between debugging and normal sessions.</li>
<li>Identification of the script that started a particular isql session from within Adaptive Server.</li>
</ul>
<p>
			Example 1:</div>
<div style="background-color:transparent">Sets the application name to &ldquo;isql Session 01&rdquo;:<br />
			<code>$ isql -UmyAccount -SmyServer --appname &quot;isql Session 01&quot;</code><br />
			<code>Password:</code><br />
			<code>1&gt;select program_name from sysprocesses</code><br />
			<code>2&gt;where spid=@@spid</code><br />
			<code>3&gt;go</code><br />
			<code>program_name</code><br />
			<code>-------------------</code><br />
			<code>isql Session 01</code></div>
<div style="background-color:transparent"><font color="#006000" face="monospace"><br />
			</font>Example 2:</div>
<div style="background-color:transparent">Sets the application name to the name of the script that started the isql session:<br />
			<code>$ isql --appname $0</code></div>
<div style="background-color:transparent">
			Example 3:</div>
<div style="background-color:transparent">The following sample ocs.cfg file allows you to run isql normally or with network debug information. Because the configuration file is read and interpreted after the command line parameters are read and interpreted, setting CS_APPNAME to isql sets the application name back to isql:</p>
<p>			<code>;Sample ocs.cfg file </code><br />
			<code>[DEFAULT] </code><br />
			<code>;place holder </code></p>
<p>			<code>[isql] </code><br />
			<code>;place holder </code></p>
<p>			<code>[isql_dbg_net] </code><br />
			<code>CS_DEBUG = CS_DBG_NETWORK </code><br />
			<code>;CS_APPNAME = &quot;isql&quot;</code></div>
<div style="background-color:transparent">
			To run isql normally:<br />
			<code>isql -Uguest</code></div>
<div style="background-color:transparent">
			To run isql with network debug information:<br />
			<code>isql -Uguest --appname isql_dbg_net</code><br />
			&nbsp;</div>
<div>&nbsp;</div>
<h3><a name="TOC-Command-history:---history-ASE-15.0"></a>Command history: --history (ASE 15.0.3 ESD#4 / OCS 15.0 ESD#18 / OCS 15.5)</h3>
</p></div>
<div>&nbsp;</div>
<h4><a name="TOC-Command-history"></a>Command history</h4>
<div>The isql command history feature enables you to list, recall, and reissue past commands. The command history is loaded into memory when you start isql, and is updated whenever a new command is issued. If specified, isql saves the in-memory history to disk when isql shuts down.</p>
<p>		Syntax:</p></div>
<div><code>isql [--history [p]history_length [--history_file history_filename]]</code></div>
<div>
		Parameters:</div>
<div>--history</p>
<ul>
<li>p &ndash; indicates command history persistence; in-memory command history is saved to disk when isql shuts down. If you do not use the p option, the command history log is deleted after its contents are loaded into memory.</li>
<li>history_length &ndash; this parameter, which is required if you use --history, is the number of commands that isql can store in the command history log. The maximum value of history_length is 1024; if a larger value is specified, isql silently truncates it to 1024.</li>
</ul>
<p>		--history_file history_filename &ndash; indicates that isql must retrieve the command history log from history_filename. If p is specified, isql also uses history_filename to store the current session&rsquo;s command history. history_filename can include an absolute or a relative path to the log file. A relative path is based on the current directory. If you do not indicate a path, the history log is saved in the current directory.</p>
<p>		When --history_file is not specified, isql uses the default log file:<br />
		For UNIX: $HOME/.sybase/isql/isqlCmdHistory.log<br />
		For Windows: %APPDATA%\Sybase\isql\isqlCmdHistory.log</p>
<p>		Example 1:</p></div>
<div>Deletes myaseHistory.log after loading its contents to memory. The session&rsquo;s command history is not stored:<br />
		<code>isql -Uguest -Ppassword -Smyase --history 1024 </code><code>--history_file myaseHistory.log</code><br />
		&nbsp;</div>
<div>Example 2:</div>
<div>Loads and saves the command history using the default log file:<br />
		<code>isql -Uguest -Ppassword -Smyase --history p1024</code></div>
<div>&nbsp;</div>
<div>Usage<br />
		The command history feature is available only in command mode. Also, only commands that are issued interactively in isql are included in the command history.</div>
<div>
		Command history contains the most recent commands issued in an isql session. When history_length is reached, isql drops the oldest command from the history and adds the newest command issued.<br />
		If you do not specify an alternate log file, and if the $HOME or %APPDATA% environment variable used by the default log file is not defined, an error message appears and the command history log is not saved.</p>
<h4><a name="TOC-Listing-command-history"></a>Listing command history</h4>
</p></div>
<div>In an isql session, use the h command to display the command history. A page can display up to 24 lines of commands. If the command history contains more than 24 lines, press Enter to display the next set of commands or enter &ldquo;a&rdquo; to display all commands in one page. Enter &ldquo;q&rdquo; to return to isql.</p>
<p>		Syntax:<br />
		<code>h [n]</code></div>
<div>
		Parameter:<br />
		n &ndash; indicates the number of commands to appear. If n is positive, the commands that appear start from the oldest command in the history. If n is negative, the n most recent commands appear.</p>
<p>		Example 1:</p></div>
<div>Lists all the commands stored in the command history:<br />
		<code>1&gt; h</code><br />
		<code>[1] select @@version</code><br />
		<code>[2] select db_name()</code><br />
		<code>[3] select @@servername</code><br />
		<code>1&gt;</code></div>
<div><font color="#006000" face="monospace"><br />
		</font>Example 2:</div>
<div>Lists the two most recent commands issued:<br />
		<code>1&gt; h -2</code><br />
		<code>[2] select db_name()</code><br />
		<code>[3] select @@servername</code><br />
		<code>1&gt;</code></p>
<h4><a name="TOC-Recalling-and-reissuing-commands"></a>Recalling and reissuing commands</h4>
</p></div>
<div>Use the ? command to recall and reissue a command from the command history.</p>
<p>		Syntax:<br />
		<code>? n | ??</code></div>
<div>
		Parameter:<br />
		n &ndash; when n is positive, isql looks for the command labeled with the number n and loads this to the command buffer. When n is negative, isql loads the nth most recent command issued.<br />
		?? &ndash; recalls the latest command issued and is equivalent to ? -1.</p>
<p>		Examples:<br />
		In this sample command history used for examples 1 and 2, [1] tags the oldest command issued and [3] tags the most recent command issued:<br />
		<code>[1] select @@version</code><br />
		<code>[2] select db_name</code><br />
		<code>[3] select @@servername</code></div>
<div>
		Example 1:</div>
<div>Recalls the command labeled 1 from the command history:<br />
		<code>1&gt; ? 1</code><br />
		<code>1&gt; select @@version</code><br />
		<code>2&gt;</code></div>
<div><font color="#006000" face="monospace"><br />
		</font>Example 2:</div>
<div>Recalls the latest issued command from the command history:<br />
		<code>1&gt; ? -1</code><br />
		<code>1&gt; select @@servername</code><br />
		<code>2&gt;</code></div>
<div>
		Usage:<br />
		When a command is recalled from history, the recalled command overwrites the command in the command buffer.<br />
		You can edit a recalled command before resubmitting the command to the server.</p>
<div style="line-height:normal;background-color:transparent;font-family:Times New Roman;color:rgb(0,0,0);font-size:medium"><span style="background-color:transparent;font-variant:normal;font-style:normal;font-family:Arial;white-space:pre-wrap;color:rgb(0,0,0);font-size:11pt;vertical-align:baseline;font-weight:normal;text-decoration:none"><br />
			</span></div>
<h3 style="border-bottom:rgb(201,208,230) 1px dotted;font-family:Trebuchet MS, arial, sans-serif;color:rgb(119,119,119);font-size:1.4em;font-weight:normal"><a name="TOC-isql64-for-64-bit-products-on-UNIX-"></a>isql64 for 64-bit products on UNIX platforms (New Features 15.5 ESD #9)</h3>
</p></div>
</div>
<h3><a name="TOC-Usage1"></a>Usage</h3>
<div><span style="font-family:courier new, monospace">isql [option1] [option2] ... where [options] are ...</span></div>
<div>
<div><font face="'courier new', monospace">&nbsp; -b &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Disables the display of the table headers output.</font></div>
<div><font face="'courier new', monospace">&nbsp; -e &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Echoes input.</font></div>
<div><font face="'courier new', monospace">&nbsp; -F &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enables the FIPS flagger.</font></div>
<div><font face="'courier new', monospace">&nbsp; -p &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Prints performance statistics.</font></div>
<div><font face="'courier new', monospace">&nbsp; -n &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Removes numbering and prompt symbol when used with -e.</font></div>
<div><font face="'courier new', monospace">&nbsp; -v &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Prints the version number and copyright message.</font></div>
<div><font face="'courier new', monospace">&nbsp; -W &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Turn off extended password encryption on</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;connection retries.</font></div>
<div><font face="'courier new', monospace">&nbsp; -X &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Initiates the login connection to the server with</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;client-side password encryption.</font></div>
<div><font face="'courier new', monospace">&nbsp; -Y &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Tells the Adaptive Server to use chained transactions.</font></div>
<div><font face="'courier new', monospace">&nbsp; -Q &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Enables the HAFAILOVER property.</font></div>
<div><font face="'courier new', monospace">&nbsp; -a display_charset &nbsp; Used in conjunction with -J to specify the character set</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;translation file (.xlt file) required for the conversion.</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Use -a without -J only if the client character set is</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;the same as the default character set.</font></div>
<div><font face="'courier new', monospace">&nbsp; -A packet_size &nbsp; &nbsp; &nbsp; Specifies the network packet size to use for</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this isql session.</font></div>
<div><font face="'courier new', monospace">&nbsp; -c cmdend &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Changes the command terminator.</font></div>
<div><font face="'courier new', monospace">&nbsp; -D database &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Selects the database in which the isql session begins.</font></div>
<div><font face="'courier new', monospace">&nbsp; -E editor &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Specifies an editor other than the default editor vi.</font></div>
<div><font face="'courier new', monospace">&nbsp; -h header &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Specifies the number of rows to print between</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;column headings.</font></div>
<div><font face="'courier new', monospace">&nbsp; -H hostname &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Sets the client host name.</font></div>
<div><font face="'courier new', monospace">&nbsp; -i inputfile &nbsp; &nbsp; &nbsp; &nbsp; Specifies the name of the operating system file</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;to use for input to isql.</font></div>
<div><font face="'courier new', monospace">&nbsp; -I interfaces_file &nbsp; Specifies the name and location of the interfaces file.</font></div>
<div><font face="'courier new', monospace">&nbsp; -J client_charset &nbsp; &nbsp;Specifies the character set to use on the client.</font></div>
<div><font face="'courier new', monospace">&nbsp; -K keytab_file &nbsp; &nbsp; &nbsp; Specifies the path to the keytab file used</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for authentication in DCE.</font></div>
<div><font face="'courier new', monospace">&nbsp; -l login_timeout &nbsp; &nbsp; Specifies the number of seconds to wait for the server</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;to respond to a login attempt.</font></div>
<div><font face="'courier new', monospace">&nbsp; -m errorlevel &nbsp; &nbsp; &nbsp; &nbsp;Customizes the error message display.</font></div>
<div><font face="'courier new', monospace">&nbsp; -M labelname labelvalue</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Used for security labels. See CS_SEC_NEGOTIATE</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for more details.</font></div>
<div><font face="'courier new', monospace">&nbsp; -o outputfile &nbsp; &nbsp; &nbsp; &nbsp;Specifies the name of an operating system file to</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;store the output from isql.</font></div>
<div><font face="'courier new', monospace">&nbsp; -P password &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Specifies your Adaptive Server password.</font></div>
<div><font face="'courier new', monospace">&nbsp; -R remote_server_principal</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Specifies the principal name for the server as defined</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;to the security mechanism.</font></div>
<div><font face="'courier new', monospace">&nbsp; -s col_separator &nbsp; &nbsp; Resets the column separator character, which is</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;blank by default.</font></div>
<div><font face="'courier new', monospace">&nbsp; -S server_name &nbsp; &nbsp; &nbsp; Specifies the name of the Adaptive Server to which.</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;to connect to.</font></div>
<div><font face="'courier new', monospace">&nbsp; -t timeout &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Specifies the number of seconds before a SQL command</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;times out.</font></div>
<div><font face="'courier new', monospace">&nbsp; -U username &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Specifies a login name. Login names are case sensitive.</font></div>
<div><font face="'courier new', monospace">&nbsp; -V [security_options]</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Specifies network-based user authentication.</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Valid [security_options]:</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c - Enable data confidentiality service.</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i - Enable data integrity service.</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;m - Enable mutual authentication for connection</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;establishment.</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;o - Enable data origin stamping service.</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;q - Enable out-of-sequence detection.</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;r - Enable data replay detection.</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;d - Requests credential delegation and forwards</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;client credentials.</font></div>
<div><font face="'courier new', monospace">&nbsp; -w column_width &nbsp; &nbsp; &nbsp;Sets the screen width for output.</font></div>
<div><font face="'courier new', monospace">&nbsp; -y sybase_directory &nbsp;Sets an alternate location for the Sybase home directory.</font></div>
<div><font face="'courier new', monospace">&nbsp; -z localename &nbsp; &nbsp; &nbsp; &nbsp;Sets the official name of an alternate language to</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;display isql prompts and messages.</font></div>
<div><font face="'courier new', monospace">&nbsp; -Z security_mechanism</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Specifies the name of a security mechanism to use</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;on the connection.</font></div>
<div><font face="'courier new', monospace">&nbsp; -x trusted.txt_file &nbsp;Specifies an alternate trusted.txt file location.</font></div>
<div><font face="'courier new', monospace">&nbsp; --retserverror &nbsp; &nbsp; &nbsp; Forces isql to terminate and return a failure code when</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;it encounters a server error of severity greater than 10.</font></div>
<div><font face="'courier new', monospace">&nbsp; --conceal [wildcard] Obfuscates input in an ISQL session. The optional</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;wildcard will be used as a prompt.</font></div>
<div><font face="'courier new', monospace">&nbsp; --appname application_name</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Replaces the default &#39;isql&#39; application name in</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;the server with &#39;application_name&#39;.</font></div>
<div><font face="'courier new', monospace">&nbsp; --history [p]length [--history_file file_name]</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Activates command history of &lt;length&gt; commands in isql.</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;With &#39;p&#39; history will be saved at the end of the session.</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;--history_file file_name &nbsp;Path to, and including name of</font></div>
<div><font face="'courier new', monospace">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;the command history file.</font></div>
</div>
<div>&nbsp;</div>
<h2><a name="TOC-Sources"></a>Sources</h2>
<div>
<div style="line-height:normal;background-color:transparent;color:rgb(0,0,0)">
<h3 style="font-family:Times New Roman;font-size:medium"><a name="TOC-New-Features-Open-Server-15.5-and-S"></a><span style="background-color:transparent;font-variant:normal;font-style:normal;font-family:Arial;white-space:pre-wrap;color:rgb(0,0,0);font-size:11pt;vertical-align:baseline;font-weight:normal;text-decoration:none">New Features Open Server&trade; 15.5 and SDK 15.5 for Windows, Linux, UNIX, and Mac OS X</span></h3>
<p>		<span style="background-color:transparent;font-variant:normal;font-style:normal;font-family:Arial;white-space:pre-wrap;color:rgb(0,0,0);font-size:11pt;vertical-align:baseline;font-weight:normal;text-decoration:none"><a href="http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc20155.1550/html/newfesd/title.htm" rel="nofollow" target="_blank">http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc20155.1550/html/newfesd/title.htm</a></span></p>
<h3><a name="TOC-New-Features-Open-Server-15.0-and-S"></a><span style="background-color:transparent;font-variant:normal;font-style:normal;font-family:Arial;white-space:pre-wrap;color:rgb(0,0,0);font-size:11pt;vertical-align:baseline;font-weight:normal;text-decoration:none">New Features Open Server&trade; 15.0 and SDK 15.0 for Microsoft Windows, Linux, UNIX, and Mac OS X</span></h3>
<p>		<span style="background-color:transparent;font-variant:normal;font-style:normal;font-family:Arial;white-space:pre-wrap;color:rgb(0,0,0);font-size:11pt;vertical-align:baseline;font-weight:normal;text-decoration:none"><a href="http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc20155.1500/html/newfesd/title.htm" rel="nofollow" target="_blank">http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc20155.1500/html/newfesd/title.htm</a></span></div>
</div>
<div style="line-height:normal;background-color:transparent;font-family:Times New Roman;color:rgb(0,0,0);font-size:medium"><span style="background-color:transparent;font-variant:normal;font-style:normal;font-family:Arial;white-space:pre-wrap;color:rgb(0,0,0);font-size:11pt;vertical-align:baseline;font-weight:normal;text-decoration:none"><br />
	</span></div>
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/isqlbcp_news.htm">https://www.dbainfo.net/isqlbcp_news.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/isqlbcp_news.htm">Sybase ASE 15.x版本中bcp和isql工具的新特性</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2014-05-26 -- <a href="https://www.dbainfo.net/isql_client_password_encryption_fails.htm" title="isql登录ASE报Client password encryption fails问题解决">isql登录ASE报Client password encryption fails问题解决</a> (0)</li><li>2013-11-19 -- <a href="https://www.dbainfo.net/showplan_html_format.htm" title="以HTML格式显示ASE查询计划">以HTML格式显示ASE查询计划</a> (0)</li><li>2011-09-19 -- <a href="https://www.dbainfo.net/steps-to-imigrate-sybase-ase-database-on-aix-platform.htm" title="AIX平台上Sybase ASE数据库迁移步骤">AIX平台上Sybase ASE数据库迁移步骤</a> (0)</li><li>2011-03-16 -- <a href="https://www.dbainfo.net/sybase-ase15-5-new-features.htm" title="Sybase ASE 15.5 新特性">Sybase ASE 15.5 新特性</a> (0)</li><li>2011-03-16 -- <a href="https://www.dbainfo.net/sybase-ase-1503-new-features.htm" title="Sybase ASE 15.0.3新特性">Sybase ASE 15.0.3新特性</a> (2)</li><li>2011-02-25 -- <a href="https://www.dbainfo.net/sybase-ase155-new-features.htm" title="SYBASE ASE 15.5六大新特性揭秘">SYBASE ASE 15.5六大新特性揭秘</a> (0)</li><li>2010-12-23 -- <a href="https://www.dbainfo.net/import-datetime-date-to-oracle-from-sybase-ase.htm" title="从sybase向oracle导入时间类型的数据">从sybase向oracle导入时间类型的数据</a> (0)</li><li>2010-11-10 -- <a href="https://www.dbainfo.net/sybase-central-export-import-table-data.htm" title="利用Sybase Central 导出与导入表内数据">利用Sybase Central 导出与导入表内数据</a> (0)</li><li>2010-09-25 -- <a href="https://www.dbainfo.net/generate-bcp-in-table-syntax-fast.htm" title="快速生成bcp in导表命令行的方法">快速生成bcp in导表命令行的方法</a> (0)</li><li>2010-09-14 -- <a href="https://www.dbainfo.net/bcp-out-disable-character-set-convertion.htm" title="bcp导出数据时禁止字符集转化">bcp导出数据时禁止字符集转化</a> (2)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/isqlbcp_news.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AIX平台上Sybase ASE数据库迁移步骤</title>
		<link>https://www.dbainfo.net/steps-to-imigrate-sybase-ase-database-on-aix-platform.htm</link>
		<comments>https://www.dbainfo.net/steps-to-imigrate-sybase-ase-database-on-aix-platform.htm#comments</comments>
		<pubDate>Mon, 19 Sep 2011 14:47:41 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[Sybase ASE]]></category>
		<category><![CDATA[Unix&Linux]]></category>
		<category><![CDATA[AIX]]></category>
		<category><![CDATA[BCP]]></category>
		<category><![CDATA[create database]]></category>
		<category><![CDATA[ddlgen]]></category>
		<category><![CDATA[迁移]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/?p=1124</guid>
		<description><![CDATA[将生产环境中AIX5.3平台上的Sybase ASE12.5.2迁移到备机作测试用，下面简单记录下主要步骤。 环境： Sybase ASE version: 12.5.2 32bit OS Version: AIX 5.3 $SYBASE: /home/syb123 Instance name: TEST database name: testdb 备机上建立好了与主机相同的vg与lv &#160; 主要步骤： 1.将主机上的目录/home/syb123打包，拷贝到备机，解开tar包到备机的相同目录下。删除备机/home/syb123下的interfaces文件。 2.修改资源文件resource file中的实例名(srvbuild.server_name)，主机名(srvbuild.network_hostname_list)等信息。主要有3个rs文件： syb_dataserver.rs，syb_backupserver.rs，syb_sqlloc.rs 3.新建Sybase ASE实例。执行： srvbuildres -r /home/syb123/syb_dataserver.rs 在新建实例的过程中，因为异步IO没有开启，报错Symbol resolution failed for /usr/ccs/lib/libc.a[aio_64.o] 。解决方法见： AIX上未启动异步IO导致Sybase服务创建失败 4.配置字符集roman8。 源数据库的字符集为roman8，使用资源文件配置新建的备机上的字符集为roman8、排序规则为：bin_roman8。unix/linux环境上新建的实例默认没有安装bin_roman8这个排序规则，需要手动添加： cd /home/syb123/charsets/roman8 charset&#160; -Usa -P -STEST binary.srt roman8 然后在执行：srvbuildres -r /home/syb123/syb_sqlloc.rs 来修改实例的默认字符集和排序规则。 5.新建备份服务 srvbuildres [...]]]></description>
			<content:encoded><![CDATA[<p>将生产环境中AIX5.3平台上的Sybase ASE12.5.2迁移到备机作测试用，下面简单记录下主要步骤。</p>
<p>环境：</p>
<p>Sybase ASE version: 12.5.2 32bit</p>
<p>OS Version: AIX 5.3</p>
<p>$SYBASE: /home/syb123</p>
<p>Instance name: TEST</p>
<p>database name: testdb</p>
<p>备机上建立好了与主机相同的vg与lv</p>
<p>&nbsp;</p>
<p><strong>主要步骤：</strong></p>
<p>1.将主机上的目录/home/syb123打包，拷贝到备机，解开tar包到备机的相同目录下。删除备机/home/syb123下的interfaces文件。<span id="more-1124"></span></p>
<p>2.修改资源文件resource file中的实例名(srvbuild.server_name)，主机名(srvbuild.network_hostname_list)等信息。主要有3个rs文件： syb_dataserver.rs，syb_backupserver.rs，syb_sqlloc.rs</p>
<p>3.新建Sybase ASE实例。执行：</p>
<p>srvbuildres -r /home/syb123/syb_dataserver.rs</p>
<p>在新建实例的过程中，因为异步IO没有开启，报错Symbol resolution failed for /usr/ccs/lib/libc.a[aio_64.o] 。解决方法见：</p>
<p><a href="https://www.dbainfo.net/aix-fail-to-create-install-of-aio.htm" target="_blank">AIX上未启动异步IO导致Sybase服务创建失败<br />
	</a></p>
<p>4.配置字符集roman8。</p>
<p>源数据库的字符集为roman8，使用资源文件配置新建的备机上的字符集为roman8、排序规则为：bin_roman8。unix/linux环境上新建的实例默认没有安装bin_roman8这个排序规则，需要手动添加：</p>
<blockquote>
<p>cd /home/syb123/charsets/roman8</p>
<p>charset&nbsp; -Usa -P -STEST binary.srt roman8</p>
</blockquote>
<p>然后在执行：srvbuildres -r /home/syb123/syb_sqlloc.rs 来修改实例的默认字符集和排序规则。</p>
<p>5.新建备份服务</p>
<p>srvbuildres -r /home/syb123/syb_backupserver.rs</p>
<p>6.从源实例中导出disk init脚本</p>
<p>使用下面的SQL语句能够导出：</p>
<blockquote>
<p>select &#39;disk init name=&quot;&#39;+name+&#39;&quot;,physname=&quot;&#39;+phyname+&#39;&quot;,size=&quot;&#39;+convert(varchar,convert(int,(high-low+1)*2.0/1024.0))+&#39;M&quot;&#39;+char(10)+&#39;go&#39; from master.dbo.sysdevices<br />
		where low/power(2,24)&gt;0<br />
		go</p>
</blockquote>
<p>7.导出create database语句</p>
<p>使用ddlgen导出源实例中用户数据库的create database语句。</p>
<p>/home/syb123/ASEP/bin/ddlgen -Usa -P -STEST -TDB -Ntestdb -O./ddlgen-testdb.sql</p>
<p>从上面的输出文件ddlgen-testdb.sql中将create database命令提取出来，加上for load选项。类似如下的命令：</p>
<blockquote>
<p>create database test on .....</p>
<p>log on ......</p>
<p>for load</p>
<p>go</p>
</blockquote>
<p>8.在备机上上初始化设备和创建用户数据库</p>
<p>在执行disk init命令先配置参数： number of devices，</p>
<p>sp_configure &quot;number of devices&quot;,50</p>
<p>go</p>
<p>然后分别执行上面得到的disk init命令来初始化Sybase逻辑设备，执行create database来创建用户数据库以备恢复用。</p>
<p>在create database命令中加入for load选项，能够提高创建库的速度，因为不需要将逻辑设备上的页面清空。</p>
<p>9.恢复源数据库</p>
<p>在备机上恢复从主机上拷贝过来的testdb数据库的备份。</p>
<blockquote>
<p>load database testdb from &#39;/syb_backup/testdb20110920.dump&#39;</p>
<p>go</p>
</blockquote>
<p>在主机上备份数据库testdb的时候，加入了压缩选项：compress=4。在恢复的时候不需要加入压缩选项，sybase备份服务器能够自动识别压缩级别。这点还是挺方便的！</p>
<p>10.增加临时数据库tempdb的空间</p>
<p>alter database tempdb on tempdb_data01=&#39;4000m&#39;</p>
<p>11.在备机将数据库testdb的属主有sa改为syb</p>
<blockquote>
<p>use testdb</p>
<p>go</p>
<p>sp_changedbowner syb</p>
<p>go</p>
</blockquote>
<p>12.重建登录、角色、用户信息</p>
<p>因为主机与备机是相同的平台，可以直接导出源实例master数据库中系统表的数据。从源实例中导出下面4张系统表的数据。</p>
<p>syslogins，sysloginroles，sysroles，sysusers</p>
<p>在备机上导入：</p>
<p>先开启选项：allow updates to system catalog。sp_configure &quot;allow updates&quot;,1</p>
<p>导入4张系统表的数据，只追加新添加的登录、用户信息。</p>
<blockquote>
<p>bcp master.dbo.syslogins in ./syslogins-20110920.bcpout -c -Usa -P -STEST -t~# <strong>-b1</strong></p>
<p>bcp master.dbo.sysloginroles in ./sysloginroles-20110920.bcpout -c -Usa -P -STEST -t~# <strong><span style="font-size:14px;">-b1</span></strong></p>
<p>bcp master.dbo.sysroles in ./sysroles-20110920.bcpout -c -Usa -P -STEST -t~#<span style="font-size:14px;"><strong> -b1</strong></span></p>
<p>bcp master.dbo.sysusers in ./sysusers-20110920.bcpout -c -Usa -P -STEST -t~# <strong><span style="font-size:14px;">-b1</span></strong></p>
</blockquote>
<p>13.配置用户数据库testdb的options</p>
<blockquote>
<p>use master</p>
<p>go</p>
<p>sp_dboption testdb,&#39;select into&#39;,true</p>
<p>go</p>
<p>sp_dboption testdb,&#39;trunc&#39;,true</p>
<p>go</p>
<p>use testdb</p>
<p>go</p>
<p>checkpoint</p>
<p>go</p>
</blockquote>
<p>14.配置备机的参数</p>
<p>如果备机与主机环境相同的话，可以将主机上的<em>&lt;servername&gt;</em>.cfg直接拷贝到备机。否则，根据主机的cfg文件适当调整sybase ase的参数。</p>
<p>15.备份master数据库、导出几张重要系统表的数据</p>
<p>初始化设备、新建数据库，添加登录等操作后，要及时备份master数据库。最好对几张重要的系统表再做一次备份。使用bcp导出系统表sysusages,sysdatabases,sysdevices,syslogins,sysloginroles,sysroles,sysusers。</p>
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/steps-to-imigrate-sybase-ase-database-on-aix-platform.htm">https://www.dbainfo.net/steps-to-imigrate-sybase-ase-database-on-aix-platform.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/steps-to-imigrate-sybase-ase-database-on-aix-platform.htm">AIX平台上Sybase ASE数据库迁移步骤</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2014-08-19 -- <a href="https://www.dbainfo.net/some-useful-ddlgen-command.htm" title="ddlgen的常用语句">ddlgen的常用语句</a> (0)</li><li>2013-07-18 -- <a href="https://www.dbainfo.net/create-ase-server-by-manual.htm" title="手动创建ASE服务器">手动创建ASE服务器</a> (0)</li><li>2011-09-20 -- <a href="https://www.dbainfo.net/isqlbcp_news.htm" title="Sybase ASE 15.x版本中bcp和isql工具的新特性">Sybase ASE 15.x版本中bcp和isql工具的新特性</a> (0)</li><li>2011-09-19 -- <a href="https://www.dbainfo.net/aix-fail-to-create-install-of-aio.htm" title="AIX上未启动异步IO导致Sybase服务创建失败">AIX上未启动异步IO导致Sybase服务创建失败</a> (0)</li><li>2011-06-02 -- <a href="https://www.dbainfo.net/aix-date-change-time-zone-to-get-date.htm" title="aix系统可以用改变时区的方法获取前后N天的日期">aix系统可以用改变时区的方法获取前后N天的日期</a> (0)</li><li>2011-01-24 -- <a href="https://www.dbainfo.net/add_user_database_by_disk_init_create_database_comman.htm" title="用命令行创建用户数据库">用命令行创建用户数据库</a> (1)</li><li>2010-12-23 -- <a href="https://www.dbainfo.net/import-datetime-date-to-oracle-from-sybase-ase.htm" title="从sybase向oracle导入时间类型的数据">从sybase向oracle导入时间类型的数据</a> (0)</li><li>2010-12-22 -- <a href="https://www.dbainfo.net/cross-platform-datafile-linux-windows.htm" title="跨平台数据库的数据设备文件迁移linux > windows">跨平台数据库的数据设备文件迁移linux > windows</a> (0)</li><li>2010-11-10 -- <a href="https://www.dbainfo.net/sybase-central-export-import-table-data.htm" title="利用Sybase Central 导出与导入表内数据">利用Sybase Central 导出与导入表内数据</a> (0)</li><li>2010-11-10 -- <a href="https://www.dbainfo.net/ase-create-user-database-by-sybase-central.htm" title="利用Sybase Central创建用户数据库">利用Sybase Central创建用户数据库</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/steps-to-imigrate-sybase-ase-database-on-aix-platform.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>从sybase向oracle导入时间类型的数据</title>
		<link>https://www.dbainfo.net/import-datetime-date-to-oracle-from-sybase-ase.htm</link>
		<comments>https://www.dbainfo.net/import-datetime-date-to-oracle-from-sybase-ase.htm#comments</comments>
		<pubDate>Thu, 23 Dec 2010 02:20:55 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Sybase ASE]]></category>
		<category><![CDATA[ASE]]></category>
		<category><![CDATA[BCP]]></category>
		<category><![CDATA[date]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/%e4%bb%8esybase%e5%90%91oracle%e5%af%bc%e5%85%a5%e6%97%b6%e9%97%b4%e7%b1%bb%e5%9e%8b%e7%9a%84%e6%95%b0%e6%8d%ae.htm</guid>
		<description><![CDATA[例：有表 --sybase create table t_test( mydate datetime) go --oracle create t_test(mydate date) 方法1：在sybase侧建立视图，然后从导出视图(此方法舍弃了毫秒部分) create view v_test as select convert(varchar(10),pst_exec_stime,111)+&#39; &#39;+convert(varchar(9),pst_exec_stime,8) mydate from t_test go format文件如下(c:\test.fmt) 10.0 1 1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SYBCHAR&#160;&#160;&#160;&#160;&#160; 0&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 20&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#34;\t&#34;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; my_date 命令 C:\&#62;bcp testdb..v_test out c:\test.dat -f c:\test.fmt &#8211;Uusername &#8211;Ppassword &#8211;Ssybser Oracle导入control文件如下（c:\test.ctl） Load data Infile &#34;c:\test.dat&#34; Badfile &#34;c:\test.bad&#34; Append into table t_test [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size: 12px;"><span style="font-family: 宋体;">例：有表 </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">--sybase</span><span style="font-family: 宋体;"> </span></span></p>
<blockquote>
<p><span style="font-size: 12px;"><span style="font-family: Century;">create table t_test(</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">mydate datetime</span></span><span style="font-family: Century;">)</span><span style="font-family: 宋体;"> </span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">go</span><span style="font-family: 宋体;"> </span></span></p>
</blockquote>
<p><span style="font-size: 12px;"><span style="font-family: Century;">--oracle</span><span style="font-family: 宋体;"> </span></span></p>
<blockquote>
<p><span style="font-size: 12px;"><span style="font-family: Century;">create t_test(</span></span><span style="font-family: Century;">mydate date</span><span style="font-family: Century;">)</span><span style="font-family: 宋体;"> </span></p>
</blockquote>
<p><span style="font-size: 14px;"><strong><span style="font-family: 宋体;">方法</span><span style="font-family: Century;">1</span><span style="font-family: 宋体;">：在</span><span style="font-family: Century;">sybase</span><span style="font-family: 宋体;">侧建立视图，然后从导出视图</span><span style="font-family: Century;">(</span><span style="font-family: 宋体;">此方法舍弃了毫秒部分</span><span style="font-family: Century;">)</span><span style="font-family: 宋体;"> </span></strong></span></p>
<blockquote>
<p><span style="font-size: 12px;"><span style="font-family: Century;">create view v_test as </span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">select </span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">convert(varchar(10),pst_exec_stime,111)+&#39; &#39;+convert(varchar(9),pst_exec_stime,8) mydate</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">from t_test</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">go<span id="more-627"></span></span><span style="font-family: 宋体;"> </span></span></p>
</blockquote>
<p><span style="font-size: 12px;"><span style="font-family: Century;">format</span><span style="font-family: 宋体;">文件如下</span><span style="font-family: Century;">(c:\test.fmt)</span><span style="font-family: 宋体;"> </span></span></p>
<blockquote>
<p><span style="font-size: 12px;"><span style="font-family: Century;">10.0</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">1</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYBCHAR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;\t&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my_date</span><span style="font-family: 宋体;"> </span></span></p>
</blockquote>
<p><span style="font-size: 12px;"><span style="font-family: 宋体;">命令 </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">C:\&gt;<strong>bcp testdb..v_test out c:\test.dat -f c:\test.fmt &ndash;Uusername &ndash;Ppassword &ndash;Ssybser </strong></span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Oracle</span><span style="font-family: 宋体;">导入</span><span style="font-family: Century;">control</span><span style="font-family: 宋体;">文件如下（</span><span style="font-family: Century;">c:\test.ctl</span><span style="font-family: 宋体;">） </span></span></p>
<blockquote>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Load data</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Infile &quot;c:\test.dat&quot;</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Badfile &quot;c:\test.bad&quot;</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Append into table t_test</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Fields terminated by</span><span style="font-family: 宋体;">&#39;</span><span style="font-family: Century;">\t</span><span style="font-family: 宋体;">&#39;</span><span style="font-family: Century;">(</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Mydate &quot;yyyy/mm/dd hh24:mi:ss&quot;</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">)</span><span style="font-family: 宋体;"> </span></span></p>
</blockquote>
<p><span style="font-size: 12px;"><span style="font-family: 宋体;">命令 </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">C:\&gt;<strong>sqlldr <a href="mailto:username/password@sid"><span style="color: blue; text-decoration: underline;">username/password@sid</span></a> control=&quot;c:\test.ctl&quot; log=&quot;test.log&quot;</strong></span><span style="font-family: 宋体;"> </span></span></p>
<p><strong><span style="font-size: 14px;"><span style="font-family: 宋体;">方法</span><span style="font-family: Century;">2</span><span style="font-family: 宋体;">：和方法</span><span style="font-family: Century;">1</span><span style="font-family: 宋体;">类似不过不用建视图（此方法舍弃了毫秒部分） </span></span></strong></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">format</span><span style="font-family: 宋体;">文件如下</span><span style="font-family: Century;">(c:\test.fmt)</span><span style="font-family: 宋体;"> </span></span></p>
<blockquote>
<p><span style="font-size: 12px;"><span style="font-family: Century;">10.0</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">1</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SYBCHAR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 26&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;\t&quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; my_date</span><span style="font-family: 宋体;"> </span></span></p>
</blockquote>
<p><span style="font-size: 12px;"><span style="font-family: 宋体;">命令 </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">C:\&gt;<strong>bcp testdb..t_test out c:\test.dat -f c:\test.fmt &ndash;Uusername &ndash;Ppassword &ndash;Ssybser </strong></span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Oracle</span><span style="font-family: 宋体;">导入</span><span style="font-family: Century;">control</span><span style="font-family: 宋体;">文件如下（</span><span style="font-family: Century;">c:\test.ctl</span><span style="font-family: 宋体;">） </span></span></p>
<blockquote>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Load data</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Infile &quot;c:\test.dat&quot;</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Badfile &quot;c:\test.bad&quot;</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Append into table t_test</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Fields terminated by</span><span style="font-family: 宋体;">&#39;</span><span style="font-family: Century;">\t</span><span style="font-family: 宋体;">&#39;</span><span style="font-family: Century;">(</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Mydate &quot;DECODE(:mydate,NULL,TO_DATE(&#39;&#39;,&#39;MM-DD-YYYY&#39;),TO_DATE(SUBSTRB(:mydate,1,instrb(:mydate,&#39;:&#39;,-1)-1)||&#39; &#39;|| SUBSTRB(:mydate,-2),,&#39;Mon dd yyyy hh:mi:ss PM&#39;))&quot;</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">)</span><span style="font-family: 宋体;"> </span></span></p>
</blockquote>
<p><span style="font-size: 12px;"><span style="font-family: 宋体;">命令 </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">C:\&gt;<strong>sqlldr <a href="mailto:username/password@sid"><span style="color: blue; text-decoration: underline;">username/password@sid</span></a> control=&quot;c:\test.ctl&quot; log=&quot;test.log&quot;</strong></span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: 宋体;">如果</span><span style="font-family: Century;">sybase</span><span style="font-family: 宋体;">和</span><span style="font-family: Century;">oracle</span><span style="font-family: 宋体;">的语言不一致，即导入的</span><span style="font-family: Century;">am/pm</span><span style="font-family: 宋体;">保留字为上午</span><span style="font-family: Century;">/</span><span style="font-family: 宋体;">下午什么的可以在</span><span style="font-family: Century;">sqlldr</span><span style="font-family: 宋体;">之前执行如下命令，转换成和</span><span style="font-family: Century;">sybase</span><span style="font-family: 宋体;">一致的语言 </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">C:\&gt;set NLS_LANG=American(</span><span style="font-family: 宋体;">美国语</span><span style="font-family: Century;">)</span><span style="font-family: 宋体;"> </span></span></p>
<p><strong><span style="font-size: 14px;"><span style="font-family: 宋体;">方法</span><span style="font-family: Century;">3</span><span style="font-family: 宋体;">：</span><span style="font-family: Century;">9i</span><span style="font-family: 宋体;">以上版本适用，在方法</span><span style="font-family: Century;">2</span><span style="font-family: 宋体;">的基础上进行改动即可（此方法保留毫秒部分） </span></span></strong></p>
<p><span style="font-size: 12px;"><span style="font-family: 宋体;">将方法</span><span style="font-family: Century;">2</span><span style="font-family: 宋体;">的</span><span style="font-family: Century;">Oracle</span><span style="font-family: 宋体;">导入</span><span style="font-family: Century;">control</span><span style="font-family: 宋体;">文件修改如下（</span><span style="font-family: Century;">c:\test.ctl</span><span style="font-family: 宋体;">） </span></span></p>
<blockquote>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Load data</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Infile &quot;c:\test.dat&quot;</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Badfile &quot;c:\test.bad&quot;</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Append into table t_test</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Fields terminated by</span><span style="font-family: 宋体;">&#39;</span><span style="font-family: Century;">\t</span><span style="font-family: 宋体;">&#39;</span><span style="font-family: Century;">(</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">Mydate timestamp &quot;MON DD YYYY HH:MI:SS:FF3AM&quot;</span><span style="font-family: 宋体;"> </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: Century;">)</span><span style="font-family: 宋体;"> </span></span></p>
</blockquote>
<p><span style="font-size: 12px;"><span style="font-family: 宋体;">其他同方法</span><span style="font-family: Century;">2 </span></span></p>
<p><span style="font-size: 12px;"><span style="font-family: 宋体;">转自：</span><span style="font-family: Century;">http://hi.baidu.com/teemzhang/blog/item/bc709a8625b9503a66096e0f.html</span></span></p>
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/import-datetime-date-to-oracle-from-sybase-ase.htm">https://www.dbainfo.net/import-datetime-date-to-oracle-from-sybase-ase.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/import-datetime-date-to-oracle-from-sybase-ase.htm">从sybase向oracle导入时间类型的数据</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2011-10-14 -- <a href="https://www.dbainfo.net/history-of-common-databases.htm" title="各数据库的发展历史">各数据库的发展历史</a> (0)</li><li>2010-11-09 -- <a href="https://www.dbainfo.net/sybase-ase-current-date-last_day.htm" title="Sybase ASE v15.x中查询本月最后一天的日期的3种实现方法">Sybase ASE v15.x中查询本月最后一天的日期的3种实现方法</a> (0)</li><li>2019-04-12 -- <a href="https://www.dbainfo.net/sybase-ase-asa-recovery-service.htm" title="Sybase ASE及SQL Anywhere数据库修复专家">Sybase ASE及SQL Anywhere数据库修复专家</a> (0)</li><li>2015-01-16 -- <a href="https://www.dbainfo.net/one-way-to-recover-master-configuration-area.htm" title="master数据库配置区域(configuration area)损坏的一种修复方法">master数据库配置区域(configuration area)损坏的一种修复方法</a> (1)</li><li>2014-10-10 -- <a href="https://www.dbainfo.net/ase-object-name-length-limit.htm" title="ASE对象名称长度限制">ASE对象名称长度限制</a> (0)</li><li>2014-06-09 -- <a href="https://www.dbainfo.net/count_all_tables_rowcount.htm" title="统计用户数据库内所有表的行数">统计用户数据库内所有表的行数</a> (0)</li><li>2013-11-19 -- <a href="https://www.dbainfo.net/showplan_html_format.htm" title="以HTML格式显示ASE查询计划">以HTML格式显示ASE查询计划</a> (0)</li><li>2013-11-11 -- <a href="https://www.dbainfo.net/ase-15-0-3-for-windows-installation5.htm" title="Sybase ASE 15.0.3 for windows平台安装文档 – 5、安装后的配置工作">Sybase ASE 15.0.3 for windows平台安装文档 – 5、安装后的配置工作</a> (1)</li><li>2013-11-11 -- <a href="https://www.dbainfo.net/ase-15-0-3-for-windows-installation4.htm" title="Sybase ASE 15.0.3 for windows平台安装文档 – 4、安装Sybase数据库服务">Sybase ASE 15.0.3 for windows平台安装文档 – 4、安装Sybase数据库服务</a> (0)</li><li>2013-11-11 -- <a href="https://www.dbainfo.net/ase-15-0-3-for-windows-installation3.htm" title="Sybase ASE 15.0.3 for windows平台安装文档 – 3、升级到 Sybase 15.0.3 ESD #3">Sybase ASE 15.0.3 for windows平台安装文档 – 3、升级到 Sybase 15.0.3 ESD #3</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/import-datetime-date-to-oracle-from-sybase-ase.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>利用Sybase Central 导出与导入表内数据</title>
		<link>https://www.dbainfo.net/sybase-central-export-import-table-data.htm</link>
		<comments>https://www.dbainfo.net/sybase-central-export-import-table-data.htm#comments</comments>
		<pubDate>Wed, 10 Nov 2010 07:19:56 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[Sybase ASE]]></category>
		<category><![CDATA[BCP]]></category>
		<category><![CDATA[Sybase Central]]></category>
		<category><![CDATA[导出数据]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/%e5%88%a9%e7%94%a8sybase-central-%e5%af%bc%e5%87%ba%e4%b8%8e%e5%af%bc%e5%85%a5%e8%a1%a8%e5%86%85%e6%95%b0%e6%8d%ae.htm</guid>
		<description><![CDATA[导出表数据到文本文件 在用户表名上点右键，选择批量复制(bcp)下的输出菜单。 选择导出文件的路径。可以针对每个表分区分别指定输出文件路径。此表systbl_Counters仅有一个roundrobin分区。选择将所有分区的数据保存到：c:\sybase\dbo_systbl_Counters_BCP.out。 点下一步， 选择导出文件的格式：字符形式还是本地形式。选择字符形式。点下一步， 选择字符分隔符、行分隔符。将列分隔符指定为：&#124;&#124;@@&#124;&#124; ， 行分隔符指定为换行符(\n) 最大错误行数为：10。点完成后则开始导出数据到本地文件的过程。 根据表内数据量的大小，需要等待响应的时间。导出完成后，显示如下: 在日志文件中可以看到导出的表数据的总行数、导出时间、已经每秒导出的数据量。 其中有： C:\sybase\OCS-15_0\bin\bcp.exe pmdb.dbo.systbl_Counters out C:\sybase\dbo_systbl_Counters_BCP.out -c -t &#34;&#124;&#124;@@&#124;&#124;&#34; -r \n -U sa -P sybase -S Sybultranms 这就是导出数据时实际利用的命令。 将上面的bcp命令行放到命令提示符下执行，导出的数据和Sybase Central中导出命令向导是一样的。 &#160; 2.从文本文件向表中导入数据 &#160; 在交互式SQL中执行如下的SQL语句创建一张和表systbl_Counters的结构完全相同的临时表：systbl_Counters_import。临时表systbl_Counters_import中没有索引。 select * into systbl_Counters_import from systbl_Counters where 1=2 &#160; 在表名systbl_Counters_import上点右键，选择批量复制(bcp)，选择输入菜单， 可以为表的每个分区指定输入文件。选择文档前面演示的表systbl_Counters导出的文件。点下一步， 因为前面是按照字符形式导出的表数据，所以，此处必须选择字符型。点下一步， 选择字符分割符和行分隔符。要和导出表数据时指定的字符分隔符和行分隔符保持一致。点完成后开始向表systbl_Counters_import导入数据。 等待一段时间后，导入完成，日志显示如下： 平均每秒导入：1699行。 &#160; 实际上，数据导入向导执行的命令语句为： C:\sybase\OCS-15_0\bin\bcp.exe pmdb.dbo.systbl_Counters_import in C:\sybase\dbo_systbl_Counters_BCP.out [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>
<div style="text-align: justify;">
<h4><span style="font-size: 12pt;">导出表数据到文本文件 </span></h4>
</p></div>
</li>
</ol>
<p>在用户表名上点右键，选择批量复制(bcp)下的输出菜单。</p>
<p style="text-align: center;"><img alt="" src="https://www.dbainfo.net/wp-content/uploads/2010/11/111010_0719_SybaseCentr1.png" /></p>
<p>选择导出文件的路径。可以针对每个表分区分别指定输出文件路径。此表systbl_Counters仅有一个roundrobin分区。选择将所有分区的数据保存到：c:\sybase\dbo_systbl_Counters_BCP.out。 点下一步，</p>
<p style="text-align: center;"><img alt="" src="https://www.dbainfo.net/wp-content/uploads/2010/11/111010_0719_SybaseCentr2.png" /></p>
<p>选择导出文件的格式：字符形式还是本地形式。选择字符形式。点下一步，<span id="more-459"></span></p>
<p style="text-align: center;"><img alt="" src="https://www.dbainfo.net/wp-content/uploads/2010/11/111010_0719_SybaseCentr3.png" /></p>
<p>选择字符分隔符、行分隔符。将列分隔符指定为：||@@|| ， 行分隔符指定为换行符(\n) 最大错误行数为：10。点完成后则开始导出数据到本地文件的过程。</p>
<p style="text-align: center;"><img alt="" src="https://www.dbainfo.net/wp-content/uploads/2010/11/111010_0719_SybaseCentr4.png" /></p>
<p>根据表内数据量的大小，需要等待响应的时间。导出完成后，显示如下:</p>
<p style="text-align: center;"><img alt="" src="https://www.dbainfo.net/wp-content/uploads/2010/11/111010_0719_SybaseCentr5.png" /></p>
<p>在日志文件中可以看到导出的表数据的总行数、导出时间、已经每秒导出的数据量。</p>
<p>其中有：</p>
<p><span style="background-color: rgb(217, 217, 217);">C:\sybase\OCS-15_0\bin\bcp.exe pmdb.dbo.systbl_Counters out C:\sybase\dbo_systbl_Counters_BCP.out -c -t &quot;||@@||&quot; -r \n -U sa -P sybase -S Sybultranms </span></p>
<p>这就是导出数据时实际利用的命令。</p>
<p>将上面的bcp命令行放到命令提示符下执行，导出的数据和Sybase Central中导出命令向导是一样的。</p>
<p>&nbsp;</p>
<h4><span style="font-size: 12pt;">2.从文本文件向表中导入数据 </span></h4>
<p>&nbsp;</p>
<p>在交互式SQL中执行如下的SQL语句创建一张和表systbl_Counters的结构完全相同的临时表：systbl_Counters_import。临时表systbl_Counters_import中没有索引。</p>
<p><span style="background-color: rgb(217, 217, 217);">select * into systbl_Counters_import from systbl_Counters where 1=2 </span></p>
<p>&nbsp;</p>
<p>在表名systbl_Counters_import上点右键，选择批量复制(bcp)，选择输入菜单，</p>
<p style="text-align: center;"><img alt="" src="https://www.dbainfo.net/wp-content/uploads/2010/11/111010_0719_SybaseCentr6.png" /></p>
<p>可以为表的每个分区指定输入文件。选择文档前面演示的表systbl_Counters导出的文件。点下一步，</p>
<p style="text-align: center;"><img alt="" src="https://www.dbainfo.net/wp-content/uploads/2010/11/111010_0719_SybaseCentr7.png" /></p>
<p>因为前面是按照字符形式导出的表数据，所以，此处必须选择字符型。点下一步，</p>
<p style="text-align: center;"><img alt="" src="https://www.dbainfo.net/wp-content/uploads/2010/11/111010_0719_SybaseCentr8.png" /></p>
<p>选择字符分割符和行分隔符。要和导出表数据时指定的字符分隔符和行分隔符保持一致。点完成后开始向表systbl_Counters_import导入数据。</p>
<p>等待一段时间后，导入完成，日志显示如下：</p>
<p style="text-align: center;"><img alt="" src="https://www.dbainfo.net/wp-content/uploads/2010/11/111010_0719_SybaseCentr9.png" /></p>
<p>平均每秒导入：1699行。</p>
<p>&nbsp;</p>
<p>实际上，数据导入向导执行的命令语句为：</p>
<p><span style="background-color: rgb(217, 217, 217);">C:\sybase\OCS-15_0\bin\bcp.exe pmdb.dbo.systbl_Counters_import in C:\sybase\dbo_systbl_Counters_BCP.out -c -t &quot;||@@||&quot; -r \n -U sa -P sybase -S Sybultranms </span></p>
<p>&nbsp;</p>
<p style="text-align: center;"><img alt="" src="https://www.dbainfo.net/wp-content/uploads/2010/11/111010_0719_SybaseCentr10.png" /></p>
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/sybase-central-export-import-table-data.htm">https://www.dbainfo.net/sybase-central-export-import-table-data.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/sybase-central-export-import-table-data.htm">利用Sybase Central 导出与导入表内数据</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2012-11-14 -- <a href="https://www.dbainfo.net/sybase-ase-job-scheduler-schedule-jobs.htm" title="在Sybase ASE上利用job scheduler定时调度作业">在Sybase ASE上利用job scheduler定时调度作业</a> (7)</li><li>2012-03-07 -- <a href="https://www.dbainfo.net/sybase-ase12-5-4-client-tool-sybase-central-without-installation-version.htm" title="免安装（绿色版）的ASE客户端工具Sybase Centralv4.3">免安装（绿色版）的ASE客户端工具Sybase Centralv4.3</a> (12)</li><li>2011-09-20 -- <a href="https://www.dbainfo.net/isqlbcp_news.htm" title="Sybase ASE 15.x版本中bcp和isql工具的新特性">Sybase ASE 15.x版本中bcp和isql工具的新特性</a> (0)</li><li>2011-09-19 -- <a href="https://www.dbainfo.net/steps-to-imigrate-sybase-ase-database-on-aix-platform.htm" title="AIX平台上Sybase ASE数据库迁移步骤">AIX平台上Sybase ASE数据库迁移步骤</a> (0)</li><li>2011-08-30 -- <a href="https://www.dbainfo.net/sybase-ase12-5-client-tool-sybase-central-without-installation-version.htm" title="免安装（绿色版）的Sybase ASE12.5附带的客户端工具Sybase Central v3.2">免安装（绿色版）的Sybase ASE12.5附带的客户端工具Sybase Central v3.2</a> (3)</li><li>2010-12-23 -- <a href="https://www.dbainfo.net/import-datetime-date-to-oracle-from-sybase-ase.htm" title="从sybase向oracle导入时间类型的数据">从sybase向oracle导入时间类型的数据</a> (0)</li><li>2010-11-10 -- <a href="https://www.dbainfo.net/database-operation-by-sybase-central.htm" title="利用Sybase Central简单操作Sybase ASE数据库">利用Sybase Central简单操作Sybase ASE数据库</a> (4)</li><li>2010-11-10 -- <a href="https://www.dbainfo.net/connnect-to-sybase-ase-by-sybase-central-client-tool.htm" title="用Sybase Central连接Sybase ASE数据库">用Sybase Central连接Sybase ASE数据库</a> (0)</li><li>2010-11-10 -- <a href="https://www.dbainfo.net/install-sybase-ase-15_0_3-client.htm" title="安装Sybase ASE 15.0.3客户端">安装Sybase ASE 15.0.3客户端</a> (52)</li><li>2010-11-10 -- <a href="https://www.dbainfo.net/ase-create-user-database-by-sybase-central.htm" title="利用Sybase Central创建用户数据库">利用Sybase Central创建用户数据库</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/sybase-central-export-import-table-data.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>快速生成bcp in导表命令行的方法</title>
		<link>https://www.dbainfo.net/generate-bcp-in-table-syntax-fast.htm</link>
		<comments>https://www.dbainfo.net/generate-bcp-in-table-syntax-fast.htm#comments</comments>
		<pubDate>Sat, 25 Sep 2010 02:45:22 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[Sybase ASE]]></category>
		<category><![CDATA[BCP]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/?p=326</guid>
		<description><![CDATA[把从Sybase或其它类型数据库导出的文本文件再次导入到sybase数据库的时候，bcp是个很好的工具。 本博客已有3篇关于bcp的文章： 1.关于BCP工具的使用，介绍三个方面的东西 2.关于Sybase中的快bcp 3.bcp导出数据时禁止字符集转化 &#160; 如果要用bcp导入很多的表，对每一个表都要写一条语句是件很费劲的事情，尤其表数量很多的时候。简单的方法呢？ 第一种方法： 利用SQL语句 在bcp out导出数据的时候，也就是生成相应的bcp out命令语句的时候，也同时生成bcp in导入的命令语句。 生成导出语句的SQL为： select&#160; &#34;bcp &#34;+db_name()+&#34;.&#34;+user_name(uid)+&#34;.&#34;+name+&#34;&#160; out /tmp/databcpout/&#34; +name+ &#34;.txt -Usa -P&#60;sa_passwd&#62; -S&#60;server_name&#62;&#160; -c -T10000000 &#34; from sysobjects where type=&#39;U&#39; order by name 其中： 将&#60;sa_passwd&#62;，server_name&#62; 分别替换成sa的密码和数据库服务器名。或者用对想要导出的表有查询权限的用户也行。 生成导入语句的SQL为： select&#160; &#34;bcp &#34;+db_name()+&#34;.&#34;+user_name(uid)+&#34;.&#34;+name+&#34;&#160; in /tmp/databcpout/&#34; +name+ &#34;.txt -Usa -P&#60;sa_passwd&#62; -S&#60;server_name&#62;&#160; -c -T10000000 -b10000 &#34; from sysobjects where [...]]]></description>
			<content:encoded><![CDATA[<p>把从Sybase或其它类型数据库导出的文本文件再次导入到sybase数据库的时候，bcp是个很好的工具。</p>
<blockquote>
<h2><span style="font-size: 12px;">本博客已有3篇关于bcp的文章：</span></h2>
<ul>
<li><a href="https://www.dbainfo.net/bcp-utility-usages.htm"><span style="font-size: 12px;">1.关于BCP工具的使用，介绍三个方面的东西 </span></a></li>
<li><a href="https://www.dbainfo.net/sybase-fast-bcp-utility.htm"><span style="font-size: 12px;">2.关于Sybase中的快bcp </span></a></li>
<li><a href="https://www.dbainfo.net/bcp-out-disable-character-set-convertion.htm"><span style="font-size: 12px;">3.bcp导出数据时禁止字符集转化</span></a></li>
</ul>
<p>&nbsp;</p>
</blockquote>
<p>如果要用bcp导入很多的表，对每一个表都要写一条语句是件很费劲的事情，尤其表数量很多的时候。简单的方法呢？</p>
<p><span style="font-size: 16px;"><strong>第一种方法： 利用SQL语句</strong></span></p>
<p>
	在bcp out导出数据的时候，也就是生成相应的bcp out命令语句的时候，也同时生成bcp in导入的命令语句。</p>
<p>生成导出语句的SQL为：</p>
<blockquote>
<p>select&nbsp; &quot;bcp &quot;+db_name()+&quot;.&quot;+user_name(uid)+&quot;.&quot;+name+&quot;&nbsp; out /tmp/databcpout/&quot; +name+ &quot;.txt -Usa -P<em>&lt;sa_passwd&gt;</em> -S<em>&lt;server_name&gt;</em>&nbsp; -c -T10000000 &quot; from sysobjects where type=&#39;U&#39; order by name</p>
</blockquote>
<p>其中： 将&lt;sa_passwd&gt;，server_name&gt; 分别替换成sa的密码和数据库服务器名。或者用对想要导出的表有查询权限的用户也行。<span id="more-326"></span></p>
<p>生成导入语句的SQL为：</p>
<blockquote>
<p>select&nbsp; &quot;bcp &quot;+db_name()+&quot;.&quot;+user_name(uid)+&quot;.&quot;+name+&quot;&nbsp; in /tmp/databcpout/&quot; +name+ &quot;.txt -Usa -P<em>&lt;sa_passwd&gt; </em>-S<em>&lt;server_name&gt;</em>&nbsp; -c -T10000000 -b10000 &quot; from sysobjects where type=&#39;U&#39; order by name</p>
</blockquote>
<p>&nbsp;</p>
<p><strong><span style="font-size: 16px;">第二种方法： 利用操作系统的工具生成导入命令</span></strong></p>
<p>windows上生成导入命令的方法：</p>
<p>假设windows上导出的文本文件的扩展名为txt</p>
<blockquote>
<p>FOR /F &quot;usebackq tokens=4,* delims= &quot; %i IN (`dir`) DO @echo bcp <em>your_db_name</em>.dbo.%~ni in %i -c -Usa -P<em>sa_passwd&nbsp; </em>-S<em>server_name</em> -r\n -b10000</p>
</blockquote>
<p>其中：将your_db_name,sa_passwd,server_name分别替换成被导入表所在的数据库，sa的密码，sybase数据库服务名。</p>
<p>-r\n 这个参数是指定导入的文本文件中是unix系统的上换行符。因为这些文件是从solaris数据库服务器上执行bcp得到的。 在windows机器上执行bcp out导出的文本文件中的换行符为：回车+新行 \r\n</p>
<p>如果想在bcp in导入数据前，将表内原来的数据先清空，则可以用下面的命令生成truncate table的SQL语句。</p>
<blockquote>
<p>FOR /F &quot;usebackq tokens=4,* delims= &quot; %i IN (`dir`) DO @echo truncate <em>your_db_name</em>.dbo.%~ni</p>
</blockquote>
<p>其中：将your_db_name替换成数据库名，确定一下数据库所有者是否为dbo。将生成的SQL语句拷贝到isql下批量执行截断表。</p>
<p><strong><span style="color: rgb(255, 0, 0);">Solaris上用awk实现的命令如下：<br />
	</span></strong></p>
<blockquote>
<p>find . -name &quot;*.txt&quot; | awk -F&quot;.&quot; &#39;{print $2}&#39;| awk -F&quot;/&quot; &#39;{print &quot;bcp pmdb.dbo.&quot; $3&nbsp; &quot; in .&quot; $0 &quot;.txt -Usa -Psybase -Ssyb1503 -c -T10000000 -b10000 &quot;}&#39;</p>
</blockquote>
<p>在windows上执行上面的语句的时候，每行的输出结果可能很多，可能会出现折行的情况。</p>
<p>调整命令提示符&gt;布局&gt;屏幕缓存区大小中的宽度和高度即可，如下图：</p>
<p><a href="https://www.dbainfo.net/wp-content/uploads/image/command-property-layout-width-height.jpg" class="highslide-image" onclick="return hs.expand(this);"><img alt="" src="https://www.dbainfo.net/wp-content/uploads/image/command-property-layout-width-height.jpg" /></a></p>
<p>&nbsp;</p>
<p>参考awk以及find命令的用法:</p>
<p>awk用法小结 http://hi.baidu.com/linxhchina/blog/item/8cadc42a4897709b023bf640.html</p>
<p>用du find命令查找文件及用awk 汇总文件大小 http://tlinle.blog.51cto.com/251944/389117</p>
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/generate-bcp-in-table-syntax-fast.htm">https://www.dbainfo.net/generate-bcp-in-table-syntax-fast.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/generate-bcp-in-table-syntax-fast.htm">快速生成bcp in导表命令行的方法</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2011-09-20 -- <a href="https://www.dbainfo.net/isqlbcp_news.htm" title="Sybase ASE 15.x版本中bcp和isql工具的新特性">Sybase ASE 15.x版本中bcp和isql工具的新特性</a> (0)</li><li>2011-09-19 -- <a href="https://www.dbainfo.net/steps-to-imigrate-sybase-ase-database-on-aix-platform.htm" title="AIX平台上Sybase ASE数据库迁移步骤">AIX平台上Sybase ASE数据库迁移步骤</a> (0)</li><li>2010-12-23 -- <a href="https://www.dbainfo.net/import-datetime-date-to-oracle-from-sybase-ase.htm" title="从sybase向oracle导入时间类型的数据">从sybase向oracle导入时间类型的数据</a> (0)</li><li>2010-11-10 -- <a href="https://www.dbainfo.net/sybase-central-export-import-table-data.htm" title="利用Sybase Central 导出与导入表内数据">利用Sybase Central 导出与导入表内数据</a> (0)</li><li>2010-09-14 -- <a href="https://www.dbainfo.net/bcp-out-disable-character-set-convertion.htm" title="bcp导出数据时禁止字符集转化">bcp导出数据时禁止字符集转化</a> (2)</li><li>2010-07-11 -- <a href="https://www.dbainfo.net/ase-15-bcp-out-table-by-conditions.htm" title="ASE15.x的bcp能够实现按照条件导出表内数据">ASE15.x的bcp能够实现按照条件导出表内数据</a> (1)</li><li>2010-03-16 -- <a href="https://www.dbainfo.net/sybase-fast-bcp-utility.htm" title="关于Sybase中的快bcp">关于Sybase中的快bcp</a> (0)</li><li>2009-11-24 -- <a href="https://www.dbainfo.net/bcp-utility-usages.htm" title="关于BCP工具的使用，介绍三个方面的东西">关于BCP工具的使用，介绍三个方面的东西</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/generate-bcp-in-table-syntax-fast.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>bcp导出数据时禁止字符集转化</title>
		<link>https://www.dbainfo.net/bcp-out-disable-character-set-convertion.htm</link>
		<comments>https://www.dbainfo.net/bcp-out-disable-character-set-convertion.htm#comments</comments>
		<pubDate>Tue, 14 Sep 2010 07:05:35 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[Sybase ASE]]></category>
		<category><![CDATA[BCP]]></category>
		<category><![CDATA[字符集]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/?p=286</guid>
		<description><![CDATA[Sybase ASE15.0及以后的版本中的bcp命令实用工具中有个-Y参数，这个参数的作用是：禁用在服务器中的字符集转化，在使用bcp in时由bcp在客户端上执行字符集转化过程。 只有ASE15.0或更高版本中支持客户端unicode转化。 另外：所有字符集转化都是在bcp out期间在服务器中执行的。 &#160; &#160; &#160; &#160; 本文链接地址：https://www.dbainfo.net/bcp-out-disable-character-set-convertion.htm； 本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载； 转载务必注明原始出处 : Sybase数据库技术，数据库恢复专家； 对《bcp导出数据时禁止字符集转化》有何疑问或见解，请在本文下方发表； 对网站还有其他问题或建议，请提交在留言板，谢谢！ 相关文章2013-04-02 -- 使用第三方工具访问ASE表时汉字乱码问题的解决方法 (1)2011-09-20 -- Sybase ASE 15.x版本中bcp和isql工具的新特性 (0)2011-09-19 -- AIX平台上Sybase ASE数据库迁移步骤 (0)2010-12-23 -- 从sybase向oracle导入时间类型的数据 (0)2010-12-20 -- Sybae ASE中支持简体中文的字符集 (2)2010-11-10 -- 利用Sybase Central 导出与导入表内数据 (0)2010-09-25 -- 快速生成bcp in导表命令行的方法 (0)2010-09-14 -- 用Sybase Central连接ASE数据库乱码问题的解决 (2)2010-09-13 -- Sybase ASE 15.0.3 for [...]]]></description>
			<content:encoded><![CDATA[<p>Sybase ASE15.0及以后的版本中的bcp命令实用工具中有个-Y参数，这个参数的作用是：禁用在服务器中的字符集转化，在使用bcp in时由bcp在客户端上执行字符集转化过程。</p>
<p>只有ASE15.0或更高版本中支持客户端unicode转化。</p>
<p>另外：所有字符集转化都是在bcp out期间在服务器中执行的。</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/bcp-out-disable-character-set-convertion.htm">https://www.dbainfo.net/bcp-out-disable-character-set-convertion.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/bcp-out-disable-character-set-convertion.htm">bcp导出数据时禁止字符集转化</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2013-04-02 -- <a href="https://www.dbainfo.net/ase-3rt-party-tools-illegal-chinese-words.htm" title="使用第三方工具访问ASE表时汉字乱码问题的解决方法">使用第三方工具访问ASE表时汉字乱码问题的解决方法</a> (1)</li><li>2011-09-20 -- <a href="https://www.dbainfo.net/isqlbcp_news.htm" title="Sybase ASE 15.x版本中bcp和isql工具的新特性">Sybase ASE 15.x版本中bcp和isql工具的新特性</a> (0)</li><li>2011-09-19 -- <a href="https://www.dbainfo.net/steps-to-imigrate-sybase-ase-database-on-aix-platform.htm" title="AIX平台上Sybase ASE数据库迁移步骤">AIX平台上Sybase ASE数据库迁移步骤</a> (0)</li><li>2010-12-23 -- <a href="https://www.dbainfo.net/import-datetime-date-to-oracle-from-sybase-ase.htm" title="从sybase向oracle导入时间类型的数据">从sybase向oracle导入时间类型的数据</a> (0)</li><li>2010-12-20 -- <a href="https://www.dbainfo.net/ase-character-set-support-simplified-chinese.htm" title="Sybae ASE中支持简体中文的字符集">Sybae ASE中支持简体中文的字符集</a> (2)</li><li>2010-11-10 -- <a href="https://www.dbainfo.net/sybase-central-export-import-table-data.htm" title="利用Sybase Central 导出与导入表内数据">利用Sybase Central 导出与导入表内数据</a> (0)</li><li>2010-09-25 -- <a href="https://www.dbainfo.net/generate-bcp-in-table-syntax-fast.htm" title="快速生成bcp in导表命令行的方法">快速生成bcp in导表命令行的方法</a> (0)</li><li>2010-09-14 -- <a href="https://www.dbainfo.net/sybase-central-ase-character-set.htm" title="用Sybase Central连接ASE数据库乱码问题的解决">用Sybase Central连接ASE数据库乱码问题的解决</a> (2)</li><li>2010-09-13 -- <a href="https://www.dbainfo.net/sybase-ase-1503-character-set-utf8-chinese-language.htm" title="Sybase ASE 15.0.3 for windows 安装中文语言支持、配置字符集">Sybase ASE 15.0.3 for windows 安装中文语言支持、配置字符集</a> (0)</li><li>2010-09-07 -- <a href="https://www.dbainfo.net/sybase-ase-objectname-case-insensitive.htm" title="如何使Sybase ASE中对象名不区分大小写？">如何使Sybase ASE中对象名不区分大小写？</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/bcp-out-disable-character-set-convertion.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
