Copy table data to another table with PL/SQL developer

Source: Internet
Author: User

1. Create a new table, business_copy, and copy the data from the Bisiness table

CREATE TABLE business_copy

As

SELECT * from business;

NOTE: This SQL statement simply creates the table and replicates the table's data, but does not copy the constraints of the table.

2. Delete the table in PL/SQL developer

For example, delete a table business, perform a operation,

1) DROP TABLE business;

2) Locate this table, right-click and select Cross-boundary delete operation.

3. Quickly create a table in PL/SQL developer.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/57/49/wKioL1SXuIjQnc1GAAIdxHNPXQM464.jpg "title=" Qq20141222142006.png "width=" "height=" 347 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:600PX;HEIGHT:347PX; "alt = "Wkiol1sxuijqnc1gaaidxhnpxqm464.jpg"/>

4. How to quickly import data from a table into a new table.

INSERT into Business (busino,businame,itemno,starttime)

SELECT * FROM Business_copy

5. Store the document in the table;

1) Add a column with the name Busidoc, format blob, and add something to it

6. More commonly used field data types

Number (P,s): numeric type, p minimum is 1, maximum 38,s min-84, maximum 124;

Date: Day type, used to record time

char (size): Fixed length string type, compare the value of a field, know the specified length, can save a lot of space, speed up access

VARCHAR2 (size): variable long string type, more commonly used, such as the length of a person's name, you can give the maximum value

Blob: (Binary large objects, binary large object type) for storing binary objects, such as photos, document materials, etc.

CLOB: Large Object data (character large object character big data type) that stores characters, such as resumes

bfile: (binary file, binary files) stores large objects, such as film film, etc.

7. Modify the table structure in PL/SQL developer

1) Create a new SQL window and enter the SQL statement

ALTER TABLE ITEMS ADD (MANAGER VARCHAR2 (6)); Perform

Explanation: Alter is a frequently used keyword in the Oracle database, changing database parameters, table structure, etc. are used to

Eg: change manager input characters: Alter TABLE ITEMS Modify (Manager VARCHAR2 (8));

Add: Adds a list of keywords here

2) Modify data: Update items set manager= ' Ouyang unbeaten ' where itemname = ' Beijing project ';

3) Modify the maximum value of the table field: ALTER table ITEMS Modify (MANAGER VARCHAR2 (8));

4) Change the data in the table:

UPDATE items SET MANAGER = ' Ouyang unbeaten ' WHERE itemname = ' Shenzhen project ';

5) Delete a column of the table: ALTER table ITEMS DROP column MANAGER;





Copy table data to another table with PL/SQL developer

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.