[Symptom]: syntax errors are always reported when you want to insert data into a table.
For example:Insert into acc. t_rpt_column_info (column_id, table_id, column_name,Order, Position, data_type, metric, dictionary_type_id, cons_rule, cons_desc, txt_id, txt_column_id, is_show, tag_type, can_modify, metric, log_column_id, is_enabled, can_input)
Values ('actiontype', 't_ base_account ','Operation Type', 1, '01','s, 1,1 ','[Operation Type]It cannot be blank and must be compared in the dictionary table.', 'Actiontype ','','Mandatory', 48, 1, '1', '3', '1', '0', 'column18', '1', '1 ');
InOracle SQLIn syntax, field names cannot appear.OracleReserved keywords, such:Select, from, where, and, Or, order, group,. If you want to use the keyword, you can add "";
Test:
SQL> Create Table T1 (Order Number, group varchar2 (10 ));
Create Table T1 (Order Number, group varchar2 (10 ))
*
Error at line 1:
The ORA-00904: Invalid identifier
SQL> Create Table T1 ("order" number, "group" varchar2 (10 ));
Table created.
SQL> DESC T1;
Name null? Type
-----------------------------------------------------------------------------
Order Number
Group varchar2 (10)
SQL> insert into T1 (Order, group) values (1, test );
Insert into T1 (Order, group) values (1, 'test ')
*
Error at line 1:
ORA-00928: Missing select keyword
SQL> insert into T1 values (1, 'test ');
1 row created.
SQL> insert into T1 ("order", "group") values (2, 'test2 ');
1 row created.
SQL> select * from T1;
Order Group
--------------------
1 Test
2 Test2
Is such a table causing a lot of trouble?
We recommend that you do not use fields in the table.OracleReserved keywords.
To knowOracleWhich keywords are retained or want to know if the keywords used areOracleIt is very easy to retain:
Select * from V $ reserved_words;
Select * from V $ reserved_words where keyword = upper ('Keyword');
Also, the variable names defined in the stored procedure should not be the same as the field names in the table. In this case, the stored procedure can be compiled. However, the data in the table is incorrect, which is difficult to troubleshoot.