I've written a query to generate a set of queries. My problem is that when I copy all the results each cell is surrounded by double quotes ("). If I only copy one cell I don't have this problem.
Is there something I can do or set up differently to stop the double quotes from appearing?
Here's a simplified version of my query to show what's happening.
with Bob as
(select 'one' Row_Num
from Dual
union
select 'two'
from Dual)
select '-- tab=' || Row_Num || Chr(10) || 'select ' || 10 || ' "Query" from dual;'
from Dual,
Bob;
Results in
"-- tab=one
select 10 ""Query"" from dual;"
"-- tab=two
select 10 ""Query"" from dual;"
but I need
-- tab=one
select 10 "Query" from dual;
-- tab=two
select 10 "Query" from dual;
I didn't have this problem until I added the '-- tab=' || Row_Num || Chr(10) || at the top. I also tried '/* tab=' || Row_Num || ' */' || Chr(10) || with the same results.
I need the comment so I can run the queries, copy the results into Excel, and easily recognize each of the 150 tabs I'm creating.
I'm running version 11.0.6.1796 (64 bit) on a Win7 machine. I'm copying by selecting the column by clicking on the heading and then Ctrl-C. I'm pasting with Ctrl-V into a new SQL Window.
Thanks for any suggestions.
Is there something I can do or set up differently to stop the double quotes from appearing?
Here's a simplified version of my query to show what's happening.
with Bob as
(select 'one' Row_Num
from Dual
union
select 'two'
from Dual)
select '-- tab=' || Row_Num || Chr(10) || 'select ' || 10 || ' "Query" from dual;'
from Dual,
Bob;
Results in
"-- tab=one
select 10 ""Query"" from dual;"
"-- tab=two
select 10 ""Query"" from dual;"
but I need
-- tab=one
select 10 "Query" from dual;
-- tab=two
select 10 "Query" from dual;
I didn't have this problem until I added the '-- tab=' || Row_Num || Chr(10) || at the top. I also tried '/* tab=' || Row_Num || ' */' || Chr(10) || with the same results.
I need the comment so I can run the queries, copy the results into Excel, and easily recognize each of the 150 tabs I'm creating.
I'm running version 11.0.6.1796 (64 bit) on a Win7 machine. I'm copying by selecting the column by clicking on the heading and then Ctrl-C. I'm pasting with Ctrl-V into a new SQL Window.
Thanks for any suggestions.