tags:

views:

82

answers:

2

When I tried to commit a sql query I ended up with the following message:

cannot insert duplicate key row in object [] with unique index '[]$[]$[]$'

What does that mean? and what "'[]$[]$[]$'" is composed of?

+1  A: 

You insert something with the same primary key maybe? It would be good if you show us the code that executes it ... '[]$[]$[]$' --> I think it's generated by your code.

Try this

select * from yourtable where your_primary_key = '[]$[]$[]$' ; 

I'm just guessing since you didn't provide source code.

nightingale2k1
The query was unreachble to me, so...The conflicting column was FK and '[]$[]$[]$' goes something like 'index$[table]$[column]$' but actually the [column] doesn't exist in the table.
A: 

A duplicate key error means that you have tried to insert a row with the same key value as some other row already indexed by the named index.

The weird message formatting suggests that although you got an error, it was not being handled well by the DBMS - or the code in the client responsible for formatting the error message has mishandled it. In the former case, it might mean that you are running into some sort of bug in the DBMS (which one are you using?).

Jonathan Leffler