1

Before you answer, let me emphasize that this is a question related to the Ingres RDBMS .

As many other Ingres users who complained about in the past on forums, I also experience the access issue when AUTO_INCREMENT is used... I need to find out the sequence used for the AUTO_INCREMENT field, so I can grant access to it in order to prevet some annoying exceptions...

Yes, when exception is thrown (JDBC) I get the name of the sequence in question, and I can fix it. But in the case I have bunch of tables, I may want to fix them all with a script.

How to find what sequence is used? (I mean its name)

Similarly, how to find out in what table is certain identity sequence used?

Example: $iiidentity_sequence_0012936

DejanLekic
  • 18,787
  • 4
  • 46
  • 77

1 Answers1

3

Try this

SELECT table_name,column_name, column_default_val
FROM iicolumns 
WHERE column_always_ident    = 'Y'
   OR column_bydefault_ident = 'Y'
ORDER BY 1,2
PaulM
  • 446
  • 2
  • 12
  • Hi Paul, it helps, yep. I thought there is an easier solution which does not require querying the system catalog... – DejanLekic Jun 24 '14 at 13:46