Home » SQL & PL/SQL » SQL & PL/SQL » Spool + user defined cells (oracle 10g)
Spool + user defined cells [message #418766] Tue, 18 August 2009 09:08 Go to next message
dior
Messages: 25
Registered: April 2009
Junior Member
Hi,

I use a spool option to spool several sql outputs (several sql files with count(*)) into a csv file.

The sql file is:

spool count_test.csv

set colsep ';'	

select '' from dual;


@count_A.sql
@count_B.sql
@count_C.sql
@count_D.sql
@count_E.sql
@count_F.sql
@count_G.sql


spool off  
quit


so far, the result looks like:

280
0
11
304
900
0
1


What I like to have, is a predefined text in column B.
The result should look like this:

280    Result a
0      Result b
11     Result c
304    Result d
900    Result e
0      Result f
1      Result g



thx
Re: Spool + user defined cells [message #418772 is a reply to message #418766] Tue, 18 August 2009 09:13 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
select count(*), 'Result a'...

And so on.

Regards
Michel
Re: Spool + user defined cells [message #418773 is a reply to message #418772] Tue, 18 August 2009 09:15 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Also use "Prompt" instead of "select '' from dual;"
No need to call Oracle server to print a blank line.

Regards
Michel
Re: Spool + user defined cells [message #418777 is a reply to message #418772] Tue, 18 August 2009 09:21 Go to previous message
dior
Messages: 25
Registered: April 2009
Junior Member
of course,... Embarassed

thx
Previous Topic: ORA-0090 : missing or invalid privilege (create user und give/grant him privilege)
Next Topic: open a URL using Oracle Pl/Sql (merged 3)
Goto Forum:
  


Current Time: Sun Dec 04 02:29:44 CST 2016

Total time taken to generate the page: 0.12870 seconds