SQL-Plugin Editing Data

Hello,

I just started using SQL_plugin, and excuse my blindness :), I do not know how to edit the data in displayed results?
Is there a possibility to double click on a row or cell and change the vaule?

I know I can use SQL (update or insert), but it is so much typing....

7 comments

There are a number of conditions for editing the results:

  • The query has to be simple like 'select * from table_x'

or 'select column_a, column_b from table_x' because I must
parse it for the table name.

  • The table must contain a key column (displayed in yellow)

If the plugin couldn't obtain the key column automatically
you can also specify it manually by using the context menu
of the table. Note if you specify a column as key column
which is no real key it's possible that more than one row is updated.

  • The plugin must be able to determine the class for a column

either by the returned values or through the JDBC driver. If the
JDBC driver doesn't support the feature and all values are NULL
it's not possible.

  • Only simple types like Number, Boolean, String and Date are editable.


Bye, Stefan.


Adam wrote:

Hello,

I just started using SQL_plugin, and excuse my blindness :), I do not know how to edit the data in displayed results?
Is there a possibility to double click on a row or cell and change the vaule?

I know I can use SQL (update or insert), but it is so much typing....


0

Thank you for your answer.
I am using MSSQL, and as I see your page:
http://www.intellij.org/twiki/bin/view/Main/SQLQueryPlugin
it cannot see database metadata and primary keys.

I did not know I could set primary key manually. Now it works GREAT! :)

One more question - what is the problem with metadata in MSSQL? Is it the fault of database itself or the drivers?

Currently I am using jtds-0.5.2.jar driver from
http://jtds.sourceforge.net , and it seems to bu much more advanced than the current one. Maybe it could help?
But I still do not see the metadata.

0

I'm testing your plugin (pretty cool so far) and would like to be able to edit results as well. I'm using postgres 7.4, but its not finding the keys automatically. If I right click on the columns I can assign the keys, but I have to do that with every results table that I want to try to edit a value in...even if its a table that I have specified the primary keys in the past.

Is there anyway to let the plugin know that this is the key I want it to always use for that particular table? Would be nice to have the plugin remember the key settings for each table.

Thanks...

0

Is there anyway to let the plugin know that this is
the key I want it to always use for that particular
table? Would be nice to have the plugin remember the
key settings for each table.

Maybe the Plugin could have another option, checkbox like
"assume every first colum is primary key" ?
It would work in most cases (at least with the tables we design :)) and help the people that cannot access metadata.

What do you think about a such simple solution?

0

I think remembering manual selected keys is the best solution.
Using the first column as primary key would only work for queries with no explicit
columns like 'select * from table'.

Bye, Stefan.

Adam wrote:


>>Is there anyway to let the plugin know that this is
>>the key I want it to always use for that particular
>>table? Would be nice to have the plugin remember the
>>key settings for each table.
>>


Maybe the Plugin could have another option, checkbox like
"assume every first colum is primary key" ?
It would work in most cases (at least with the tables we design :)) and help the people that cannot access metadata.

What do you think about a such simple solution?


0

Hi,

How about using JDBC's Updatable Result Set feature?

Is this not feasible? Seems like this is exactly what
it was designed for. I don't know how many drivers
support it though.

--Joachim

0

Stefan,

I tried to investigate the problem with unability to read MetaData.
I am using MS SQL 2000 and a driver that supports metadata reading (jTDS).

The info I got form the designer of the driver (Alin Sinpalean) is
"If you'll use the SQL Server profiler to see what happens when you try to access the tables in ks-sql, you'll see that jTDS executes

which means that DatabaseMetaData.getTables was called with catalog 'myDb', schemaPattern 'sa', tableNamePattern null, and types {"TABLE"}.

The problem lies in the schemaPattern (in fact the actual schema, it's not a pattern in this case). ks-sql uses the login as schema name, which works with some databases but not SQL Server. As you can see, the login in this case is 'sa' while the actual schema is 'dbo' (that's the default for SQL Server). You can, however access the table list by going to Schemas/dbo/Tables. It works perfectly for me."

Look at the thread:
http://sourceforge.net/forum/message.php?msg_id=2429389

Is there anything you could do about it?

Best regards,
Adam

0

Please sign in to leave a comment.