I often copy the value of a cell in order to use it in a query I'm building. It would be handy if this "Paste to Query" function were a context menu item.
On a similar note, the column names should also be available for pasting into the query window. If you want to get fancy, the selected cells of the results grid could have a context menu item called "Paste to Query" which would format them thus:
Building Queries from existing results could become a new AquaFold signature art form.
Adding all this functionality to the current popup menu will make the menu too big. I think we can simplify if we collapse some of them into a sub menu. Something like :
Copy
Copy ... >
Copy w/Headers
Copy w/Row Count
Copy w/Headers and Row Count
Copy Headers Only
Copy All w/SQL
Copy As ..
Paste to Window >
Comma Separated Values
Comma Separated Headers
Quoted Comma Separated Values
Quoted Comma Separated Headers
Please clarify two-dimensional selection rules.
Please clarify two-dimensional selection rules.
What about Copy All w/SQL?
And should we spell these menus using "with" instead of "w/"?
What about Copy All w/SQL?
And should we spell these menus using "with" instead of "w/"?
I revised the menu to include the "Copy All w/SQL". I am ok with converting the "w/" to "with". All we need to do is reorder the menu items and implement the 4 Paste* actions. We will not make it more complicated then that for now.
I revised the menu to include the "Copy All w/SQL". I am ok with converting the "w/" to "with". All we need to do is reorder the menu items and implement the 4 Paste* actions. We will not make it more complicated then that for now.
FieldName1 | Fieldname2 |
OneValue | 100 |
TwoValue | 200 |
Proposed clarification of two-dimensional selection rules:
What to paste if you've selected:
This reflects the "with Headers" option.
FieldName1 | Fieldname2 |
OneValue | 100 |
TwoValue | 200 |
Proposed clarification of two-dimensional selection rules:
What to paste if you've selected:
This reflects the "with Headers" option.
Dave, this is custom/specialized code just for MySQL and SQL Server. I don't see a common user use case for this. Can you clarify the use case for this functionality? What is it that you do with this data?
Dave, this is custom/specialized code just for MySQL and SQL Server. I don't see a common user use case for this. Can you clarify the use case for this functionality? What is it that you do with this data?
I thought T-SQL was more universal, but the same idea can be applied for any database language. In each case, the text produced can be used either as a list of values ( as in "IN (x,y,z)"), as a subquery returning the values, or as the data to insert in an insert statement. I don't know other languages to provide examples for them.
The use case is in exploring the data using ADS: Once you get some information, you might want to use it in another query. All I do with the data is paste it into the Query Window at the last position of the caret.
I thought T-SQL was more universal, but the same idea can be applied for any database language. In each case, the text produced can be used either as a list of values ( as in "IN (x,y,z)"), as a subquery returning the values, or as the data to insert in an insert statement. I don't know other languages to provide examples for them.
The use case is in exploring the data using ADS: Once you get some information, you might want to use it in another query. All I do with the data is paste it into the Query Window at the last position of the caret.
1. added "Paste to Window" submenu
2. reordered the paste menu items: separated headers from values and also moved quoted to the first position (I suspect that will be the most frequently used one, but let me know if I am wrong here).
3. we could add more operations to this menu - for example paste as SELECT, or whatever, just like the customer wants. Please advise.
1. added "Paste to Window" submenu
2. reordered the paste menu items: separated headers from values and also moved quoted to the first position (I suspect that will be the most frequently used one, but let me know if I am wrong here).
3. we could add more operations to this menu - for example paste as SELECT, or whatever, just like the customer wants. Please advise.
I tested out the current Paste in Window and thought about Dave's use case. I think we should change the Paste in Window to ...
Paste to Window ->
Column Selection
IN Values
---------------------
SELECT Rows From Void
SELECT Column Body
INSERT Body
UPDATE Body
======= Results ============
Column Selection =
>> FieldName1, FieldName2
IN Values
>> ('OneValue', 'TwoValue')
(100,200)
SELECT Rows From Void
>> SELECT 'OneValue' AS FieldName1, 100 AS FieldName2
UNION ALL
SELECT 'TwoValue' AS FieldName1, 200 AS FieldName2
SELECT Column Body
>> SELECT FieldName1, FieldName2 FROM <TABLE_NAME>
INSERT Body
>> INSERT INTO <TABLE_NAME> (FieldName1, FieldName2) VALUES('OneValue', 100)
/
INSERT INTO <TABLE_NAME> (FieldName1, FieldName2) VALUES('TwoValue', 200)
/
UPDATE Body
>> UPDATE <TABLE_NAME> SET FieldName1='OneValue', FieldName2=100
/
UPDATE <TABLE_NAME> SET FieldName1='TwoValue', FieldName2=200
/
Dave, what do you think?
I tested out the current Paste in Window and thought about Dave's use case. I think we should change the Paste in Window to ...
Paste to Window ->
Column Selection
IN Values
---------------------
SELECT Rows From Void
SELECT Column Body
INSERT Body
UPDATE Body
======= Results ============
Column Selection =
>> FieldName1, FieldName2
IN Values
>> ('OneValue', 'TwoValue')
(100,200)
SELECT Rows From Void
>> SELECT 'OneValue' AS FieldName1, 100 AS FieldName2
UNION ALL
SELECT 'TwoValue' AS FieldName1, 200 AS FieldName2
SELECT Column Body
>> SELECT FieldName1, FieldName2 FROM <TABLE_NAME>
INSERT Body
>> INSERT INTO <TABLE_NAME> (FieldName1, FieldName2) VALUES('OneValue', 100)
/
INSERT INTO <TABLE_NAME> (FieldName1, FieldName2) VALUES('TwoValue', 200)
/
UPDATE Body
>> UPDATE <TABLE_NAME> SET FieldName1='OneValue', FieldName2=100
/
UPDATE <TABLE_NAME> SET FieldName1='TwoValue', FieldName2=200
/
Dave, what do you think?
I like it. I had some objection to the keywords in the last three, but if you don't want the whole SQL statement, then you can use the first three. Looks good!
I like it. I had some objection to the keywords in the last three, but if you don't want the whole SQL statement, then you can use the first three. Looks good!
Implemented as specified.
This function can be made potentially more generic and more useful - but that requires a different, wizard-like UI.
Implemented as specified.
This function can be made potentially more generic and more useful - but that requires a different, wizard-like UI.
This feature is implemented and verfied in 11.0.0-rc-81
This feature is implemented and verfied in 11.0.0-rc-81
Issue #6187 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build 11.0.0-rc-81 |
No time estimate |
Adding all this functionality to the current popup menu will make the menu too big. I think we can simplify if we collapse some of them into a sub menu. Something like :
Copy
Copy ... >
Copy w/Headers
Copy w/Row Count
Copy w/Headers and Row Count
Copy Headers Only
Copy All w/SQL
Copy As ..
Paste to Window >
Comma Separated Values
Comma Separated Headers
Quoted Comma Separated Values
Quoted Comma Separated Headers