Solved

Does the -w option work with isql?

Posted on 1998-06-29
7
500 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

 

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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

This article outlines some of the reasons why an email message gets flagged as spam on a recipient's end.
Let’s face it: one of the reasons your organization chose a SaaS solution (whether Microsoft Dynamics 365, Netsuite or SAP) is that it is subscription-based. The upkeep is done. Or so you think.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

734 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