Solved

Does the -w option work with isql?

Posted on 1998-06-29
7
493 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 50 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now