CREATE TABLE XX_Material (
 AD_CLIENT_ID    NUMERIC(10)     NOT NULL,
 AD_ORG_ID       NUMERIC(10)     NOT NULL,
 ISACTIVE        CHAR(1)         DEFAULT 'Y' NOT NULL,
 CREATED         DATE            DEFAULT NOW() NOT NULL,
 CREATEDBY       NUMERIC(10)     NOT NULL,
 UPDATED         DATE            DEFAULT NOW() NOT NULL,
 UPDATEDBY       NUMERIC(10)     NOT NULL,
 
);
执行后提示
应该是不允许使用NOW(),但是这是示例,应该不会有问题啊。
请求帮助解决,谢谢

解决方案 »

  1.   

    数据库里面已经有了一个  XX_Material  的过程或是函数, 
    查一下select * from dba_objects where OBJECT_NAME=' XX_Material ';
      

  2.   

    now 是ora 的语法???
      

  3.   

    DEFAULT
    The DEFAULT clause lets you specify a value to be assigned to the column if a subsequent INSERT statement omits a value for the column. The datatype of the expression must match the datatype of the column. The column must also be long enough to hold this expression.The DEFAULT expression can include any SQL function as long as the function does not return a literal argument, a column reference, or a nested function invocation.Restriction on Default Column Values A DEFAULT expression cannot contain references to PL/SQL functions or to other columns, the pseudo columns CURRVAL, NEXTVAL, LEVEL, PRIOR, and ROWNUM, or date constants that are not fully specified.
      

  4.   

    我把now()替换为sysdate后,就可以创建表了。
    CREATE TABLE XX_Material (
     AD_CLIENT_ID    NUMERIC(10)     NOT NULL,
     AD_ORG_ID       NUMERIC(10)     NOT NULL,
     ISACTIVE        CHAR(1)         DEFAULT 'Y' NOT NULL,
     CREATED         DATE            DEFAULT SYSDATE NOT NULL,
     CREATEDBY       NUMERIC(10)     NOT NULL,
     UPDATED         DATE            DEFAULT SYSDATE NOT NULL,
     UPDATEDBY       NUMERIC(10)     NOT NULL
     )
      

  5.   

    now()函数是mysql里面的日期函数,在oracle中用sysdate()函数