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.

Connection property string lengths

6 posts in General Discussion Last posting was on 2008-04-15 14:14:29.0Z
JasonL Posted on 2008-04-14 16:14:36.0Z
Sender: 639b.4803822b.1804289383@sybase.com
From: JasonL
Newsgroups: ianywhere.public.general
Subject: Connection property string lengths
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <480382ec.63ab.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 Apr 2008 09:14:36 -0700
X-Trace: forums-1-dub 1208189676 10.22.241.41 (14 Apr 2008 09:14:36 -0700)
X-Original-Trace: 14 Apr 2008 09:14:36 -0700, 10.22.241.41
Lines: 11
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6806
Article PK: 5043

Hi,

I'm looking for a way to get the size of the string returned
by select connection_property('APPINFO'). I'm currently
using a fixed length string, however the data can overflow
this variable leading to an exception. I'd like this to be
as efficient as possible.


Thanks,
Jay


"Nick Elson" < Posted on 2008-04-14 16:44:04.0Z
From: "Nick Elson" <@@@nick@@@.@@@elson@sybase@@@.@@@com@@@>
Newsgroups: ianywhere.public.general
References: <480382ec.63ab.1681692777@sybase.com>
Subject: Re: Connection property string lengths
Lines: 33
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <480389d4$1@forums-1-dub>
Date: 14 Apr 2008 09:44:04 -0700
X-Trace: forums-1-dub 1208191444 10.22.241.152 (14 Apr 2008 09:44:04 -0700)
X-Original-Trace: 14 Apr 2008 09:44:04 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6807
Article PK: 5044

In theory this can be any length; being a varchar.

Part of the problem is things like the length of the
;EXE= subfield within that are not determined by
our software. If, for example your client application
is

c:\Program File\
<Company Name>\
<an <n>KB long path>\
<an extra long file name>.exe

then that can add excessive amounts of data to the middle
of your appinfo string.


If you can control that, then maybe you can determine your
own maximum length.

<JasonL> wrote in message news:480382ec.63ab.1681692777@sybase.com...
> Hi,
>
> I'm looking for a way to get the size of the string returned
> by select connection_property('APPINFO'). I'm currently
> using a fixed length string, however the data can overflow
> this variable leading to an exception. I'd like this to be
> as efficient as possible.
>
>
> Thanks,
> Jay


"Nick Elson" < Posted on 2008-04-14 16:46:54.0Z
From: "Nick Elson" <@@@nick@@@.@@@elson@sybase@@@.@@@com@@@>
Newsgroups: ianywhere.public.general
References: <480382ec.63ab.1681692777@sybase.com> <480389d4$1@forums-1-dub>
Subject: Re: Connection property string lengths
Lines: 51
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <48038a7e$1@forums-1-dub>
Date: 14 Apr 2008 09:46:54 -0700
X-Trace: forums-1-dub 1208191614 10.22.241.152 (14 Apr 2008 09:46:54 -0700)
X-Original-Trace: 14 Apr 2008 09:46:54 -0700, vip152.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6808
Article PK: 5046

The other field (also entirely under your control)
is the client connection string parameter

APPINFO=

If (any of) your application(s) set that, the maxiumum
length for that will also need to be determined and
factored in.

Caveat, anyone that can modify the connection string
can also add addition information this way; as well.

"Nick Elson" <@@@nick@@@.@@@elson@sybase@@@.@@@com@@@> wrote in message
news:480389d4$1@forums-1-dub...
> In theory this can be any length; being a varchar.
>
> Part of the problem is things like the length of the
> ;EXE= subfield within that are not determined by
> our software. If, for example your client application
> is
>
> c:\Program File\
> <Company Name>\
> <an <n>KB long path>\
> <an extra long file name>.exe
>
> then that can add excessive amounts of data to the middle
> of your appinfo string.
>
>
> If you can control that, then maybe you can determine your
> own maximum length.
>
> <JasonL> wrote in message news:480382ec.63ab.1681692777@sybase.com...
>> Hi,
>>
>> I'm looking for a way to get the size of the string returned
>> by select connection_property('APPINFO'). I'm currently
>> using a fixed length string, however the data can overflow
>> this variable leading to an exception. I'd like this to be
>> as efficient as possible.
>>
>>
>> Thanks,
>> Jay
>
>


