Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Does the -w option work with isql?

Posted on 1998-06-29
7
Medium Priority
?
504 Views
Last Modified: 2008-07-03
It seems to me that the -w for isql does not work.  I am using release 10.0.4 or 11.1.1 of isql and it always truncates my output row to 258 bytes.  Can  somebody please comfirm this.  Thanks.
0
Comment
Question by:tsl
  • 4
  • 3
7 Comments
 
LVL 10

Accepted Solution

by:
bret earned 150 total points
ID: 1098113
I can demonstrate that it works properly on Solaris.  It is probably your terminal that is
truncating the output (bcp wraps output rather than truncates it).

Is this on a UNIX box?  What kind of terminal are you using (xterm, sun, vt100, etc.)

Try this:

isql -Usa -P << EOF
use tempdb
go
create table isqltest(a char(255), b char(255), c char(255))
go
insert isqltest values ("a", "b","c")
go
exit
EOF
isql -Usa -P -w900 -o foobar.out << EOF
select * from tempdb..isqltest
go
exit
EOF
cut -c 240-260 foobar.out
cut -c 500-520 foobar.out

The first "cut" should show the "b" on the first line,
the second "cut" should show the "c".
0
 

Author Comment

by:tsl
ID: 1098114
I am using Solaris 2.5.1 and TERM=vt100.  When I try changing TERM to xterm same problem occurs.  Does not appear to be the TERM setting.  Any other ideas?

Thanks
0
 

Author Comment

by:tsl
ID: 1098115
This is one column that I am selecting.  The column is a shell script that will be run by the shell.  The column is like this
select
      "cd "+s.src_dir+"@"+"if test -f "+s.src_file+"@"+"do something etc@"

The @ symbols are turned into newlines and then the ouput is fed to ksh for execution.  Maybe one column has a restriction of 258.
0
New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

 

Author Comment

by:tsl
ID: 1098116
Yes, that was the problem.  By breaking the select line up into columns by adding commas makes it work.  For example:
select
      "cd "+s.src_dir+"@",
      "if test -f "+s.src_file+"@",
      "then@",
      "      do something@",
      "fi@"
      
0
 
LVL 10

Expert Comment

by:bret
ID: 1098117
Oh, yes.  An individual column cannot contain more than 255 characters, max.

You could probably rewrite this asfollows (note that it is good form to
name all your columns; starting the column names with
"--" converts them into non-executable comments for the shellscript):

select
"cd "+s.src_dir+"@" as "--",
"if test -f "+s.src_file+"@" as "---",
"do something etc." + "@" as "----"

-bret
0
 

Author Comment

by:tsl
ID: 1098118
Thanks alot for your help Bret.

-tom
0
 
LVL 10

Expert Comment

by:bret
ID: 1098119
Oh, yes.  An individual column cannot contain more than 255 characters, max.

You could probably rewrite this asfollows (note that it is good form to
name all your columns; starting the column names with
"--" converts them into non-executable comments for the shellscript):

select
"cd "+s.src_dir+"@" as "--",
"if test -f "+s.src_file+"@" as "---",
"do something etc." + "@" as "----"

-bret
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
Aerodynamic noise is the cause of the majority of the noise produced by helicopters. The inordinate amount of noise helicopters produce is a major problem in the both a military and civilian setting. To remedy this problem the use of an aerogel coat…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Screencast - Getting to Know the Pipeline

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question