I have an idea for a new feature. When in a data grid and I select a 1 column and multiple rows, can we make the output able to be paste in a where clause?
Example
create table emp (empid varchar2(6));
insert into emp values(‘a’);
insert into emp values(‘b’);
insert into emp values(‘c’);
insert into emp values(‘d’);
insert into emp values(‘e’);
desc emp
I select 3 row and ctrl-c, then in the editor ctrl v i get:
a
b
c
It would be nice if i get empid in (‘a’,‘b’,‘c’) so i can paste into a where clause. No quotes if column is a number.
FYI, I noticed if i do ctrl-ins, the column name is in the buffer but not formatted for the where…
EMPID
a
b
c
Seems like maybe this could fall under the “Single Column Export” functionality. It just needs a “clipboard” and “Selected rows only” option. Let me see what I can come up with.
For a workaround until John gets that out in the next beta, you can use the replace box to do this. I have a saved find/replace macro for doing exactly this, and one that doesn't add the quotes. It is super fast and easy to use.
In the find portion enter:
\r\n
In Replace with enter:
', \r\n'
Then make sure you have regular expressions checked. Select the data from the grid, paste it into the editor and select it and run the replace macro in the selected text. You will have to add the starting and final ', but it is fast and easy and works well.
You can do the same thing to simply comma separate a set of data without the quotes, just leave the quotes off the replace with string.
On Wed, Mar 2, 2016 at 3:22 PM, John Dorlon bounce-jdorlon@toadworld.com wrote:
RE: feature - wrap values in , for number ' and , for strings in a data grid .
Reply by John Dorlon
Seems like maybe this could fall under the "Single Column Export" functionality. It just needs a "clipboard" and "Selected rows only" option. Let me see what I can come up with.
To reply, please reply-all to this email.
Stop receiving emails on this subject.
Or Unsubscribe from Toad for Oracle - Beta notifications altogether.
Toad for Oracle - Beta Discussion Forum
Flag this post as spam/abuse.
--
Phyllis Helton
Data Magician
Digital Products & Strategies, Cru | Data Sciences & Analytics
Office 407-515-4452
phyllis.helton@cru.org
Some time ago I raised on IdeaPond a feature request to generate resultset as a set of
select statements. Could be extended to selection only and generation of list (keeping in mind Oracle limits)
OK, check the next beta under grid -> rt-click -> Single Column Export. It’s not quite as fast as CTRL+C, but it will get you what you want.
I’ll take a look at your “select statement” request next
OK, the “Select statement” request is done for next beta. That’s in “Export Dataset”.