Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

isql truncates columns to 512 chars in select

8 posts in General Discussion Last posting was on 2011-05-17 15:45:26.0Z
joe_maniac Posted on 2011-05-17 11:18:57.0Z
Sender: 5aba.4dd24572.1804289383@sybase.com
From: joe_maniac
Newsgroups: sybase.public.ase.general
Subject: isql truncates columns to 512 chars in select
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4dd259a1.5d67.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 May 2011 04:18:57 -0700
X-Trace: forums-1-dub 1305631137 10.22.241.41 (17 May 2011 04:18:57 -0700)
X-Original-Trace: 17 May 2011 04:18:57 -0700, 10.22.241.41
Lines: 16
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30171
Article PK: 72351

Hi all,

I noticed strange behavior of isql. Assume having a table
created like "CREATE TABLE MYTAB (MYCOL varchar(700) not
null)". If I run (using "isql -w 1024") a query "SELECT
MYCOL FROM MYTAB", I get only first 512 characters of this
column.

Is this documented somewhere? Or can I change this settings?

Interesting is, that in gui application Interactive SQL,
this can be set by option "Truncation length".

Thanks for any input

Joe


joe_maniac Posted on 2011-05-17 11:24:10.0Z
Sender: 5aba.4dd24572.1804289383@sybase.com
From: joe_maniac
Newsgroups: sybase.public.ase.general
Subject: Re: isql truncates columns to 512 chars in select
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4dd25ada.5d7b.1681692777@sybase.com>
References: <4dd259a1.5d67.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 May 2011 04:24:10 -0700
X-Trace: forums-1-dub 1305631450 10.22.241.41 (17 May 2011 04:24:10 -0700)
X-Original-Trace: 17 May 2011 04:24:10 -0700, 10.22.241.41
Lines: 5
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30172
Article PK: 72350

I can't use any extensions like Sybase IQ or SQL Anywhere.
Solution should be made only using isql utility (from
standard ASE installation).

Joe


Mark Gearhart Posted on 2011-05-17 12:06:39.0Z
Sender: 5e13.4dd26283.1804289383@sybase.com
From: Mark Gearhart
Newsgroups: sybase.public.ase.general
Subject: Re: isql truncates columns to 512 chars in select
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4dd264cf.5e3a.1681692777@sybase.com>
References: <4dd259a1.5d67.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 May 2011 05:06:39 -0700
X-Trace: forums-1-dub 1305633999 10.22.241.41 (17 May 2011 05:06:39 -0700)
X-Original-Trace: 17 May 2011 05:06:39 -0700, 10.22.241.41
Lines: 60
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30173
Article PK: 72352


> Hi all,
>
> I noticed strange behavior of isql. Assume having a table
> created like "CREATE TABLE MYTAB (MYCOL varchar(700) not
> null)". If I run (using "isql -w 1024") a query "SELECT
> MYCOL FROM MYTAB", I get only first 512 characters of this
> column.
>

Work OK for me:

