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.

Query problem

3 posts in General Discussion Last posting was on 2006-05-03 02:00:35.0Z
john Posted on 2006-05-02 08:45:03.0Z
From: john <johndalde@biz.phisl.net>
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Query problem
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 203.215.95.78
X-Original-NNTP-Posting-Host: 203.215.95.78
Message-ID: <44571c0f$1@forums-1-dub>
Date: 2 May 2006 01:45:03 -0700
X-Trace: forums-1-dub 1146559503 203.215.95.78 (2 May 2006 01:45:03 -0700)
X-Original-Trace: 2 May 2006 01:45:03 -0700, 203.215.95.78
Lines: 18
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5311
Article PK: 1365

Hi i have a problem in my query. hope somebody can help me in my
problem.i cant get the value of customeraccountsID. this query has no
error but it will not give result also. i want to get the value of the
customeraccountsID using the value of the customercode. ive this query
many times in interactive but i cant get the relsult.

this query will suppose to return one vallue, the customeraccountsID of
type integer. please help me...

begin
declare customercode varchar(30);
set customercode = 'T-00045';
select customeraccountsID from customeraccounts where customercode =
'customercode'
end


thanks in advance


Breck Carter [Team iAnywhere] Posted on 2006-05-02 12:16:26.0Z
From: "Breck Carter [Team iAnywhere]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: Query problem
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <peje5252ug0iu61jjktqgta447gr0rh9vs@4ax.com>
References: <44571c0f$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: 66.194.95.2
X-Original-NNTP-Posting-Host: 66.194.95.2
Date: 2 May 2006 05:16:26 -0700
X-Trace: forums-1-dub 1146572186 66.194.95.2 (2 May 2006 05:16:26 -0700)
X-Original-Trace: 2 May 2006 05:16:26 -0700, 66.194.95.2
Lines: 43
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5312
Article PK: 1366

You have to remove the 'quotes', and also use a different name for the
local variable because SQL Anywhere can't tell it from the column
name. Personally, I use the @ character to differentiate variables
from columns.

Try this...

begin
declare @customercode varchar(30);
set @customercode = 'T-00045';
select customeraccountsID from customeraccounts where customercode =
@customercode;
end

Breck

On 2 May 2006 01:45:03 -0700, john <johndalde@biz.phisl.net> wrote:

>Hi i have a problem in my query. hope somebody can help me in my
>problem.i cant get the value of customeraccountsID. this query has no
>error but it will not give result also. i want to get the value of the
>customeraccountsID using the value of the customercode. ive this query
>many times in interactive but i cant get the relsult.
>
>this query will suppose to return one vallue, the customeraccountsID of
>type integer. please help me...
>
>begin
>declare customercode varchar(30);
>set customercode = 'T-00045';
>select customeraccountsID from customeraccounts where customercode =
>'customercode'
>end
>
>
>thanks in advance

--
Breck Carter [Team iAnywhere]
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com
The book: http://www.risingroad.com/SQL_Anywhere_Studio_9_Developers_Guide.html
breck.carter@risingroad.com


john Posted on 2006-05-03 02:00:35.0Z
From: john <johndalde@biz.phisl.net>
User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Query problem
References: <44571c0f$1@forums-1-dub> <peje5252ug0iu61jjktqgta447gr0rh9vs@4ax.com>
In-Reply-To: <peje5252ug0iu61jjktqgta447gr0rh9vs@4ax.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 203.215.95.78
Message-ID: <44580f85@forums-2-dub>
X-Original-Trace: 2 May 2006 19:03:49 -0700, 203.215.95.78
Lines: 47
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 2 May 2006 19:03:51 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 2 May 2006 19:00:35 -0700
X-Trace: forums-1-dub 1146621635 10.22.108.75 (2 May 2006 19:00:35 -0700)
X-Original-Trace: 2 May 2006 19:00:35 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5317
Article PK: 1370


Breck Carter [Team iAnywhere] wrote:
> You have to remove the 'quotes', and also use a different name for the
> local variable because SQL Anywhere can't tell it from the column
> name. Personally, I use the @ character to differentiate variables
> from columns.
>
> Try this...
>
> begin
> declare @customercode varchar(30);
> set @customercode = 'T-00045';
> select customeraccountsID from customeraccounts where customercode =
> @customercode;
> end
>
> Breck
>
> On 2 May 2006 01:45:03 -0700, john <johndalde@biz.phisl.net> wrote:
>
>
>>Hi i have a problem in my query. hope somebody can help me in my
>>problem.i cant get the value of customeraccountsID. this query has no
>>error but it will not give result also. i want to get the value of the
>>customeraccountsID using the value of the customercode. ive this query
>>many times in interactive but i cant get the relsult.
>>
>>this query will suppose to return one vallue, the customeraccountsID of
>>type integer. please help me...
>>
>>begin
>>declare customercode varchar(30);
>>set customercode = 'T-00045';
>>select customeraccountsID from customeraccounts where customercode =
>>'customercode'
>>end
>>
>>
>>thanks in advance
>
>
> --
> Breck Carter [Team iAnywhere]
> RisingRoad SQL Anywhere and MobiLink Professional Services
> www.risingroad.com
> The book: http://www.risingroad.com/SQL_Anywhere_Studio_9_Developers_Guide.html
> breck.carter@risingroad.com

thank a lot, its running now....