table 생성시 예약어로 인해 OCIError: 904 ORA-00904: invalid column name
C/H2006. 10. 16. 16:47
table 생성시 예약어로 인해 OCIError: 904 ORA-00904: invalid column name 오류
오라클에서 도대체 어떤게 예약어 인지 한참(2시간?)을 헤메고 있었다.
id, name, password 등은 사용이 가능한데
comment 이게 예약어라니.. ㅡ.ㅡ
정확하게 예약어의 기준이 먼지 한번 더 찾아봐야겠다.
SQL*PLUS에서 사용되는 명령어는 다음과 같다.
【예제】
$ sqlplus '/as sysdba'
SQL> help index
Enter Help [topic] for help.
@ COPY PAUSE SHUTDOWN
@@ DEFINE PRINT SPOOL
/ DEL PROMPT SQLPLUS
ACCEPT DESCRIBE QUIT START
APPEND DISCONNECT RECOVER STARTUP
ARCHIVE LOG EDIT REMARK STORE
ATTRIBUTE EXECUTE REPFOOTER TIMING
BREAK EXIT REPHEADER TTITLE
BTITLE GET RESERVED WORDS (SQL) UNDEFINE
CHANGE HELP RESERVED WORDS (PL/SQL) VARIABLE
CLEAR HOST RUN WHENEVER OSERROR
COLUMN INPUT SAVE WHENEVER SQLERROR
COMPUTE LIST SET
CONNECT PASSWORD SHOW
SQL>
또한 SQL과 PL/SQL의 예약어는 다음과 같다.
ABORT ACCEPT ACCESS ADD
ALL ALTER AND ANY, SOME
ARRAY AS ASC ASSERT
ASSIGN AT AUDIT AUTHORIZATION
AVG BEGIN BETWEEN BODY
BOOLEAN BY CASE CHAR
CHAR_BASE CHECK CLOSE CLUSTER
CLUSTERS COLAUTH COLUMN COMMENT
COMMIT COMPRESS CONNECT CONSTANT
COUNT CRASH CREATE CURRENT
CURSOR DATABASE DATA_BASE DATE
DBA DEBUGOFF DEBUGON DECIMAL
DECLARE DEFAULT DEFINITION DELAY
DELETE DELTA DESC DIGITS
DISPOSE DISTINCT DO DROP
ELSE ELSIF END ENTRY
EXCEPTION EXCEPTION_INIT EXCLUSIVE EXISTS
EXIT FALSE FETCH FILE
FLOAT FOR FORM FROM
FUNCTION GENERIC GOTO GRANT
GRAPHIC GROUP HAVING IDENTIFIED
IF IMMEDIATE IN INCREMENT
INDEX INDEXES INDICATOR INITIAL
INSERT INTEGER INTERSECT INTO
IS LEVEL LIKE LIMITED
LOCK LONG LOOP MAX
MAXEXTENTS MIN MINUS MOD
MODE MODIFY NEW NOAUDIT
NOCOMPRESS NOT NOWAIT NULL
NUMBER NUMBER_BASE OF OFFLINE
ON ONLINE OPEN OPTION
OR ORDER OTHERS OUT
PACKAGE PARTITION PCTFREE PRAGMA
PRIOR PRIVATE PRIVILEGES PROCEDURE
PUBLIC RAISE RANGE RAW
RECORD RELEASE REM REMARK
RENAME RESOURCE RETURN REVERSE
REVOKE ROLLBACK ROW ROWID
ROWNUM ROWS ROWTYPE RUN
SAVEPOINT SCHEMA SELECT SEPARATE
SESSION SET SHARE SIZE
SMALLINT SPACE SQL SQLCODE
SQLERRM START STATEMENT STDDEV
SUBTYPE SUCCESSFUL SUM SYNONYM
SYSDATE TABAUTH TABLE TABLES
TASK TERMINATE THEN TO
TRIGGER TRUE TYPE UID
UNION UNIQUE UPDATE USE
USER VALIDATE VALUES VARCHAR
VARGRAPH VARIANCE VIEW VIEWS
WHEN WHENEVER WHERE WHILE
WITH WORK XOR