SQLQueryPlugin - HowTo Edit Query Results ?

Third bullet point on this page:
http://www.intellij.org/twiki/bin/view/Main/SQLQueryPlugin

I take this to mean, that if I run a query, and click in a cell of the results grid, and type something, that I can edit it. Which would then update that particular row/column in the database?

If this is correct, is there a magical something I have to do to enable this behaviour? I can't get it to work. I double-click, and a viewer pops up, but no amount of clicking and typing or right-clicking allows me to edit the values. (I am connecting as a user with CRUD privileges).

details:
plugin 1.3.9
idea 4.0.3 build 1181
MySql 3.23.42
Connectorj 3.0.8

5 comments
Comment actions Permalink

Seems that the primary key is not detected automatically. You can set it manually by right clicking on the column header of the primary key columns and selecting 'Mark column as primary key'.

0
Comment actions Permalink

Ah, that seems to have fixed it.

So now I clicked 'show database structure' to show me the SQL Schema. In the SQL Schema viewer, that column has the little yellow key icon beside it. So it seems this combination of MySql, ConnectorJ driver and IDEA are able to retrieve the primary key.

Any reason the SQL query editor would fail to do so?

0
Comment actions Permalink

Sorry, i have no idea (same here too, with DB2).

0
Comment actions Permalink

In the SQL Schema viewer I know for which table I want to display the primary key and most JDBC driver support this.
In the result set I can't display the primary key if I don't know to which table a column belongs. The class ResultSetMetaData
contains a method getTableName(int column) which should return the needed data but many driver just return null.

Regards,
Stefan.

Mike C wrote:

Ah, that seems to have fixed it.

So now I clicked 'show database structure' to show me the SQL Schema. In the SQL Schema viewer, that column has the little yellow key icon beside it. So it seems this combination of MySql, ConnectorJ driver and IDEA are able to retrieve the primary key.

Any reason the SQL query editor would fail to do so?

0
Comment actions Permalink

I cant edit too in DB2, and when i saw the struct database he find correctly the PK's.

0

Please sign in to leave a comment.