Generate SQL becomes inactivated during mouse over #158
-
I am new to DBeaver. Is the Generate SQL option supposed to work? Because I select a whole row and right click to Generate SQL and it always becomes disabled/inactive when mousing over to click and select an autogenerate SQL statement based on the data I selected. I could not find any documentation that states it doesn't work or is not yet completed. |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments
-
It is. It works for me, I just tried it as you described: by selecting a whole row and choosing Generate SQL. To clarify, when you select one of the Generate SQL options, the "Generated SQL" dialog opens, but then you cannot click on or in the dialog (entire dialog becomes disabled)? |
Beta Was this translation helpful? Give feedback.
-
The menu item is enabled on initial dialog popup, but then it is disabled on mouse hover, not the entire dialog. I am using a custom driver, not sure if that is the cause. It seems to refresh the dialog when I hover over the menu item and then it is disabled after it completes the refresh of the dialog popup. |
Beta Was this translation helpful? Give feedback.
-
I found the check but I got lost somewhere trying to figure out how it works. It's probably to do with your driver. Serge should be able to give you a definitely answer and point you in the right direction to get this feature working. |
Beta Was this translation helpful? Give feedback.
-
Results viewer can generate following SQL queries:
You are using results of custom SQL query. So, probably results of your query doesn't contain any unique key (or DBeaver can't determine it). And INSERT query can be generated only if your query is a simple SELECT * FROM table-name. You could try to open some table (tab Data) and check how Generate SQL works there. |
Beta Was this translation helpful? Give feedback.
-
Yes, the company I work for does not have any defined primary keys in their tables, but there is unique data. Why does table data tab work, but the sql editor results panel does not? |
Beta Was this translation helpful? Give feedback.
-
Sometimes DBeaver can't determine source table from a custom SQL query. But when you view table data it always knows the table. |
Beta Was this translation helpful? Give feedback.
-
It is a custom-built JDBC driver that connects to Ingres database. It's not clear why it was built vs. using Ingres' JDBC driver, but it's a legacy application. Wouldn't they both use select * from table? It's odd. At least there is a workaround in my situation. |
Beta Was this translation helpful? Give feedback.
-
I ran into this problem myself and noticed that the SQL generator can be sensitive how the table in the query is referenced. On MSSQL this query gives an empty Generate SQL menu:
but with a more qualified table reference using the dbo prefix Generate SQL works as expected:
|
Beta Was this translation helpful? Give feedback.
-
Yes, thank you for the workaround. I have been using it frequently. |
Beta Was this translation helpful? Give feedback.
I ran into this problem myself and noticed that the SQL generator can be sensitive how the table in the query is referenced. On MSSQL this query gives an empty Generate SQL menu:
select * from MYTABLE
but with a more qualified table reference using the dbo prefix Generate SQL works as expected:
select * from dbo.MYTABLE