#33 constraint info for oracle plugin

closed-accepted
plugin (16)
5
2010-08-21
2010-04-23
No

Hi,

This is patch for oracle plugin. Many times when I get a violation constraint error for my sql I am rather stuck unable to tell what is causing the problem.
The constraint name it isn't always very descriptive and quering the dictionary views is rather tedious and slow.
I made a patch that basically adds a "CONSTRAINT" node in every table node to show all the constraints for that table.
There is even a source tab that creates the SQL code by looking up data into the views.
Hope this can be useful for somebody else too.

Bogdan Paulon

Discussion

  • Rob Manning

    Rob Manning - 2010-04-23

    So if you have hundreds of tables, then you are stuck looking under each table node in the tree to see if it has the constraint that was violated ? Seems like too much work, and can be avoided by choosing a naming scheme for you constraint names. You don't have to rely on the database to auto-generate your constraint names; most dbs accept an alter statement that allows you to specify the constraint name. Wouldn't this better meet you needs ?

    Rob

     
  • Bogdan Cristian Paulon

    Sorry for my late reply. I'll try to make myself clear. The ORA-02292 Constraint violation error message contains the constraint name. With that name I can do a Search in the Objects panel that automatically selects the constraint node into the tree. This way it is easy and fast to get to the constraint info.

    On new database schemas using a naming convention is definitely a good thing. Anyway the name cannot tell you everything and you still have to do some interrogation for example to get the involved table columns.
    On existing databases that doesn't use a naming convention doing some refactoring to alter the names can surely help. Nevertheless this comes with a cost especially when you have already many deployed instances.

    Does this shed some light on my needs and the reason I wrote the patch?

    Bogdan

     
  • Rob Manning

    Rob Manning - 2010-04-26

    Ok, that's reasonable.

    Rob

     
  • Rob Manning

    Rob Manning - 2010-05-31

    Hi Bogdan,

    I was reviewing your patch and I have a question. You added the following lines to oracle.properties:

    action.net.sourceforge.squirrel_sql.plugins.oracle.common.DisableConstraintAction.name=Disable constraint
    action.net.sourceforge.squirrel_sql.plugins.oracle.common.DisableConstraintAction.tooltip=Disable constraints (tooltip)

    Yet I don't see this action included in your patch. Did it get left out somehow ? Without it, I think these lines are unnecessary.

    Rob

     
  • Rob Manning

    Rob Manning - 2010-05-31
    • assigned_to: nobody --> manningr
     
  • Bogdan Cristian Paulon

    Hi Rob,
    you're right, it somehow mixed with something else I was working on. The two lines are not necessary.

    Thanks,
    Bogdan

     
  • Rob Manning

    Rob Manning - 2010-08-21

    Committed to subversion and will be available in the 3.2 release.

    Rob

     
  • Rob Manning

    Rob Manning - 2010-08-21
    • status: open --> closed-accepted
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks