Oracle Insert Data issues

Source: Internet
Author: User

This is my table structure:
Desc t_student;
Name Type Nullable Default Comments
------------ ------------ -------- ------- --------
stu_id VARCHAR2 (10)
Stu_name VARCHAR2 (40)
Stu_password VARCHAR2 (+) Y
Stu_age INTEGER Y
Stu_perform FLOAT (2) Y

Inserts a single piece of data into this table in PL/SQL
Insert into T_student (stu_id, Stu_name, Stu_password, Stu_age, Stu_perform) VALUES (' 001 ', ' David ', ' David ', 12, 89.00);
Insert failed, ORA-00904: "Stu_perform": Invalid identifier
Why, Why? Change to uppercase also not, will stu_perform remove will prompt stu_age identifier invalid.
To solve the problem, you prawns ~

As you see in the PL/SQL DESC command, your field is named lowercase and the result of the field double quotation marks when the table is built
CREATE TABLE T_studetn ("stu_id", "Stu_name",.........
In this case, double quotation marks are also added to the field when inserting the data, and the case should correspond, so that:
INSERT INTO T_student ("stu_id", "Stu_name", "Stu_password", "Stu_age", "Stu_perform") VALUES (' 001 ', ' David ', ' David ', 12 , 89.00);

So do not add double quotes when building tables and using identifiers to avoid trouble.

As
you see in the PL/SQL DESC command, your field is named lowercase, and the result of the field with double quotation marks when the table is built create TABLE T_STUDETN ("stu_id", "Stu_name",......... In this case, the fields are also enclosed in double quotation marks when inserting the data, and the case should correspond, so that: INSERT INTO t_student ("stu_id", "Stu_name", "Stu_password", "Stu_ag ...

The upstairs is really bad. I also desc my own table, the field is really uppercase. The landlord's lowercase, it is estimated that the matter. You have to watch these little things carefully.

As
you see in the PL/SQL DESC command, your field is named lowercase, and the result of the field with double quotation marks when the table is built create TABLE T_STUDETN ("stu_id", "Stu_name",......... In this case, the fields are also enclosed in double quotation marks when inserting the data, and the case should correspond, so that: INSERT INTO t_student ("stu_id", "Stu_name", "Stu_password", "Stu_age ...

I'm relying on the modeling tools. Thank you so much.

Oracle Insert Data issues

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.