亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ch08.htm

?? 21精通SQL
?? HTM
?? 第 1 頁 / 共 4 頁
字號:

</BLOCKQUOTE>

<H2><FONT COLOR="#000077">Importing and Exporting Data from Foreign Sources</FONT></H2>
<P>The <TT>INSERT</TT>, <TT>UPDATE</TT>, and <TT>DELETE</TT> statements are extremely
useful from within a database program. They are used with the <TT>SELECT</TT> statement
to provide the foundation for all other database operations you will perform. However,
SQL as a language does not have a way to import or export of data from foreign data
sources. For instance, your office may have been using a dBASE application for several
years now that has outgrown itself. Now your manager wants to convert this application
to a client/server application using the Oracle RDBMS. Unfortunately for you, these
dBASE files contain thousands of records that must be converted to an Oracle database.
Obviously, the <TT>INSERT</TT>, <TT>UPDATE</TT>, and <TT>DELETE</TT> commands will
help you after your Oracle database has been populated, but you would rather quit
than retype 300,000 records. Fortunately, Oracle and other manufacturers provide
tools that will assist you in this task.</P>
<P>Nearly all database systems allow you to import and export data using ASCII text
file formats. Although the SQL language does not include this feature, SQL will not
do you (or your boss) much good when you have an empty database. We will examine
the import/export tools available in the following products: Microsoft Access, Microsoft
and Sybase SQL Server, and Personal Oracle7.
<H3><FONT COLOR="#000077">Microsoft Access</FONT></H3>
<P>Microsoft Access is a PC-only database product that contains many of the features
of a relational database management system. Access also includes powerful reporting
tools, a macro language similar to Visual Basic, and the capability to import and
export data from various database and text file formats. This section examines this
last feature, particularly the capability to export to delimited text files. Delimited
means that each field is separated, or delimited, by some special character. This
character is often a comma, a quotation mark, or a space.</P>
<P>Access allows you to import and export various database formats, including dBASE,
FoxPro, and SQL Database. The SQL Database option is actually an ODBC data source
connection. (Microsoft ODBC is covered on Day 13, &quot;Advanced SQL Topics.&quot;)
For this discussion, you want to select the Export option and then choose the Text
(Fixed Width) option.</P>
<P>After opening an Access database (with the File | Open), select Export. A Destination
dialog box (for Exporting) is displayed. Select the Text (Fixed Width) option. This
option allows you to output your Access tables to text files in which each data type
is a fixed width. For example, a character data field of length 30 will be output
to the file as a field 30 characters long. If the field's data takes up less space
than 30 characters, it will be padded with spaces. Eventually, you will be asked
to set up the export file format. Figure 8.1 shows the Import/Export Setup dialog
box.</P>
<P><A NAME="01"></A><A HREF="01-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/01-1.htm"><B>Figure 8.1.<BR>
</B></A><I>The Import/Export Setup dialog box.</I></P>
<P>Notice that in this dialog box you can select the Text Delimiter and the Field
Separator for your export file. As a final step, save the specification for use later.
This specification is stored internally within the database.
<H3><FONT COLOR="#000077">Microsoft and Sybase SQL Server</FONT></H3>
<P>Microsoft and Sybase have jointly developed a powerful database system that is
very popular in client/server application development. The name of this system is
SQL Server. Microsoft has agreed to develop versions of the RDBMS for some platforms,
and Sybase has developed its version for all the other platforms (usually the larger
ones). Although the arrangement has changed somewhat in recent years, we mention
this agreement here to help you avoid confusion when you begin examining the various
database systems available on the market today.</P>
<P>SQL Server provides file import/export capabilities with the bcp tool. bcp is
short for &quot;bulk copy.&quot; The basic concept behind bcp is the same as that
behind Microsoft Access. Unfortunately, the bcp tool requires you to issue commands
from the operating system command prompt, instead of through dialog boxes or windows.</P>
<P>Bcp imports and exports fixed-width text files. It is possible to export a file
using the Microsoft Access method described earlier and then import that same file
directly into an SQL Server table using bcp. bcp uses format files (usually with
an <TT>.FMT</TT> extension) to store the import specification. This specification
tells bcp the column names, field widths, and field delimiters. You can run bcp from
within an SQL database build script to completely import data after the database
has been built.
<H3><FONT COLOR="#000077">Personal Oracle7</FONT></H3>
<P>Personal Oracle7 allows you to import and export data from ASCII text files containing
delimited or fixed-length records. The tool you use is SQL*Loader. This graphical
tool uses a control file (with the <TT>.CTL</TT> extension). This file is similar
to SQL Server's format (FMT) file. The information contained in this file tells SQL*Loader
what it needs to know to load the data from the file.</P>
<P>The SQL*Loader dialog box appears in Figure 8.2.</P>
<P><A NAME="02"></A><A HREF="02-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/02-1.htm"><B>Figure 8.2.<BR>
</B></A><I>The SQL*Loader dialog box.</I></P>
<H2><FONT COLOR="#000077">Summary</FONT></H2>
<P>SQL provides three statements that you can use to manipulate data within a database.</P>
<P>The <TT>INSERT</TT> statement has two variations. The <TT>INSERT...VALUES</TT>
statement inserts a set of values into one record. The <TT>INSERT...SELECT</TT> statement
is used in combination with a <TT>SELECT</TT> statement to insert multiple records
into a table based on the contents of one or more tables. The <TT>SELECT</TT> statement
can join multiple tables, and the results of this join can be added to another table.</P>
<P>The <TT>UPDATE</TT> statement changes the values of one or more columns based
on some condition. This updated value can also be the result of an expression or
calculation.</P>
<P>The <TT>DELETE</TT> statement is the simplest of the three statements. It deletes
all rows from a table based on the result of an optional <TT>WHERE</TT> clause. If
the <TT>WHERE</TT> clause is omitted, all records from the table are deleted.</P>
<P>Modern database systems supply various tools for data manipulation. Some of these
tools enable developers to import or export data from foreign sources. This feature
is particularly useful when a database is upsized or downsized to a different system.
Microsoft Access, Microsoft and Sybase SQL Server, and Personal Oracle7 include many
options that support the migration of data between systems.
<H2><FONT COLOR="#000077">Q&amp;A</FONT></H2>

