Copying from SQL Window results

dcurley

Member²
Hi,

Would it be possible to add a comma-separated copy option in the SQL window results frame? I often copy a single field from multiple records to use as an IN clause in a second query, and being able to choose comma-separated would be quite convenient.

Thanks,
Dave Curley
 
If this feature is added, the result values should be separated including apostrophe: ','

This will work better for strings, and will work for numbers anyway, since Orcacle does an implicit conversion to number.
 
Is this still on the list? I think it was mentioned in several topics over the years, but there's still no one click solution.
 
The Paste Options plug-in works for this. After you install it, you can copy a column from the SQL Window output or Excel. Then you have two new options in the Edit menu: ExcelPasteNbr and ExcelPasteString. When you paste using these options, it inserts an IN statement, comma separated for you.
 
Thanks, mike.
In the downloaded PasteOptions.ini, there's only ExcelPaste and MultiPaste, but ExcelPaste is good enough. I'll comment out MultiPaste as it's quite useless.
 
You're welcome. Maybe I changed mine. Here is what is in my PasteOptions.ini minus comments. ExcelPasteString put's single quotes around what is copied.

ExcelPasteString strip
ExcelPasteString replace /#13//#10/ '/#13//#10/ ,'
ExcelPasteString replace /#9/
ExcelPasteString replace '',
ExcelPasteString begin IN ('
ExcelPasteString end ')

ExcelPasteNbr strip
ExcelPasteNbr replace /#13//#10/ /#13//#10/ ,
ExcelPasteNbr replace /#9/
ExcelPasteNbr replace '',
ExcelPasteNbr begin IN (
ExcelPasteNbr end )
 
Last edited:
Back
Top