var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: isql help
I am having a little trouble with some isql formating...
Say I have a file called in.sql with the following...
select count(1) from <table name>
Now if I run this...using isql as follows...
isql -U<user> -P<passwd> -i in.sql -o out.txt
I get the following in out.txt
(1 row affected)
Instead of this what I want is just the number 17628.
So I modified in.sql as follows...
set nocount on
select count(1) from <table>
Now in out.txt I get....
Still not perfect...
I tried various things like using isql options -h and -n but no luck...
At the top of out.txt there is blank line, followed by a line with
Anyway I can get rid of these two lines?? What formatting needs to be done??? Is it at all possible?? Can somebody help me?
Please let me know...
Thanks a lot.
isql -Usa -P -SASE125 -iin.txt | sed -e '/affected/d' -e '/---/d' > out.txt
Thanks a lot for this reply...
Unfortunately not sure about sed usage...
Could you possibly provide a breakdown of some of the sed syntax used here and explain in more detail as to what is being achieved??
Thanks a lot !
sed --- command
-e '/affected/d' --- delete all lines from files with word "affected" in it
-e '/---/d' --- delete all lines from files with word "---" in it
What about the first blank line at the top??
Anyways can we not just do
sed 1,2d ?? This just removes the first two lines...
(Assuming the set nocount on is used to remove the rows affected message)
So, from all this, I take it that there is no way to achieve this kind of formatting using just isql alone...
Thanks a lot, ALL.
Yeah! you can further customize it using sed or you could simply look at using sqsh.
Last edited by willy_and_the_ci; 05-11-04 at 01:49.
isql -U<user> -P<passwd> -b -s -i in.sql -o out.txt
This is wonderful!