Shuchit Posted on 2008-04-15 02:20:28.0Z
Newsgroups: ianywhere.public.general
Subject: Re: Connection property string lengths
From: Shuchit <me@privacy.net>
References: <480382ec.63ab.1681692777@sybase.com>
Message-ID: <Xns9A80E33C3C24svelkarprivacynet@127.0.0.1>
User-Agent: Xnews/2006.08.24 Hamster/2.1.0.11
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 14 Apr 2008 19:20:28 -0700
X-Trace: forums-1-dub 1208226028 10.22.241.152 (14 Apr 2008 19:20:28 -0700)
X-Original-Trace: 14 Apr 2008 19:20:28 -0700, vip152.sybase.com
Lines: 15
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6809
Article PK: 5045


> I'm looking for a way to get the size of the string returned
> by select connection_property('APPINFO'). I'm currently
> using a fixed length string, however the data can overflow
> this variable leading to an exception. I'd like this to be
> as efficient as possible.
>

Use the char_length function to get the size of the string in terms of
characters.
eg: select char_length(connection_property('APPINFO'))

There is also a byte_length function to get the size of the string in bytes.


Shuchit


John Smirnios Posted on 2008-04-15 13:50:20.0Z
From: John Smirnios <smirnios_at_sybase.com>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Connection property string lengths
References: <480382ec.63ab.1681692777@sybase.com>
In-Reply-To: <480382ec.63ab.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4804b29c$1@forums-1-dub>
Date: 15 Apr 2008 06:50:20 -0700
X-Trace: forums-1-dub 1208267420 10.22.241.152 (15 Apr 2008 06:50:20 -0700)
X-Original-Trace: 15 Apr 2008 06:50:20 -0700, vip152.sybase.com
Lines: 27
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6810
Article PK: 5047

Other than querying the length ahead of time (and taking into
consideration that charset conversion can change the length...), you
could handle the exception and then use GET DATA (or whatever is the
equivalent in the language you are using) to get the rest of it.

-john.

--
John Smirnios
Senior Software Developer
iAnywhere Solutions Engineering

Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
Developer Community at http://www.ianywhere.com/developer

JasonL wrote:
> Hi,
>
> I'm looking for a way to get the size of the string returned
> by select connection_property('APPINFO'). I'm currently
> using a fixed length string, however the data can overflow
> this variable leading to an exception. I'd like this to be
> as efficient as possible.
>
>
> Thanks,
> Jay


Breck Carter [sqlanywhere.blogspot.com] Posted on 2008-04-15 14:14:29.0Z
From: "Breck Carter [sqlanywhere.blogspot.com]" <NOSPAM__breck.carter@gmail.com>
Newsgroups: ianywhere.public.general
Subject: Re: Connection property string lengths
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__breck.carter@gmail.com
Message-ID: <isd9045p47ki9lt4viganuggsr7oj1eqaj@4ax.com>
References: <480382ec.63ab.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.640
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Date: 15 Apr 2008 07:14:29 -0700
X-Trace: forums-1-dub 1208268869 10.22.241.152 (15 Apr 2008 07:14:29 -0700)
X-Original-Trace: 15 Apr 2008 07:14:29 -0700, vip152.sybase.com
Lines: 30
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:6811
Article PK: 5048

If you are using V9 or higher you can use the EXPRTYPE function to
determine data types:

SELECT EXPRTYPE ( 'select connection_property(''APPINFO'')', 1 );

In versions 9, 10 and 11 that returns 'varchar(32000)'

Breck

On 14 Apr 2008 09:14:36 -0700, JasonL wrote:

>Hi,
>
>I'm looking for a way to get the size of the string returned
>by select connection_property('APPINFO'). I'm currently
>using a fixed length string, however the data can overflow
>this variable leading to an exception. I'd like this to be
>as efficient as possible.
>
>
>Thanks,
>Jay

--
Breck Carter http://sqlanywhere.blogspot.com/

RisingRoad SQL Anywhere and MobiLink Professional Services
breck.carter@risingroad.com