<DL>
	<DD><B>Q Does SQL have a statement for file import/export operations?</B>
	<P><B>A</B> No. Import and export are implementation-specific operations. In other
	words, the ANSI committee allows individual manufacturers to create whatever features
	or enhancements they feel are necessary.</P>
	<P><B>Q Can I copy data from a table into itself using the </B>INSERT<B> command?
	I would like to make duplicate copies of all the existing records and change the
	value of one field.</B></P>
	<P><B>A</B> No, you cannot insert data into the same table that you selected from.
	However, you can select the original data into a temporary table. (True temporary
	tables are discussed on Day 14.) Then modify the data in this temporary table and
	select back into the original table. Make sure that you watch out for unique fields
	you may have already created. A unique field means that the particular field must
	contain a unique value for each row of data that exists in its table.</P>
	<P><B>Q You have stressed using caution when issuing </B>INSERT<B>, </B>UPDATE<B>,
	and </B>DELETE <B>commands, but simple fixes seem to be available to correct whatever
	I did wrong. Is that a fair statement?</B></P>
	<P><B>A </B>Yes. For example, a simple way to fix a misspelled name is to issue a
	<TT>ROLLBACK</TT> command and redo the insert. Another fix would be to do an update
	to fix the name. Or you could delete the row and redo the insert with the corrected
	spelling of the name.</P>
	<P>But suppose you inserted a million rows into a table and didn't notice that you
	had misspelled a name when you issued the <TT>COMMIT</TT> command. A few weeks later,
	someone notices some bad data. You have had two weeks' worth of database activity.
	You would more than likely have to issue individual updates to make individual corrections,
	instead of making any type of global change. In most cases you probably will not
	know what to change. You may have to restore the database.
</DL>

<H2><FONT COLOR="#000077">Workshop</FONT></H2>
<P>The Workshop provides quiz questions to help solidify your understanding of the
material covered, as well as exercises to provide you with experience in using what
you have learned. Try to answer the quiz and exercise questions before checking the
answers in Appendix F, &quot;Answers to Quizzes and Exercises.&quot;
<H3><FONT COLOR="#000077">Quiz</FONT></H3>

<DL>
	<DD><B>1. </B>What is wrong with the following statement?
</DL>



<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">DELETE COLLECTION;</FONT></PRE>

</BLOCKQUOTE>


<DL>
	<DD><B>2. </B>What is wrong with the following statement?
</DL>



<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">INSERT INTO COLLECTION 
SELECT * FROM TABLE_2</FONT></PRE>

</BLOCKQUOTE>


<DL>
	<DD><B>3. </B>What is wrong with the following statement?
</DL>



<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">UPDATE COLLECTION (&quot;HONUS WAGNER CARD&quot;, 
25000, &quot;FOUND IT&quot;);</FONT></PRE>

</BLOCKQUOTE>


<DL>
	<DD><B>4.</B> What would happen if you issued the following statement?
