1、代码结构
1、创建 第一种 -- Create sequence create sequence SEQ_USERID minvalue 1 maxvalue 999999999999 start with 1 increment by 1 nocache cycle; 第二种 CREATE SEQUENCE SEQ_WAIJIN_ALL_TABLE_WAIJINID INCREMENT BY 1 START WITH 1 NOMAXvalue NOCYCLE NOCACHE 2、查询 select SEQ_USERID.nextval from dual; 3、删除 drop sequence SEQ_USERID;
2、查询表所有字段结构
SELECT 'DDL_DTL.' ||USER_TAB_COLS.COLUMN_NAME ||',' FROM USER_TAB_COLS WHERE USER_TAB_COLS.TABLE_NAME='DIM_ERP_PUB_DDL_DTL'