unique constraint violated WWV_FLOW_UNIQUE_MENU_OPT

Creating a new page in an application I’m writing for a customer APEX gave me an error against the WWV_FLOW_UNIQUE_MENU_OPT constraint, after I hit the finish button in the last step of the wizard.. Now, that’s strange, why would APEX break on me in this situation?

I logged in as APEX_040100 to see and understand what actually went wrong.

The constraint mentioned is an index on the WWV_FLOW_MENU_OPTIONS table on columns MENU_ID and PAGE_ID. The page_id is the page_id as known in apex (1040) in my case. The menu_id seems to be some kind of identifier, in my case ‘6.69651082468548E15’.

Hmm.. what can we do to resolve this?

I think this index is in error.. shouldn’t the flow_id also be taken in consideration?

Apparently it is: the menu_id seems to be the same for all pages within the same flow.

Even after a restart of the database I’m not able to generate pages with the requested Page_id (1040).

After a bit of searching on the APEX forums at Oracle it ended to be a very logical problem.

As I often do for referential source data, I created a “Form on a table with report”. I tend to put both the report and the form on one page.

This is easy in maintenance. The report I put first and in column 1, the form I put in second and in column 2. This way I have an easy way of manipulating the source data.

However in my normal examples I don’t use breadcrumbs, and in this case I did. The wizard gives me the option, so why shouldn’t I?

The index is preventing me to insert two records in the table for those two breadcrumbs on one and the same table.

So the index IS correct afterall.

I do think that:

  • The wizard should detect that I’m using one page for both report and form and therefore only insert one breadcrumb
  • The wizard should warn me that I’m using one form AND breadcrumbs on bith pages.

Apex team? This probably will get a low priority, but the bug is ugly and easily to prevent.

One thought on “unique constraint violated WWV_FLOW_UNIQUE_MENU_OPT”

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>