Find if a column in Oracle has a sequence

后端 未结 5 507
孤独总比滥情好
孤独总比滥情好 2021-02-05 02:56

I am attempting to figure out if a column in Oracle is populated from a sequence. My impression of how Oracle handles sequencing is that the sequence and column are separate en

5条回答
  •  無奈伤痛
    2021-02-05 03:31

    You are correct; the sequence is separate from the table, and a single sequence can be used to populate any table, and the values in a column in some table may mostly come from a sequence (or set of sequences), except for the values manually generated.

    In other words, there is no mandatory connection between a column and a sequence - and therefore no way to discover such a relationship from the schema.

    Ultimately, the analysis will be of the source code of all applications that insert or update data in the table. Nothing else is guaranteed. You can reduce the scope of the search if there is a stored procedure that is the only way to make modifications to the table, or if there is a trigger that sets the value, or other such things. But the general solution is the 'non-solution' of 'analyze the source'.

提交回复
热议问题