Home Database Mysql Tutorial 将oracle的create语句更改为alter语句使用

将oracle的create语句更改为alter语句使用

Jun 07, 2016 pm 05:55 PM
alter create oracle

本文将详细介绍oracle的create语句更改为alter语句使,需要了解更多的朋友可以参考下

看PD中,双击某个表,查看其preview标签,然后会发现有某个表的create语句,如下:
代码如下:
create table Company_Info (
Company_ID NVARCHAR2(50) not null,
Area_ID NVARCHAR2(50),
Mem_ID NVARCHAR2(50),
Level_Id NVARCHAR2(50),
Name NVARCHAR2(50) not null,
Capital NVARCHAR2(50),
Unit_Property NUMBER(2) not null,
Economics_type NUMBER(2) not null,
Man_Scale NUMBER(10,0),
License_Code NVARCHAR2(50),
License_Img NVARCHAR2(50),
Intro NVARCHAR2(3000),
Company_Img NVARCHAR2(200),
Address NVARCHAR2(200),
Postal_Code NVARCHAR2(50),
Tel NVARCHAR2(50),
Fax NVARCHAR2(50),
Mobile NVARCHAR2(50) not null,
Email NVARCHAR2(50) not null,
Contactor_sex NUMBER(2),
Contactor NVARCHAR2(50),
Web_Site NVARCHAR2(200),
View_Count NUMBER(20,0),
Create_Date DATE not null,
Update_Date DATE not null,
Status NUMBER(2),
Company_Type NUMBER(2),
Remain_Point NUMBER(6,0),
Cmp_Level NVARCHAR2(50),
isAdv NUMBER(2),
Expri_Date DATE,
Display_index NUMBER(6,0),
constraint PK_COMPANY_INFO primary key (Company_ID)
);

我们如果加了某些字段,又要在原数据库上加上这些字段,我们可以这样:把create变为alter,然后将不要的
字段去除,如下所示:
代码如下:
alter table Company_Info add(
Remain_Point NUMBER(6,0),
Cmp_Level NVARCHAR2(50),
isAdv NUMBER(2),
Expri_Date DATE,
Display_index NUMBER(6,0)
)

这样就加快了我们的开发效率.
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to add and replace hard disks in oracle rac How to add and replace hard disks in oracle rac Apr 11, 2025 pm 05:39 PM

Oracle RAC hard disk new and replacement operations: Add hard disk: Add new disks, create ASM disk groups, add to clusters, move data files. Replace hard disk: Identify the failed hard disk, close the disk group, replace the hard disk, reopen the disk group, repair the failed disk, and move the data files.

How to deal with oracle garbled code How to deal with oracle garbled code Apr 11, 2025 pm 07:00 PM

Oracle garbled problems are usually caused by improper character set settings. Solutions include: Checking the server, database, and client character sets. Set up the server, database, and client character sets as needed. Use the CONVERT function or the DBMS_LOB.CONVERT_LOB function to fix garbled data. Always specify the character set and set the NLS parameters correctly.

How to re-query oracle How to re-query oracle Apr 11, 2025 pm 07:33 PM

Oracle provides multiple deduplication query methods: The DISTINCT keyword returns a unique value for each column. The GROUP BY clause groups the results and returns a non-repetitive value for each group. The UNIQUE keyword is used to create an index containing only unique rows, and querying the index will automatically deduplicate. The ROW_NUMBER() function assigns unique numbers and filters out results that contain only line 1. The MIN() or MAX() function returns non-repetitive values ​​of a numeric column. The INTERSECT operator returns the common values ​​of the two result sets (no duplicates).

How to check tablespace size of oracle How to check tablespace size of oracle Apr 11, 2025 pm 08:15 PM

To query the Oracle tablespace size, follow the following steps: Determine the tablespace name by running the query: SELECT tablespace_name FROM dba_tablespaces; Query the tablespace size by running the query: SELECT sum(bytes) AS total_size, sum(bytes_free) AS available_space, sum(bytes) - sum(bytes_free) AS used_space FROM dba_data_files WHERE tablespace_

How to connect to a cloud server How to connect to a cloud server Apr 11, 2025 pm 06:51 PM

The steps to connect to a cloud server through an Oracle client are as follows: Create an SSH key and copy the public key to the cloud server. Configure the Oracle client and add the connection information of the cloud server to the tnsnames.ora file. Create a new database connection in the Oracle client, enter the username, password, and DSN. Click OK and verify that the connection is successful.

Summary of basic knowledge of oracle database Summary of basic knowledge of oracle database Apr 11, 2025 pm 06:33 PM

Oracle Database is a reliable, scalable and feature-rich relational database management system (RDBMS). Its architecture follows the client-server model, including server-side components (Oracle Net), instances, shared memory areas (SGAs), background processes, and database files that store data. Basic concepts include tables, rows, columns, primary keys, foreign keys, indexes and cursors. The database is known for its advantages such as high availability, big data support, rich features, strong security and ease of use.

How to modify oracle character set How to modify oracle character set Apr 11, 2025 pm 06:57 PM

To modify the Oracle character set, you need to: back up the database; modify the character set settings in the init.ora file; restart the database; modify existing tables and columns to use the new character set; reload the data; modify the database link (optional).

How to use stored procedures for oracle How to use stored procedures for oracle Apr 11, 2025 pm 07:03 PM

A stored procedure is a set of SQL statements that can be stored in a database and can be called repeatedly as a separate unit. They can accept parameters (IN, OUT, INOUT) and provide the advantages of code reuse, security, performance and modularity. Example: Create a stored procedure calculate_sum to calculate the sum of two numbers and store them in the OUT parameter.

See all articles