On Sep 11, 6:57 am, Swapna <[EMAIL PROTECTED]> wrote:
> Hi Guys,
>
> This is a sql file that generates a csv through spool
>
> set echo off
> set wrap off
> set HEADING ON
> set VERIFY OFF
> set FEEDBACK OFF
> set RECSEP OFF
> set PAGESIZE 0
> set LINESIZE 100
> set define ~
> set TAB off
> spool Rejected_Manufacturer.csv
> select Manufacturer from (
> select 'Manufacturer Code' as Manufacturer, 1 srno from dual
> union
> select distinct manufacturer_code as Manufacturer, 2 srno from
> vistaar_plant_mfg where Upper(rejected) like Upper('%manufacturer_code%')
> order by srno);
> spool off
> exit
>
> Now this file generates a heading as "Manufacturer Code" when there is no
> data.
> Now i need to delete the file. if it contains only this heading. But if i
> check the number of lines it displays more than one. i.e it is actually
> appending some blank lines.
>
> Please help me in this.
>
> Regards,
> Swapna

You have a UNION of a literal string and your table data, if there is
any, so most certainly you'll always get the single record from the
literal text selected against DUAL.  You don't mention how MANY blank
lines you find in this file, so who can say what may be happening with
this query?  You also supply no table creation script nor sample data
to test this on another system.

When you can provide sufficient information you can get a suitable
answer.


David Fitzjarrell
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to