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.

Getting different result in stored procedure

3 posts in General Discussion Last posting was on 2004-02-24 21:52:19.0Z
Chandresh Patel Posted on 2004-02-24 16:17:44.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
Subject: Getting different result in stored procedure
Lines: 32
Organization: Shreeji Smart Solution
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: aca06a44.ipt.aol.com
X-Original-NNTP-Posting-Host: aca06a44.ipt.aol.com
Message-ID: <403b7928@forums-1-dub>
Date: 24 Feb 2004 08:17:44 -0800
X-Trace: forums-1-dub 1077639464 172.160.106.68 (24 Feb 2004 08:17:44 -0800)
X-Original-Trace: 24 Feb 2004 08:17:44 -0800, aca06a44.ipt.aol.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2617
Article PK: 6091

Hi,

I am using Sybase Antwhere 9.0.0.1108

When I run this query in Interactive SQL

select (sum(A.DunkinSales)) - (sum(A.Overring) + sum(A.salesTax)) as
NetSales, sum(A.SalesTax) as SalesTax, sum(A.CustomerCount) as CustomerCount
from Sales A, DayActivity B where A.DayActivityID = B.DayActivityID and
B.StoreID=101 and CAST(DayDate AS DATE) BETWEEN CAST('2004-02-08' AS DATE)
and CAST('2004-02-14' AS DATE)

I get result like:
8323.66 106.43 1554

In Procedure when i am save this result in one temprary table called
CompData then it stores different.

INSERT INTO CompData (NetSales, TotalTax, CustomerCount) select
(sum(A.DunkinSales)) - (sum(A.Overring) + sum(A.salesTax)) as NetSales,
sum(A.SalesTax) as SalesTax, sum(A.CustomerCount) as CustomerCount from
Sales A, DayActivity B where A.DayActivityID = B.DayActivityID and
B.StoreID=StoreID and CAST(DayDate AS DATE) BETWEEN StartDate and EndDate;

It store result like:
69927.66 2385.62 18720

Can anybudy help me.

Thanks in Advance.


Chris Keating (iAnywhere Solutions) Posted on 2004-02-24 19:45:21.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <403b7928@forums-1-dub>
Subject: Re: Getting different result in stored procedure
Lines: 67
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
X-Original-NNTP-Posting-Host: keating-xp.sybase.com
Message-ID: <403ba9dc$1@forums-2-dub>
X-Original-Trace: 24 Feb 2004 11:45:32 -0800, keating-xp.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 24 Feb 2004 11:44:48 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 24 Feb 2004 11:45:21 -0800
X-Trace: forums-1-dub 1077651921 10.22.108.75 (24 Feb 2004 11:45:21 -0800)
X-Original-Trace: 24 Feb 2004 11:45:21 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2621
Article PK: 6093

I suspect that this is going to require data to answer. Perhaps you may want
to consider opening a technical support case if the matter is urgent.

--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

****************************************************************************
*
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

****************************************************************************
*

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use CaseXpress to report bugs http://casexpress.sybase.com

****************************************************************************
*

"Chandresh Patel" <bapashree@yahoo.com> wrote in message
news:403b7928@forums-1-dub...
> Hi,
>
> I am using Sybase Antwhere 9.0.0.1108
>
> When I run this query in Interactive SQL
>
> select (sum(A.DunkinSales)) - (sum(A.Overring) + sum(A.salesTax)) as
> NetSales, sum(A.SalesTax) as SalesTax, sum(A.CustomerCount) as
CustomerCount
> from Sales A, DayActivity B where A.DayActivityID = B.DayActivityID and
> B.StoreID=101 and CAST(DayDate AS DATE) BETWEEN CAST('2004-02-08' AS DATE)
> and CAST('2004-02-14' AS DATE)
>
> I get result like:
> 8323.66 106.43 1554
>
> In Procedure when i am save this result in one temprary table called
> CompData then it stores different.
>
> INSERT INTO CompData (NetSales, TotalTax, CustomerCount) select
> (sum(A.DunkinSales)) - (sum(A.Overring) + sum(A.salesTax)) as NetSales,
> sum(A.SalesTax) as SalesTax, sum(A.CustomerCount) as CustomerCount from
> Sales A, DayActivity B where A.DayActivityID = B.DayActivityID and
> B.StoreID=StoreID and CAST(DayDate AS DATE) BETWEEN StartDate and EndDate;
>
> It store result like:
> 69927.66 2385.62 18720
>
> Can anybudy help me.
>
> Thanks in Advance.
>
>