</DL>



<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">SQL&gt; <B>DELETE * FROM COLLECTION;</B></FONT></PRE>

</BLOCKQUOTE>


<DL>
	<P><B>5.</B> What would happen if you issued the following statement?
</DL>



<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">SQL&gt; <B>DELETE FROM COLLECTION;</B></FONT></PRE>

</BLOCKQUOTE>


<DL>
	<DD><B>6. </B>What would happen if you issued the following statement?
</DL>



<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">SQL&gt; <B>UPDATE COLLECTION
     SET WORTH = 555
     SET REMARKS = 'UP FROM 525';</B></FONT></PRE>

</BLOCKQUOTE>


<DL>
	<DD><B>7. </B>Will the following SQL statement work?
</DL>



<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">SQL&gt; I<B>NSERT INTO COLLECTION
     SET VALUES = 900
     WHERE ITEM = 'STRING';</B></FONT></PRE>

</BLOCKQUOTE>


<DL>
	<DD><B>8. </B>Will the following SQL statement work?
</DL>



<BLOCKQUOTE>
	<PRE><FONT COLOR="#0066FF">SQL&gt; <B>UPDATE COLLECTION
     SET VALUES = 900
     WHERE ITEM = 'STRING';</B></FONT></PRE>

</BLOCKQUOTE>

<H3><FONT COLOR="#000077">Exercises</FONT></H3>

<DL>
	<DD><B>1.</B> Try inserting values with incorrect data types into a table. Note the
	errors and then insert values with correct data types into the same table.
	<P><B>2. </B>Using your database system, try exporting a table (or an entire database)
	to some other format. Then import the data back into your database. Familiarize yourself
	with this capability. Also, export the tables to another database format if your
	DBMS supports this feature. Then use the other system to open these files and examine
	them.
</DL>

<H1></H1>
<CENTER>
<P>
<HR>
<A HREF="ch07.htm" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/ch07.htm"><IMG SRC="previous.gif" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="ch09.htm" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/ch09.htm"><IMG
SRC="next.gif" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/index-1.htm"><IMG SRC="contents.gif" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> <BR>
<BR>
<BR>
<IMG SRC="corp.gif" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/corp.gif" WIDTH="284" HEIGHT="45" ALIGN="BOTTOM" ALT="Macmillan Computer Publishing USA"
BORDER="0"></P>

<P>&#169; <A HREF="copy.htm" tppabs="http://202.113.16.101/%7eeb%7e/Teach%20Yourself%20MS%20SQL%20Server%206.5%20in%2021%20Days/copy.htm">Copyright</A>, Macmillan Computer Publishing. All
rights reserved.
</CENTER>


</BODY>

