Oracle 9i truncated data table

Source: Internet
Author: User
The SQL syntax for the truncation operation is as follows.
―――――――――――――――――――――――――――――――――――――
TRUNCATE the user name of the table. List name [drop| Reuse STORAGE]
―――――――――――――――――――――――――――――――――――――
In which, if you use the "DROP STORAGE" clause, you explicitly indicate the space that frees the data table and index. If you use the "reuse STORAGE" clause, explicitly indicate that the data table is not released and the index accounts for Huan O Brigade Leisure fontanel fresh  tea 韘 as an example to introduce.
(1) Execute the SQL code in "Sqlplus Worksheet", as the result is shown in Figure 7.32.
―――――――――――――――――――――――――――――――――――――
TRUNCATE TABLE Scott.director drop storage;
―――――――――――――――――――――――――――――――――――――
"See CD-ROM File": \ 7th Chapter \truncatedirector.sql.
(2) The result indicates that the truncation operation cannot be completed. This is because the Tutor information table is the parent table, and the Postgraduate information table refers to the Instructor information tables field as the outer code.
(3) Therefore, the scott.student relationship must first be invalidated. Execute the following code in "Sqlplus Worksheet". The results of the execution are shown in Figure 7.33.
―――――――――――――――――――――――――――――――――――――
ALTER TABLE Scott.student
Disable constraint "Tutor number outside the code";
―――――――――――――――――――――――――――――――――――――
"See CD files": \ 7th chapter \ Disableconstraint.sql.

(4) Re-executing truncatedirector.sql in "Sqlplus Worksheet", as shown in Figure 7.34. Indicates the truncation of the table completed successfully.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.