Chandresh Patel Posted on 2004-02-24 21:52:19.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
References: <403b7928@forums-1-dub> <403ba9dc$1@forums-2-dub>
Subject: Re: Getting different result in stored procedure
Lines: 87
Organization: Shreeji Smart Solution
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: aca8b22b.ipt.aol.com
X-Original-NNTP-Posting-Host: aca8b22b.ipt.aol.com
Message-ID: <403bc793@forums-1-dub>
Date: 24 Feb 2004 13:52:19 -0800
X-Trace: forums-1-dub 1077659539 172.168.178.43 (24 Feb 2004 13:52:19 -0800)
X-Original-Trace: 24 Feb 2004 13:52:19 -0800, aca8b22b.ipt.aol.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2622
Article PK: 6095

Chris,

I am afraid to open case and may be thats why god give me solution. There is
no problem with procedure but i pass one variable name StoreId and same
field is exists on database table and thats why its give me more result. now
this work fine.

Thanks


"Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>

wrote in message news:403ba9dc$1@forums-2-dub...
> I suspect that this is going to require data to answer. Perhaps you may
want
> to consider opening a technical support case if the matter is urgent.
>
> --
>
> Chris Keating
> Sybase Adaptive Server Anywhere Professional Version 8
>
>
****************************************************************************
> *
> Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
> and try out the market-leading database for mobile, embedded and small to
> medium sized business environments for free!
>
> http://www.ianywhere.com/promos/deved/index.html
>
>
****************************************************************************
> *
>
> iAnywhere Solutions http://www.iAnywhere.com
>
> ** Please only post to the newsgroup
>
> ** Whitepapers can be found at http://www.iAnywhere.com/developer
> ** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
> ** Use CaseXpress to report bugs http://casexpress.sybase.com
>
>
****************************************************************************
> *
>
> "Chandresh Patel" <bapashree@yahoo.com> wrote in message
> news:403b7928@forums-1-dub...
> > Hi,
> >
> > I am using Sybase Antwhere 9.0.0.1108
> >
> > When I run this query in Interactive SQL
> >
> > select (sum(A.DunkinSales)) - (sum(A.Overring) + sum(A.salesTax)) as
> > NetSales, sum(A.SalesTax) as SalesTax, sum(A.CustomerCount) as
> CustomerCount
> > from Sales A, DayActivity B where A.DayActivityID = B.DayActivityID and
> > B.StoreID=101 and CAST(DayDate AS DATE) BETWEEN CAST('2004-02-08' AS
DATE)
> > and CAST('2004-02-14' AS DATE)
> >
> > I get result like:
> > 8323.66 106.43 1554
> >
> > In Procedure when i am save this result in one temprary table called
> > CompData then it stores different.
> >
> > INSERT INTO CompData (NetSales, TotalTax, CustomerCount) select
> > (sum(A.DunkinSales)) - (sum(A.Overring) + sum(A.salesTax)) as NetSales,
> > sum(A.SalesTax) as SalesTax, sum(A.CustomerCount) as CustomerCount from
> > Sales A, DayActivity B where A.DayActivityID = B.DayActivityID and
> > B.StoreID=StoreID and CAST(DayDate AS DATE) BETWEEN StartDate and
EndDate;
> >
> > It store result like:
> > 69927.66 2385.62 18720
> >
> > Can anybudy help me.
> >
> > Thanks in Advance.
> >
> >
>
>