</HTML>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲在线成人精品| 免费在线成人网| 日本sm残虐另类| 色天天综合色天天久久| 欧美精品一区二区三区很污很色的| 国产精品久久久久三级| 精品一区中文字幕| 欧美精品在欧美一区二区少妇| 国产精品日日摸夜夜摸av| 久久精品国产99久久6| 欧美少妇一区二区| 亚洲精品精品亚洲| 成人在线综合网| 久久嫩草精品久久久精品| 久久精品国产在热久久| 欧美日韩激情一区二区三区| 最新日韩av在线| 成人高清在线视频| 国产日韩精品一区二区三区| 精品一区二区三区在线播放视频| 欧美四级电影在线观看| 亚洲在线一区二区三区| 日本韩国一区二区三区| 亚洲欧美另类小说| 91亚洲精品乱码久久久久久蜜桃| 国产精品久久久久影院亚瑟 | 日本不卡免费在线视频| 在线观看一区二区视频| 一区二区三区精品在线观看| 99r精品视频| 中文字幕一区视频| 色94色欧美sute亚洲线路一ni | 麻豆精品国产传媒mv男同| 欧美另类久久久品| 免费国产亚洲视频| 久久美女艺术照精彩视频福利播放| 国产精品99久久久久久久vr| 国产欧美精品一区| 91农村精品一区二区在线| 一区二区三区中文字幕在线观看| 91九色最新地址| 日韩精品1区2区3区| 欧美成人三级电影在线| 国产精品一二三四| 亚洲图片另类小说| 欧美精选在线播放| 国产原创一区二区三区| 国产精品高潮久久久久无| 91精彩视频在线| 日韩avvvv在线播放| 久久人人超碰精品| av成人免费在线观看| 午夜精品久久一牛影视| 精品99一区二区| av亚洲精华国产精华| 午夜激情久久久| xfplay精品久久| 色视频成人在线观看免| 久久99精品久久久| 亚洲欧美日韩一区二区| 日韩女优av电影| 91美女精品福利| 喷水一区二区三区| 国产精品久久久久永久免费观看 | 成人av网址在线| 午夜精品福利一区二区三区av | 秋霞电影网一区二区| 国产欧美在线观看一区| 欧美三级三级三级爽爽爽| 激情五月播播久久久精品| 国产精品美女一区二区在线观看| 欧美美女bb生活片| 成人av影视在线观看| 日韩**一区毛片| 亚洲精品水蜜桃| 久久久久久久性| 欧美蜜桃一区二区三区| 成人一区二区三区视频在线观看| 天天免费综合色| 亚洲欧洲在线观看av| 久久综合色综合88| 欧美区一区二区三区| 91在线看国产| 国产一区二区伦理| 免费的国产精品| 亚洲一区二区三区四区五区黄| 国产校园另类小说区| 欧美一级xxx| 欧美日韩aaa| 91视频在线看| 成人av网在线| 国产ts人妖一区二区| 精品一区二区三区影院在线午夜| 亚洲综合视频网| 日韩毛片精品高清免费| 欧美国产成人精品| 国产人伦精品一区二区| 日韩写真欧美这视频| 欧美老肥妇做.爰bbww| 日本伦理一区二区| 99re成人精品视频| 成人免费高清在线| 国产毛片精品视频| 国产一区中文字幕| 国内不卡的二区三区中文字幕| 日韩影院精彩在线| 日韩福利视频网| 免费人成黄页网站在线一区二区| 午夜视频在线观看一区二区| 亚洲国产中文字幕| 亚洲国产日韩精品| 日韩精品久久久久久| 日本vs亚洲vs韩国一区三区二区| 日韩高清不卡在线| 麻豆视频观看网址久久| 久久av老司机精品网站导航| 蜜臀久久99精品久久久久久9 | 成人一级片网址| 不卡在线视频中文字幕| 91丨porny丨蝌蚪视频| 色综合久久中文综合久久97| 91无套直看片红桃| 91黄色免费看| 欧美一区二区啪啪| 精品国产一区二区国模嫣然| 国产亚洲精品精华液| 国产精品初高中害羞小美女文| 亚洲人成网站影音先锋播放| 亚洲在线成人精品| 免费美女久久99| 国产盗摄精品一区二区三区在线| 波多野结衣视频一区| 欧美性高清videossexo| 91精品国产品国语在线不卡| 亚洲精品在线观| 亚洲欧美偷拍三级| 五月天网站亚洲| 国产乱子伦视频一区二区三区| 国产a区久久久| 精品视频色一区| 国产区在线观看成人精品| 亚洲欧美日韩精品久久久久| 天天综合网天天综合色| 国产成人高清视频| 欧美日韩国产精品自在自线| 欧美精品一区二区久久久| 亚洲天天做日日做天天谢日日欢 | 99精品黄色片免费大全| 欧美人牲a欧美精品| 久久综合久久鬼色| 亚洲精品v日韩精品| 开心九九激情九九欧美日韩精美视频电影 | 日韩专区在线视频| 成人久久视频在线观看| 欧美精品日韩一区| 国产精品久久毛片a| 日本视频免费一区| 99精品视频一区二区三区| 欧美成人艳星乳罩| 亚洲色图欧美在线| 九色综合国产一区二区三区| 色综合久久天天| 久久久久久久免费视频了| 天天射综合影视| 色狠狠一区二区| 国产欧美中文在线| 精品一区二区三区不卡| 欧美图区在线视频| 亚洲欧美综合色| 国产盗摄女厕一区二区三区| 正在播放一区二区| 亚洲国产你懂的| 91偷拍与自偷拍精品| 久久久久久9999| 蜜桃免费网站一区二区三区| 欧美午夜不卡视频| 亚洲精品乱码久久久久久黑人| 成人一区二区三区| 国产亚洲欧美在线| 久久99最新地址| 日韩午夜在线播放| 免播放器亚洲一区| 6080国产精品一区二区| 亚洲成av人片在线观看无码| 成人激情午夜影院| 国产欧美精品一区二区色综合朱莉| 蜜臀国产一区二区三区在线播放| 欧美在线免费视屏| 亚洲高清视频的网址| 色先锋aa成人| 亚洲综合偷拍欧美一区色| 色偷偷88欧美精品久久久| 亚洲视频免费观看| 色综合久久中文字幕| **欧美大码日韩| 欧洲人成人精品| 亚洲va欧美va人人爽午夜| 欧美三级日韩三级国产三级| 亚洲成人中文在线| 欧美一区二区日韩|