1> create table mytab(mycol varchar(700) not null)
2> go
1> insert into mytab values
("12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012
34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789011111111112222222222333333333344444444445555555555666666666677777777778888888888999999999
90000000000")
2> go


1> select * from mytab
2> go
mycol

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000

(1 row affected)

1> select char_length(mycol) from mytab
2> go

-----------
700

(1 row affected)


I'm using this version of isql:

$ isql -v
Sybase CTISQL Utility/15.0/P-EBF16285 ESD
#16/DRV.15.0.7/SPARC/Solaris 8/BUILD1500-112/OPT/Sun Oct 12
18:18:59 2008




> Is this documented somewhere? Or can I change this
> settings?
>
> Interesting is, that in gui application Interactive SQL,
> this can be set by option "Truncation length".
>
> Thanks for any input
>
> Joe


joe_maniac Posted on 2011-05-17 12:48:06.0Z
Sender: 5f1d.4dd26e20.1804289383@sybase.com
From: joe_maniac
Newsgroups: sybase.public.ase.general
Subject: Re: isql truncates columns to 512 chars in select
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4dd26e85.5f30.1681692777@sybase.com>
References: <4dd264cf.5e3a.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 May 2011 05:48:06 -0700
X-Trace: forums-1-dub 1305636486 10.22.241.41 (17 May 2011 05:48:06 -0700)
X-Original-Trace: 17 May 2011 05:48:06 -0700, 10.22.241.41
Lines: 84
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30174
Article PK: 72354

Hi Mark,

many thanks for your response! You're right, isql prints the
"full length" of a column. I focused on the heading (which
indeed is truncated to 512) and didn't look at data itself
:-(

Unfortunately this makes the result unaligned... Is there
any possibility how to get the heading not truncated (see
example results below)?

create table mytab(mycol varchar(700) not null, myid int not
null)
go
insert into mytab
values(1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000
,1)
go
insert into mytab values(1234567890,2)
go
select * from mytab
go

Output with isql:
mycol







myid

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------

1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000
1
1234567890







2

Output with gui application Interactive SQL (I'd need the
same using isql):
mycol










myid
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----------
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000
1
1234567890










2


Thanks

Joe


Mark Gearhart Posted on 2011-05-17 13:54:46.0Z
Sender: 5e13.4dd26283.1804289383@sybase.com
From: Mark Gearhart
Newsgroups: sybase.public.ase.general
Subject: Re: isql truncates columns to 512 chars in select
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4dd27e26.608d.1681692777@sybase.com>
References: <4dd26e85.5f30.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 May 2011 06:54:46 -0700
X-Trace: forums-1-dub 1305640486 10.22.241.41 (17 May 2011 06:54:46 -0700)
X-Original-Trace: 17 May 2011 06:54:46 -0700, 10.22.241.41
Lines: 182
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30176
Article PK: 72355

Yes, I see what you mean. The "-----" for the heading is 512
characters long, not 700. I don't see any options in isql
which might be applicable. Seems like an odd behavior. Maybe
a bug?

Mark

> Hi Mark,
>
> many thanks for your response! You're right, isql prints
> the "full length" of a column. I focused on the heading
> (which indeed is truncated to 512) and didn't look at data
> itself :-(
>
> Unfortunately this makes the result unaligned... Is there
> any possibility how to get the heading not truncated (see
> example results below)?
>
> create table mytab(mycol varchar(700) not null, myid int
> not null)
> go
> insert into mytab
> values(123456789012345678901234567890123456789012345678901
> 2345678901234567890123456789012345678901234567890123456789
> 0123456789012345678901234567890123456789012345678901234567
> 8901234567890123456789012345678901234567890123456789012345
> 6789012345678901234567890123456789012345678901234567890123
> 4567890123456789012345678901234567890123456789012345678901
> 2345678901234567890123456789012345678901234567890123456789
> 0123456789012345678901234567890123456789012345678901234567
> 8901234567890123456789012345678901234567890123456789012345
> 6789012345678901234567890123456789012345678901234567890123
> 4567890123456789012345678901111111111222222222233333333334
> 4444444445555555555666666666677777777778888888888999999999
> 90000000000 ,1)
> go
> insert into mytab values(1234567890,2)
> go
> select * from mytab
> go
>
> Output with isql:
> mycol
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> myid
>
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ------------------------------------------------
> -----------
>
> 1234567890123456789012345678901234567890123456789012345678
> 9012345678901234567890123456789012345678901234567890123456
> 7890123456789012345678901234567890123456789012345678901234
> 5678901234567890123456789012345678901234567890123456789012
> 3456789012345678901234567890123456789012345678901234567890
> 1234567890123456789012345678901234567890123456789012345678
> 9012345678901234567890123456789012345678901234567890123456
> 7890123456789012345678901234567890123456789012345678901234
> 5678901234567890123456789012345678901234567890123456789012
> 3456789012345678901234567890123456789012345678901234567890
> 1234567890123456789011111111112222222222333333333344444444
> 4455555555556666666666777777777788888888889999999999000000
> 0000
> 1
> 1234567890
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 2
>
> Output with gui application Interactive SQL (I'd need the
> same using isql):
> mycol
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> myid
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ----------------------------------------------------------
> ---- -----------
> 1234567890123456789012345678901234567890123456789012345678
> 9012345678901234567890123456789012345678901234567890123456
> 7890123456789012345678901234567890123456789012345678901234
> 5678901234567890123456789012345678901234567890123456789012
> 3456789012345678901234567890123456789012345678901234567890
> 1234567890123456789012345678901234567890123456789012345678
> 9012345678901234567890123456789012345678901234567890123456
> 7890123456789012345678901234567890123456789012345678901234
> 5678901234567890123456789012345678901234567890123456789012
> 3456789012345678901234567890123456789012345678901234567890
> 1234567890123456789011111111112222222222333333333344444444
> 4455555555556666666666777777777788888888889999999999000000
> 0000 1
> 1234567890
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 2
>
>
> Thanks
>
> Joe


joe_maniac Posted on 2011-05-17 14:08:14.0Z
Sender: 5f1d.4dd26e20.1804289383@sybase.com
From: joe_maniac
Newsgroups: sybase.public.ase.general
Subject: Re: isql truncates columns to 512 chars in select
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4dd2814e.60d3.1681692777@sybase.com>
References: <4dd27e26.608d.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 May 2011 07:08:14 -0700
X-Trace: forums-1-dub 1305641294 10.22.241.41 (17 May 2011 07:08:14 -0700)
X-Original-Trace: 17 May 2011 07:08:14 -0700, 10.22.241.41
Lines: 15
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30177
Article PK: 72356


> Yes, I see what you mean. The "-----" for the heading is
> 512 characters long, not 700.

Yes, exactly.

> I don't see any options in isql which might be applicable.
> Seems like an odd behavior. Maybe a bug?

I can't imagine why this behavior could be intended, hence I
see it as a bug too...


Thanks for your help

Joe


Sherlock, Kevin [TeamSybase] Posted on 2011-05-17 15:31:35.0Z
From: "Sherlock, Kevin [TeamSybase]" <kevin.sherlock@teamsybase.com>
Newsgroups: sybase.public.ase.general
References: <4dd259a1.5d67.1681692777@sybase.com>
Subject: Re: isql truncates columns to 512 chars in select
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4dd294d7$1@forums-1-dub>
Date: 17 May 2011 08:31:35 -0700
X-Trace: forums-1-dub 1305646295 10.22.241.152 (17 May 2011 08:31:35 -0700)
X-Original-Trace: 17 May 2011 08:31:35 -0700, vip152.sybase.com
X-Authenticated-User: teamsybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30178
Article PK: 72357

what version of "isql" ?

isql -v

Older versions of open-client (isql included) don't know about long
character datatypes.

<joe_maniac> wrote in message news:4dd259a1.5d67.1681692777@sybase.com...
> Hi all,
>
> I noticed strange behavior of isql. Assume having a table
> created like "CREATE TABLE MYTAB (MYCOL varchar(700) not
> null)". If I run (using "isql -w 1024") a query "SELECT
> MYCOL FROM MYTAB", I get only first 512 characters of this
> column.
>
> Is this documented somewhere? Or can I change this settings?
>
> Interesting is, that in gui application Interactive SQL,
> this can be set by option "Truncation length".
>
> Thanks for any input
>
> Joe


joe_maniac Posted on 2011-05-17 15:45:26.0Z
Sender: 62f2.4dd297c9.1804289383@sybase.com
From: joe_maniac
Newsgroups: sybase.public.ase.general
Subject: Re: isql truncates columns to 512 chars in select
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4dd29816.62fd.1681692777@sybase.com>
References: <4dd294d7$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 17 May 2011 08:45:26 -0700
X-Trace: forums-1-dub 1305647126 10.22.241.41 (17 May 2011 08:45:26 -0700)
X-Original-Trace: 17 May 2011 08:45:26 -0700, 10.22.241.41
Lines: 10
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.ase.general:30179
Article PK: 72361

Sybase CTISQL Utility/15.0/P-EBF14167 ESD #7/PC
Intel/BUILD1500-093/OPT/Wed Dec 13 20:04:04 2006

> what version of "isql" ?
>
> isql -v
>
> Older versions of open-client (isql included) don't know
> about long character datatypes.
>