Oracle-ERWin constraint headache
December 9, 2010 7:28 AM   Subscribe

Databases: I've got a problem with Oracle and ERWin when using multi-column constraints. Please help.

I've built a pretty large model in ERWin which includes a multi-column unique constraint. The problem comes in when I push the model into Oracle ("forward engineer", in ERWin's terminology). The table creation dies at the constraint because ERWin is sending it as
check ( unique (col1, col2))
It should just be sending
unique (col1, col2)
The superfluous "check ()" is stopping the DB creation in its tracks.

I have a workaround of sending the DDL to a file and then editing it and manually executing it on the server, but this has been a thorn in my side for a while and if there's something in ERWin's interface that I'm just not getting, I really want learn how to do it right.

Thanks.
posted by NortonDC to Computers & Internet (2 answers total)
 
Haven't used ERWin but am an Oracle programmer. This kind of thing makes me wonder what version of Oracle you're using and whether ERWin has a setting to define this. What's the error you see?

Having to edit the file is annoying but think about it this way -- it gets you 99% of the way there, which is pretty good.

In our shop we might use a tool (TOAD, generally) to build a model, but the only time we'd actually just push it wholesale into Oracle would be during development, when you would need to keep tweaking it over and over anyway. All the DDL should be in a readable file for review, and somebody should read it, whether you plan to run it in from the tool or not.
posted by mneekadon at 11:44 AM on December 9, 2010


Response by poster: what version of Oracle you're using
11gR2

What's the error you see?
The thrown error is ORA-00936, and the particular trigger issue in the generated code is the superfluous insertion of the "check" statement.

This is going on in a development push, so this keeps recurring as I push out revisions to the VM, testbed, rinse, and repeat.

What I'm hoping is that someone knows ERWin much more intimately than me and they can tell me what I'm doing wrong.
posted by NortonDC at 5:25 PM on December 9, 2010


« Older Former owners were idiots, help me avoid the same...   |   Logan-bound Newer »
This thread is closed to new comments.