Reply to Re: iSQL - Blank line at the end of the iSql output file

Your name:

Reply:


Posted by John Bell on 10/17/79 11:27

Hi

You may want to try passing this through findstr e.g.

osql -E -d punclaim -ifred.sql -h-1 -w500 -n -b | findstr /V /r /c:"^$" >
fred.txt

Specifying the -d parameter to osql/isql will remove the need for the USE
statement in your SQL script, alternatively the SQL statements:

SET NOCOUNT ON
select * from punclaim..XYZ

There will still be a final carrage return, but not the blank line.

John

<yanakal@gmail.com> wrote in message
news:1127507732.803909.296490@z14g2000cwz.googlegroups.com...
> Hi,
> I'm using isql to query data and output the same to a flat file.
> The isql has the following command options ' -h-1 -w500 -n -b -s"" '.
> In the SQL_CODE, the first two lines before the select statement are
> use dbname
> set nocount on
> go
> When I run this, an additional blank line is put into the output file.
> Actually, there are two lines after the last result set in the output
> file. This file is being fed into another system and the blank line is
> causing validation issues.
> How can I supress this blank line?
>
> This script is run from windows and the isql is called from a bat
> script.
> Batch script ...
> ==========================================================
> ....
> isql -Uuserid -Ppassword -Sserver -i"%SQL_CODE%" -h-1 -w500 -n -b -s""
>>>"%OUT_FILE%"
> IF ERRORLEVEL 0 SET RC=0
> IF ERRORLEVEL 1 exit 4
> ==========================================================
> SQL code ...
> ==========================================================
> use punclaim
> set NOCOUNT ON
> GO
> select * from XYZ;
> GO
> ==========================================================
>
> Your help is greatly appreciated.
> Yash
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация