oracle数据库自动生成主键序列 如何查看主键名称?

[更新]
·
·
分类:互联网
1102 阅读

oracle数据库自动生成主键序列

如何查看主键名称?

如何查看主键名称?

想要查看主键名称要通过查询ORACLE的数据字典才能知道。
1、查主键名称: select * from user_constraints where table_name ART and constraint_type P; 查主键对应的列: select * from user_cons_columns where table_name ART and constraint_name PK_ART;
2、查索引名称: select * from user_indexes where table_name ART; 查索引对应的列: select * from user_ind_columns where table_name ART and index_name INDX_BA;

Java程序连接Oracle数据库时怎么设置主键自增?

在oracle中主键是不能自增的,不过可以创建一个序列 -- Create sequence create sequence SEQ_TEXT minvalue 1 maxvalue 9999 start with 60 increment by 1 cache 20 在插入数据的时候 INSERT INTO STUDENT(ID,NAME) VALUES(SEQ_,张三) 这样就可以了

如何得到JDBCInsert语句执行后插入Oracle数据库记录的主键?

insert 之前或者同时插入主键啊,不能执行之后插入主键

oracle数据库中查询表主键、外键及索引的命令是什么?

要通过查询ORACLE的数据字典才能知道。
1、查主键名称: select * from user_constraints where table_name ART and constraint_type P 查主键对应的列: select * from user_cons_columns where table_name ART and constraint_name PK_ART
2、查索引名称: select * from user_indexes where table_name ART 查索引对应的列: select * from user_ind_columns where table_name ART and index_name INDX_BA