Home Database Mysql Tutorial oracle中bug之ORA-00904:”COS

oracle中bug之ORA-00904:”COS

Jun 07, 2016 pm 03:37 PM
bug cos oracle

笔者今天遇到一个oracle中的bug,详情请看小生细细道来。 换列名后,标示符还是无效 ORA-00904:”COS_0”: 标示符无效 如题,也许导致这个问题的原因很多,但是本文笔者所要描述的是由于创建表对象时,创建的语句里列名带有双引号问题。“”就是这个符号的原

笔者今天遇到一个oracle中的bug,详情请看小生细细道来。

 

换列名后,标示符还是无效ORA-00904:”COS_0”:标示符无效

oracle中bug之ORA-00904:”COS

 

如题,也许导致这个问题的原因很多,但是本文笔者所要描述的是由于创建表对象时,创建的语句里列名带有双引号问题。“”就是这个符号的原因。如下所示:

create table D_METER_SITECHK  (

  READ_ID             NUMBER(16)                     not null,

  METER_ID            NUMBER(16)                     not null,

  TEST_DEPT_NO         VARCHAR2(16),

  "Ua"                 NUMBER(12,4),

  "Ub"                NUMBER(12,4),

  "Uc"                NUMBER(12,4),

  "la"                NUMBER(12,4),

  constraint PK_D_METER_SITECHK primary key (READ_ID)

);

以上语句里的双引号是怎么来的,一是通过建模工具,自动生成的时候,建模工具会默认把一些字段当成关键字,会莫名其妙给这些看似关键字的列名加上双引号‘“’。但是再PL/SQL创建表的时候,PL/SQL却不报错,而且创建出来的表几乎看不出任何问题。

可是当你对这个表做插入数据时却始终插不进去,无论你换任何列名,都无济于事。但是你执行select操作却能正常把数据查出来。很奇怪吧。

不管你换任何列名,只要你不把以上带双引号的四个列删掉,就会一直出错,但是你会发现,无论你怎么删除或者更改上述四个带双引号的列的列名,始终改不了。系统总是提示:ORA-00904:”COS_0” :标示符无效

解决这个问题的唯一办法就是,删掉这个表,当然如果这个表里的列是别的表的主键,那么其他的表也要受到关联。

重新创建表对象,从建模工具里复制自动生成的sql创建语句到记事本里,然后把双引号去掉。

完事,此问题得到解决。

大概这是oraclebug吧。

带双引号的列,能创建成功,但是无法对这个表对象做任何操作。

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

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 create cursors in oracle loop How to create cursors in oracle loop Apr 12, 2025 am 06:18 AM

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.

How to stop oracle database How to stop oracle database Apr 12, 2025 am 06:12 AM

To stop an Oracle database, perform the following steps: 1. Connect to the database; 2. Shutdown immediately; 3. Shutdown abort completely.

What steps are required to configure CentOS in HDFS What steps are required to configure CentOS in HDFS Apr 14, 2025 pm 06:42 PM

Building a Hadoop Distributed File System (HDFS) on a CentOS system requires multiple steps. This article provides a brief configuration guide. 1. Prepare to install JDK in the early stage: Install JavaDevelopmentKit (JDK) on all nodes, and the version must be compatible with Hadoop. The installation package can be downloaded from the Oracle official website. Environment variable configuration: Edit /etc/profile file, set Java and Hadoop environment variables, so that the system can find the installation path of JDK and Hadoop. 2. Security configuration: SSH password-free login to generate SSH key: Use the ssh-keygen command on each node

How to create oracle dynamic sql How to create oracle dynamic sql Apr 12, 2025 am 06:06 AM

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values ​​to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.

vscode cannot install extension vscode cannot install extension Apr 15, 2025 pm 07:18 PM

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

What to do if the oracle log is full What to do if the oracle log is full Apr 12, 2025 am 06:09 AM

When Oracle log files are full, the following solutions can be adopted: 1) Clean old log files; 2) Increase the log file size; 3) Increase the log file group; 4) Set up automatic log management; 5) Reinitialize the database. Before implementing any solution, it is recommended to back up the database to prevent data loss.

Oracle's Role in the Business World Oracle's Role in the Business World Apr 23, 2025 am 12:01 AM

Oracle is not only a database company, but also a leader in cloud computing and ERP systems. 1. Oracle provides comprehensive solutions from database to cloud services and ERP systems. 2. OracleCloud challenges AWS and Azure, providing IaaS, PaaS and SaaS services. 3. Oracle's ERP systems such as E-BusinessSuite and FusionApplications help enterprises optimize operations.

Can vscode be used for mac Can vscode be used for mac Apr 15, 2025 pm 07:36 PM

VS Code is available on Mac. It has powerful extensions, Git integration, terminal and debugger, and also offers a wealth of setup options. However, for particularly large projects or highly professional development, VS Code may have performance or functional limitations.

See all articles