表中的序号 [英] Sequence number in table
问题描述
我知道之前可能有人问过这个问题,但需要找出是否有办法确定我的表(oracle db)是否使用任何序列作为其列之一?我没有写架构,所以我需要找出来做一些插入查询
I know this might have been asked before but need to find out if there is a way I can identify if my table(oracle db) is using any sequence as one of its columns? I did not write the schema so I need to find out in order to do some insert queries
推荐答案
尝试此操作的一种方法,虽然非常规,但运行这些查询以检查您的 函数
中是否使用了任何序列, procedures
, packages
.
One way to try this, although unconventional, would be to run these queries to check if there are any sequence used in your functions
, procedures
, packages
.
select * from user_source where
UPPER(TEXT) LIKE '%NEXTVAL%';
select * from all_source where
UPPER(TEXT) LIKE '%NEXTVAL%';
然后转到特定过程,函数以检查哪个列/表被序列填充.也用 '%CURRVAL%'
Then go to the specific procedure, function to check which column/table gets populated by a sequence.
Try this also with '%CURRVAL%'
如果您从 JDBC
或其他使用序列的外部应用程序运行插入,这可能无济于事.
This might not help if you are running inserts from JDBC
or other external applications using a seqeunce.
这篇关于表中的序号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!