DatabaseError:(cx_Oracle.DatabaseError)ORA-04044:使用sqlalchemy创建表时,不允许使用过程,函数,程序包或类型

时间:2018-09-19 01:21:09

标签: oracle sqlalchemy

当我使用sqlalchemy创建表时,出现了错误,并且在字段中没有保留关键字:

from sqlalchemy import create_engine
from sqlalchemy import text
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String,Float,TIMESTAMP
from sqlalchemy.orm import scoped_session, sessionmaker

Base = declarative_base()
DBSession = sessionmaker(bind=engine)
session = DBSession()

class  Ibm_Batch_Tbl_Copy(Base):
__tablename__ = "IBM_BATCH_TBL_COPY"
DB_CODE = Column(String(50),primary_key=True)
DB_OWNER = Column(String(30),primary_key=True)
TABLE_NAME = Column(String(128),primary_key=True)
ROW_CNT = Column(Integer,nullable=True)
TABLE_TIME = Column(Float(64),nullable=True)
DAY_ID = Column(String(10),nullable=True)
BAT_NO = Column(String(20),nullable=True)
INSERT_TIME = Column(TIMESTAMP(timezone=False),nullable=False,server_default=text("NOW()"))
DEL_FLAG = Column(String(1),nullable=True,server_default=text('0'))
REMARK = Column(String(500),nullable=True)

当我使用Base.metadata.create_all(engine)创建表时,出现了错误。

0 个答案:

没有答案