question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generate SQL with selected columns option

See original GitHub issue

Not sure whether I should say it as enhancement or new feature request, but It would be nice to have the below option in Dbeaver.

We have an option in Dbeaver to generate INSERT, UPDATE, etc. queries dynamically. But with the current implementation it does consider all the available column on the grid.

I have a suggestion/request to consider only selected columns OR provide new option to Generate SQL with selected columns or even nested options are fine like below.

e.g. In the below example, I have selected only Column 1, Column 4 and Column 5, so it should generate INSERT/UPDATE considering only 3 columns and not all the available columns.

Note: I have edited the SQL Preview screen just so that others can visualize it very easily.

Context Menu

image

Output

image

Workaround:

There is a workaround for this, is to select only columns for those we want to generate SQL. e.g.

SELECT "Column 1", "Column 4", "Column 5" FROM TEST;

With this, generate SQL option will consider available columns and will generate SQL accordingly.

It would be nice to have above mentioned feature to generate SQL with selected columns so, user don’t have to prepare SQL every time if he wants to generate SQL with selective columns.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
serge-ridercommented, Aug 4, 2022

Let’s improve it:

  • All Generate SQL command will respect currently selected columns (if more than one column is selected)
  • In SQL preview dialog add checkbox “Use selected columns only”. It is enabled by default if more than one column is selected
  • Improve SQL preview dialog checkboxes UI. We have too many of them and UI is a bit messy. We can put them in two lines.
0reactions
E1izabethcommented, Aug 10, 2022

This request #6426 could be implemented in the scope of this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Selecting columns and tables - IBM
To select columns, choose one of the following options: Type SELECT , followed by the names of the columns in the order that...
Read more >
sql - Generate insert script for selected records? - Stack Overflow
Write your query with conditions in the where clause, and execute it. In the results, right click and you'll be presented with a...
Read more >
13.1.20.4 CREATE TABLE ... SELECT Statement
The ENGINE option is part of the CREATE TABLE statement, and should not be used ... SELECT , columns named only in the...
Read more >
SQL SELECT INTO statement
This article covers the SQL SELECT INTO statement including syntax, parameters and use with multiple tables, filegroups and a WHERE ...
Read more >
CREATE TABLE AS SELECT (Azure Synapse Analytics)
You cannot specify any other column options such as data types, collation, or nullability. Each of these attributes is derived from the results ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found