# DB Tables and Unique or duplicate values

**URL:** <https://forum.inductiveautomation.com/t/db-tables-and-unique-or-duplicate-values/39678>\
**Category:** Ignition\
**Created:** [October 14, 2020, 6:38pm UTC](https://forum.inductiveautomation.com/t/db-tables-and-unique-or-duplicate-values/39678 "2020-10-14T18:38:56Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![steven.cox](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven.cox/32/18589_2.png) [@steven.cox](https://forum.inductiveautomation.com/u/steven.cox)\
**Post date:** [October 20, 2020, 4:02pm UTC](https://forum.inductiveautomation.com/t/db-tables-and-unique-or-duplicate-values/39678/18 "2020-10-20T16:02:40Z")

</div>

@tyrel.parker,

> [@tyrel.parker](#):
>
> ```auto
> except Exception as e:
> msg = str(e.getCause())
> logger.info('except javalang: {}'.format( msg)
> if 'Cannot insert duplicate key' in msg:
> logger.info( 'duplicate')
> 
> ```

I am trying to understand what is happening here. I read up on system.util.getLogger so it looks like you defined a Logger as "logger". I do not see the getClause() anywhere. Where can I find this? I assume it captures the text of the error message.

I also assume the logger.info is the actual message box.

My "plan" is to create the logger in the Window script so it is created when the window is open. Then capture it in the try...except each place I need it. Sound about right?

Thanks so much for the help,

Steven

---

_[View the full topic](https://forum.inductiveautomation.com/t/db-tables-and-unique-or-duplicate-values/39678)._
