You know, sometimes APEX is too helpful.
This evening, I was trying to build a tabular form on a view. A rather complex view, I'll confess (it's one of the few times a cartesian join is appropriate), but still a view where I can guarantee every row is unique. And I've got an instead of update trigger to handle data manipulations. Sounds straightforward, yes?
It should be, but it's not. When you create a tabular form, APEX by default wraps the SQL, adding a rowid component, in order to support some of the new features in 4.0. So when you try to run the page, you get a rather unhelpful “ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table” error. My first thought was to hack the view code a bit and create a column called “ROWID”, but that wasn't sufficient to fix the error, so I turned to Google. Which in turn led me to this post in the APEX forums, where Marc Sewtz suggested removing the validations that APEX had automatically created.
Now, this solution seemed too simple, but Marc's helped me out before, so I tried it. And, again, Marc was correct. Stripping out the validations allowed the page to load fine, and I was able to add my own (more specific) validations after the fact. So, thanks again, Marc!