Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Is this a bug?
EscVector wrote:
> As demonstrated below, a table can be created with data type
> "timestamp" as a column name.
>
> This causes a subsequent issue when creating triggers.
>
> Shouldn't the table create throw a "ORA-00904: : invalid identifier"
> error?
>
> create sequence seq;
>
> create table test (
> col1 number,
> timestamp timestamp
> )
> /
>
> create or replace trigger trg
> before insert on test
> for each row
> begin
> select seq.nextval into :new.col1 from dual;
> end;
> /
>
> alter table test rename column timestamp to ts
> /
>
> create or replace trigger trg
> before insert on test
> for each row
> begin
> select seq.nextval into :new.col1 from dual;
> end;
> /
A quick test:
SELECT
*
FROM
V$RESERVED_WORDS
WHERE
KEYWORD IN
('DATE','TIMESTAMP','VARCHAR2','CHAR','NUMBER','SYSDATE','CONSTRAINT','OPTIMAL')
ORDER BY
KEYWORD
KEYWORD LENGTH RESERVED RES_TYPE RES_ATTR RES_SEMI DUPLICATE
CHAR 4 Y N N N Y CONSTRAINT 10 N N N N N DATE 4 Y N N N N NUMBER 6 Y N N N N OPTIMAL 7 N N N N N SYSDATE 7 N N N Y N TIMESTAMP 9 N N N N N TYPE 4 N N N N N VARCHAR2 8 Y N N N N
CREATE TABLE T1 (
CHAR TIMESTAMP);
Error: Invalid column name
CREATE TABLE T1 (
CONSTRAINT TIMESTAMP);
Error: Invalid column name
CREATE TABLE T1 (
DATE TIMESTAMP);
Error: Invalid column name
CREATE TABLE T1 (
NUMBER TIMESTAMP);
Error: Invalid column name
CREATE TABLE T1 (
OPTIMAL TIMESTAMP);
TABLE CREATED
DROP TABLE T1;
CREATE TABLE T1 (
SYSDATE TIMESTAMP);
Error: Invalid column name
CREATE TABLE T1 (
TIMESTAMP TIMESTAMP);
TABLE CREATED
DROP TABLE T1;
CREATE TABLE T1 (
TYPE TIMESTAMP);
TABLE CREATED
DROP TABLE T1;
CREATE TABLE T1 (
VARCHAR2 TIMESTAMP);
Error: Invalid column name
Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc.
Received on Wed Jan 03 2007 - 15:30:18 CST
![]() |
![]() |