Jyothi_pg
asked on
Formatting output file after running it from isql
Hi,
I would like to format the output file from isql. My command is something like this..
isql -s "|" -i "inputfile" -o "outputfile" -b -w 400
I have suppressed the (3 rows affected) message by including SET NOCOUNT ON in the stored procedure. But i'm getting 2 lines of "return status=0" in the output file which i would like to eliminate. I would like the output file to have pure data with the delimiters. I would be thankful if I get some help to resolve this matter.
Thanks.
I would like to format the output file from isql. My command is something like this..
isql -s "|" -i "inputfile" -o "outputfile" -b -w 400
I have suppressed the (3 rows affected) message by including SET NOCOUNT ON in the stored procedure. But i'm getting 2 lines of "return status=0" in the output file which i would like to eliminate. I would like the output file to have pure data with the delimiters. I would be thankful if I get some help to resolve this matter.
Thanks.
Assuming you are on UNIX:
isql -s "|" -i <inputfile> -b -w 400 | grep -v "return status=" | tee <outputfile>
isql -s "|" -i <inputfile> -b -w 400 | grep -v "return status=" | tee <outputfile>
try this
isql -U$USERNAME -P$PASSWORD -S$SERVER -s"|" -o$RESULTFILE <<!
select * from table1,table2 where table1_Field1=table2_Field 2
go
!
cat $RESULTFILE|sed -n "3,$ p"|grep ^\| > $RESULTFILE.temp
mv -f $RESULTFILE.temp $RESULTFILE
isql -U$USERNAME -P$PASSWORD -S$SERVER -s"|" -o$RESULTFILE <<!
select * from table1,table2 where table1_Field1=table2_Field
go
!
cat $RESULTFILE|sed -n "3,$ p"|grep ^\| > $RESULTFILE.temp
mv -f $RESULTFILE.temp $RESULTFILE
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.sybase.com/detail?id=1013403
Best of times!