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.

SQL simple question for ASA & Informix

4 posts in General Discussion Last posting was on 2004-10-17 14:34:44.0Z
ock Posted on 2004-10-16 04:15:08.0Z
Sender: 2616.416f89ab.1804289383@sybase.com
From: ock
Newsgroups: ianywhere.public.general
Subject: SQL simple question for ASA & Informix
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4170a048.37ec.1681692777@sybase.com>
X-Original-NNTP-Posting-Host: 10.22.241.42
X-Original-Trace: 15 Oct 2004 21:15:04 -0700, 10.22.241.42
Lines: 17
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 15 Oct 2004 21:15:05 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 15 Oct 2004 21:15:08 -0700
X-Trace: forums-1-dub 1097900108 10.22.108.75 (15 Oct 2004 21:15:08 -0700)
X-Original-Trace: 15 Oct 2004 21:15:08 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3738
Article PK: 7638

Hi all,

In informix I can use below sql statement :

Select *
From table1
Where stkcode[3,5] = '156';

note : stkcode hv 16 chars. eg : 8015610005500000

I get syntax error with ASA for above SQL statement.

My application will switch to either one database(Informix
or ASA) depand on the situation. Is there any similar
command that I can use for both database? Pls help.

thanks


Breck Carter [TeamSybase] Posted on 2004-10-16 16:39:23.0Z
From: "Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: SQL simple question for ASA & Informix
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <7ni2n0tq9gdda67ph7j5ovuh4lgug2cebm@4ax.com>
References: <4170a048.37ec.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
X-Original-NNTP-Posting-Host: bcarter.sentex.ca
X-Original-Trace: 16 Oct 2004 09:39:19 -0700, bcarter.sentex.ca
Lines: 37
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 16 Oct 2004 09:39:20 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 16 Oct 2004 09:39:23 -0700
X-Trace: forums-1-dub 1097944763 10.22.108.75 (16 Oct 2004 09:39:23 -0700)
X-Original-Trace: 16 Oct 2004 09:39:23 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3739
Article PK: 7639

ASA uses SUBSTR:

Select *
From table1
Where SUBSTR ( stkcode, 3, 5 ) = '156';

According the documentation, Informix has it too:
http://publib.boulder.ibm.com/epubs/pdf/ct1sqna.pdf

Breck

On 15 Oct 2004 21:15:08 -0700, ock wrote:

>Hi all,
>
>In informix I can use below sql statement :
>
> Select *
> From table1
> Where stkcode[3,5] = '156';
>
>note : stkcode hv 16 chars. eg : 8015610005500000
>
>I get syntax error with ASA for above SQL statement.
>
>My application will switch to either one database(Informix
>or ASA) depand on the situation. Is there any similar
>command that I can use for both database? Pls help.
>
>thanks

--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/ASIN/1556225067/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com


Paul Horan[TeamSybase] Posted on 2004-10-17 13:18:08.0Z
From: "Paul Horan[TeamSybase]" <paulhATvcisolutionsDOTcom>
Newsgroups: ianywhere.public.general
References: <4170a048.37ec.1681692777@sybase.com> <7ni2n0tq9gdda67ph7j5ovuh4lgug2cebm@4ax.com>
Subject: Re: SQL simple question for ASA & Informix
Lines: 22
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: ny-chicagostreet-cad1-bg1-69-160-30-132.bflony.adelphia.net
X-Original-NNTP-Posting-Host: ny-chicagostreet-cad1-bg1-69-160-30-132.bflony.adelphia.net
Message-ID: <41727110$1@forums-1-dub>
Date: 17 Oct 2004 06:18:08 -0700
X-Trace: forums-1-dub 1098019088 69.160.30.132 (17 Oct 2004 06:18:08 -0700)
X-Original-Trace: 17 Oct 2004 06:18:08 -0700, ny-chicagostreet-cad1-bg1-69-160-30-132.bflony.adelphia.net
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3740
Article PK: 7640


"Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com> wrote in message
news:7ni2n0tq9gdda67ph7j5ovuh4lgug2cebm@4ax.com...
> ASA uses SUBSTR:
>
> Select *
> From table1
> Where SUBSTR ( stkcode, 3, 5 ) = '156';
>
> According the documentation, Informix has it too:
> http://publib.boulder.ibm.com/epubs/pdf/ct1sqna.pdf
>
> Breck
>

One note: The SUBSTRING|SUBSTR function's third optional argument is the LENGTH of the desired substring, not its
ending position in the main string...

--
Paul Horan[TeamSybase]


Breck Carter [TeamSybase] Posted on 2004-10-17 14:34:44.0Z
From: "Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: SQL simple question for ASA & Informix
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <hn05n01pc9dr437ps4vi9fpa0p1g60vamk@4ax.com>
References: <4170a048.37ec.1681692777@sybase.com> <7ni2n0tq9gdda67ph7j5ovuh4lgug2cebm@4ax.com> <41727110$1@forums-1-dub>
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: bcarter.sentex.ca
X-Original-NNTP-Posting-Host: bcarter.sentex.ca
Date: 17 Oct 2004 07:34:44 -0700
X-Trace: forums-1-dub 1098023684 64.7.134.118 (17 Oct 2004 07:34:44 -0700)
X-Original-Trace: 17 Oct 2004 07:34:44 -0700, bcarter.sentex.ca
Lines: 29
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3741
Article PK: 7641

Doh! :)

On 17 Oct 2004 06:18:08 -0700, "Paul Horan[TeamSybase]"

<paulhATvcisolutionsDOTcom> wrote:

>"Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com> wrote in message
>news:7ni2n0tq9gdda67ph7j5ovuh4lgug2cebm@4ax.com...
>> ASA uses SUBSTR:
>>
>> Select *
>> From table1
>> Where SUBSTR ( stkcode, 3, 5 ) = '156';
>>
>> According the documentation, Informix has it too:
>> http://publib.boulder.ibm.com/epubs/pdf/ct1sqna.pdf
>>
>> Breck
>>
>
>
>One note: The SUBSTRING|SUBSTR function's third optional argument is the LENGTH of the desired substring, not its
>ending position in the main string...

--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/ASIN/1556225067/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com