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.

Nobudy give me answer of my QUESTION.

11 posts in General Discussion Last posting was on 2004-02-23 03:17:10.0Z
Chandresh Patel Posted on 2004-02-20 01:51:24.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
Subject: Nobudy give me answer of my QUESTION.
Lines: 43
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
X-Original-NNTP-Posting-Host: ac8e483c.ipt.aol.com
Message-ID: <4035681b@forums-2-dub>
X-Original-Trace: 19 Feb 2004 17:51:23 -0800, ac8e483c.ipt.aol.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 19 Feb 2004 17:51:22 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 19 Feb 2004 17:51:24 -0800
X-Trace: forums-1-dub 1077241884 10.22.108.75 (19 Feb 2004 17:51:24 -0800)
X-Original-Trace: 19 Feb 2004 17:51:24 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2559
Article PK: 5696

Hi,

If you not understand what i want then let me know I will describe in
detail.



I am using Sybase Anywhere 9.0.0 (1108) with C# application using
iAnywhere.Data.ASAClient

I refer this topic

ASA Programming Guide
Developing Applications with the .NET Data Provider

Using stored procedures

Question :
=======

1. I want one result set when i call stored procedure ( I know when you call
ExecuteReader that time it return resutl set)

2. In my procedure

Begin

loop
{
Select sum(mData) from table where date beetween this1 and this2;
}

//Every time this1 and this2 value change and loop rotate almost 70
times.
//I want to store this result in result set and finally return this
result set so i can use this in my //application
End


Ler me know How do i manuplate result set in stored procedure.


Chris Keating (iAnywhere Solutions) Posted on 2004-02-20 02:26:13.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <4035681b@forums-2-dub>
Subject: Re: Nobudy give me answer of my QUESTION.
Lines: 110
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: surfec007.sybase.com
X-Original-NNTP-Posting-Host: surfec007.sybase.com
Message-ID: <40357045$1@forums-1-dub>
Date: 19 Feb 2004 18:26:13 -0800
X-Trace: forums-1-dub 1077243973 199.93.176.7 (19 Feb 2004 18:26:13 -0800)
X-Original-Trace: 19 Feb 2004 18:26:13 -0800, surfec007.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2561
Article PK: 5699

This newsgroup is monitored by volunteers. Please allow a reasonable amount
of time before reposting.

That said, you could clarify you questions

1) If you know that ExecuteReader is capable of handling a resultset, what
specifically is the problem. use AsaDataReader Read( ) method in a loop to
get to the next row in the resultset until it returns false.

i.e.,

while( reader.Read() )
{
... process the result set ...
}
reader.Close();Another option is to assign the resultset to an object such
as a datagrid

i.e.,

dataGrid.DataSource = reader;

BTW This was found in the documentation

ASA Programming Guide
Developing Applications with the .NET Data Provider

2) If you have a stored procedure defined, please post its syntax rather
than summarizing. I suspect that you will need a temporary table to store
the intermediate results and then return the resultset based on a query
against that table.




--

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:4035681b@forums-2-dub...
> Hi,
>
> If you not understand what i want then let me know I will describe in
> detail.
>
>
>
> I am using Sybase Anywhere 9.0.0 (1108) with C# application using
> iAnywhere.Data.ASAClient
>
> I refer this topic
>
> ASA Programming Guide
> Developing Applications with the .NET Data Provider
>
> Using stored procedures
>
> Question :
> =======
>
> 1. I want one result set when i call stored procedure ( I know when you
call
> ExecuteReader that time it return resutl set)
>
> 2. In my procedure
>
> Begin
>
> loop
> {
> Select sum(mData) from table where date beetween this1 and this2;
> }
>
> //Every time this1 and this2 value change and loop rotate almost 70
> times.
> //I want to store this result in result set and finally return this
> result set so i can use this in my //application
> End
>
>
> Ler me know How do i manuplate result set in stored procedure.
>
>
>


Chandresh Patel Posted on 2004-02-20 04:42:54.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
References: <4035681b@forums-2-dub> <40357045$1@forums-1-dub>
Subject: Re: Nobudy give me answer of my QUESTION.
Lines: 143
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: ac8e483c.ipt.aol.com
X-Original-NNTP-Posting-Host: ac8e483c.ipt.aol.com
Message-ID: <4035904e@forums-1-dub>
Date: 19 Feb 2004 20:42:54 -0800
X-Trace: forums-1-dub 1077252174 172.142.72.60 (19 Feb 2004 20:42:54 -0800)
X-Original-Trace: 19 Feb 2004 20:42:54 -0800, ac8e483c.ipt.aol.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2563
Article PK: 5702

Hi, Chris

Thank you for your answer and here is my procedure.

You understand correctly. I created one loop in procedure and this loop run
for 150 times each times it return 5 value (this is not static always it
change depend on procedure). So after finished this loop I want one result
set with this data.

Is there any easy way to catch this in procedure and procedure return result
set.

Sorry for this. Actually In my C# application I called query 150 times and
it take some time because database on internet and thats why I create
procedure for this and want data in result set.




Thanks in Advance.




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

wrote in message news:40357045$1@forums-1-dub...
> This newsgroup is monitored by volunteers. Please allow a reasonable
amount
> of time before reposting.
>
> That said, you could clarify you questions
>
> 1) If you know that ExecuteReader is capable of handling a resultset, what
> specifically is the problem. use AsaDataReader Read( ) method in a loop to
> get to the next row in the resultset until it returns false.
>
> i.e.,
>
> while( reader.Read() )
> {
> ... process the result set ...
> }
> reader.Close();Another option is to assign the resultset to an object such
> as a datagrid
>
> i.e.,
>
> dataGrid.DataSource = reader;
>
> BTW This was found in the documentation
>
> ASA Programming Guide
> Developing Applications with the .NET Data Provider
>
> 2) If you have a stored procedure defined, please post its syntax rather
> than summarizing. I suspect that you will need a temporary table to store
> the intermediate results and then return the resultset based on a query
> against that table.
>
>
>
>
> --
>
> 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:4035681b@forums-2-dub...
> > Hi,
> >
> > If you not understand what i want then let me know I will describe in
> > detail.
> >
> >
> >
> > I am using Sybase Anywhere 9.0.0 (1108) with C# application using
> > iAnywhere.Data.ASAClient
> >
> > I refer this topic
> >
> > ASA Programming Guide
> > Developing Applications with the .NET Data Provider
> >
> > Using stored procedures
> >
> > Question :
> > =======
> >
> > 1. I want one result set when i call stored procedure ( I know when you
> call
> > ExecuteReader that time it return resutl set)
> >
> > 2. In my procedure
> >
> > Begin
> >
> > loop
> > {
> > Select sum(mData) from table where date beetween this1 and
this2;
> > }
> >
> > //Every time this1 and this2 value change and loop rotate almost 70
> > times.
> > //I want to store this result in result set and finally return this
> > result set so i can use this in my //application
> > End
> >
> >
> > Ler me know How do i manuplate result set in stored procedure.
> >
> >
> >
>
>


Jason Hinsperger Posted on 2004-02-20 14:32:58.0Z
From: "Jason Hinsperger" <NOJason_HinspergerSPAM@hotmail.com>
Newsgroups: ianywhere.public.general
References: <4035681b@forums-2-dub> <40357045$1@forums-1-dub> <4035904e@forums-1-dub>
Subject: Re: Nobudy give me answer of my QUESTION.
Lines: 179
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: hinsperg-pc1.sybase.com
Message-ID: <40361a99@forums-2-dub>
X-Original-Trace: 20 Feb 2004 06:32:57 -0800, hinsperg-pc1.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 20 Feb 2004 06:32:50 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 20 Feb 2004 06:32:58 -0800
X-Trace: forums-1-dub 1077287578 10.22.108.75 (20 Feb 2004 06:32:58 -0800)
X-Original-Trace: 20 Feb 2004 06:32:58 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2566
Article PK: 5703

You can use a stored procedure to execute the loop and place the results
into a temp table and return the contents of the tmep table as a single
result set to the application. See the documentation for details on how to
do this.

You can also use the AsaClient DataAdaptor class to build and store result
sets locally in a Dataset.

--
Jason Hinsperger
International and Sustaining Engineering
iAnywhere Solutions

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

"Chandresh Patel" <bapashree@yahoo.com> wrote in message
news:4035904e@forums-1-dub...
> Hi, Chris
>
> Thank you for your answer and here is my procedure.
>
> You understand correctly. I created one loop in procedure and this loop
run
> for 150 times each times it return 5 value (this is not static always it
> change depend on procedure). So after finished this loop I want one result
> set with this data.
>
> Is there any easy way to catch this in procedure and procedure return
result
> set.
>
> Sorry for this. Actually In my C# application I called query 150 times and
> it take some time because database on internet and thats why I create
> procedure for this and want data in result set.
>
>
>
>
> Thanks in Advance.
>
>
>
>
> "Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>
> wrote in message news:40357045$1@forums-1-dub...
> > This newsgroup is monitored by volunteers. Please allow a reasonable
> amount
> > of time before reposting.
> >
> > That said, you could clarify you questions
> >
> > 1) If you know that ExecuteReader is capable of handling a resultset,
what
> > specifically is the problem. use AsaDataReader Read( ) method in a loop
to
> > get to the next row in the resultset until it returns false.
> >
> > i.e.,
> >
> > while( reader.Read() )
> > {
> > ... process the result set ...
> > }
> > reader.Close();Another option is to assign the resultset to an object
such
> > as a datagrid
> >
> > i.e.,
> >
> > dataGrid.DataSource = reader;
> >
> > BTW This was found in the documentation
> >
> > ASA Programming Guide
> > Developing Applications with the .NET Data Provider
> >
> > 2) If you have a stored procedure defined, please post its syntax rather
> > than summarizing. I suspect that you will need a temporary table to
store
> > the intermediate results and then return the resultset based on a query
> > against that table.
> >
> >
> >
> >
> > --
> >
> > 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:4035681b@forums-2-dub...
> > > Hi,
> > >
> > > If you not understand what i want then let me know I will describe in
> > > detail.
> > >
> > >
> > >
> > > I am using Sybase Anywhere 9.0.0 (1108) with C# application using
> > > iAnywhere.Data.ASAClient
> > >
> > > I refer this topic
> > >
> > > ASA Programming Guide
> > > Developing Applications with the .NET Data Provider
> > >
> > > Using stored procedures
> > >
> > > Question :
> > > =======
> > >
> > > 1. I want one result set when i call stored procedure ( I know when
you
> > call
> > > ExecuteReader that time it return resutl set)
> > >
> > > 2. In my procedure
> > >
> > > Begin
> > >
> > > loop
> > > {
> > > Select sum(mData) from table where date beetween this1 and
> this2;
> > > }
> > >
> > > //Every time this1 and this2 value change and loop rotate almost
70
> > > times.
> > > //I want to store this result in result set and finally return
this
> > > result set so i can use this in my //application
> > > End
> > >
> > >
> > > Ler me know How do i manuplate result set in stored procedure.
> > >
> > >
> > >
> >
> >
>
>


Chandresh Patel Posted on 2004-02-20 16:44:23.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
References: <4035681b@forums-2-dub> <40357045$1@forums-1-dub> <4035904e@forums-1-dub> <40361a99@forums-2-dub>
Subject: Re: Nobudy give me answer of my QUESTION.
Lines: 204
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: ac825b9d.ipt.aol.com
X-Original-NNTP-Posting-Host: ac825b9d.ipt.aol.com
Message-ID: <40363967@forums-1-dub>
Date: 20 Feb 2004 08:44:23 -0800
X-Trace: forums-1-dub 1077295463 172.130.91.157 (20 Feb 2004 08:44:23 -0800)
X-Original-Trace: 20 Feb 2004 08:44:23 -0800, ac825b9d.ipt.aol.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2568
Article PK: 5706

Hi,

Every time i need to create temp table and my column value is not fix is
depend on selection so what is the best way and which documnet i have to
refer.

Thanks in Advance.

"Jason Hinsperger" <NOJason_HinspergerSPAM@hotmail.com> wrote in message
news:40361a99@forums-2-dub...
> You can use a stored procedure to execute the loop and place the results
> into a temp table and return the contents of the tmep table as a single
> result set to the application. See the documentation for details on how
to
> do this.
>
> You can also use the AsaClient DataAdaptor class to build and store result
> sets locally in a Dataset.
>
> --
> Jason Hinsperger
> International and Sustaining Engineering
> iAnywhere Solutions
>
> Whitepapers, TechDocs, and bug fixes are all available through the
iAnywhere
> Developer Community at www.ianywhere.com/developer
> --
>
>
> "Chandresh Patel" <bapashree@yahoo.com> wrote in message
> news:4035904e@forums-1-dub...
> > Hi, Chris
> >
> > Thank you for your answer and here is my procedure.
> >
> > You understand correctly. I created one loop in procedure and this loop
> run
> > for 150 times each times it return 5 value (this is not static always it
> > change depend on procedure). So after finished this loop I want one
result
> > set with this data.
> >
> > Is there any easy way to catch this in procedure and procedure return
> result
> > set.
> >
> > Sorry for this. Actually In my C# application I called query 150 times
and
> > it take some time because database on internet and thats why I create
> > procedure for this and want data in result set.
> >
> >
> >
> >
> > Thanks in Advance.
> >
> >
> >
> >
> > "Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>
> > wrote in message news:40357045$1@forums-1-dub...
> > > This newsgroup is monitored by volunteers. Please allow a reasonable
> > amount
> > > of time before reposting.
> > >
> > > That said, you could clarify you questions
> > >
> > > 1) If you know that ExecuteReader is capable of handling a resultset,
> what
> > > specifically is the problem. use AsaDataReader Read( ) method in a
loop
> to
> > > get to the next row in the resultset until it returns false.
> > >
> > > i.e.,
> > >
> > > while( reader.Read() )
> > > {
> > > ... process the result set ...
> > > }
> > > reader.Close();Another option is to assign the resultset to an object
> such
> > > as a datagrid
> > >
> > > i.e.,
> > >
> > > dataGrid.DataSource = reader;
> > >
> > > BTW This was found in the documentation
> > >
> > > ASA Programming Guide
> > > Developing Applications with the .NET Data Provider
> > >
> > > 2) If you have a stored procedure defined, please post its syntax
rather
> > > than summarizing. I suspect that you will need a temporary table to
> store
> > > the intermediate results and then return the resultset based on a
query
> > > against that table.
> > >
> > >
> > >
> > >
> > > --
> > >
> > > 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:4035681b@forums-2-dub...
> > > > Hi,
> > > >
> > > > If you not understand what i want then let me know I will describe
in
> > > > detail.
> > > >
> > > >
> > > >
> > > > I am using Sybase Anywhere 9.0.0 (1108) with C# application using
> > > > iAnywhere.Data.ASAClient
> > > >
> > > > I refer this topic
> > > >
> > > > ASA Programming Guide
> > > > Developing Applications with the .NET Data Provider
> > > >
> > > > Using stored procedures
> > > >
> > > > Question :
> > > > =======
> > > >
> > > > 1. I want one result set when i call stored procedure ( I know when
> you
> > > call
> > > > ExecuteReader that time it return resutl set)
> > > >
> > > > 2. In my procedure
> > > >
> > > > Begin
> > > >
> > > > loop
> > > > {
> > > > Select sum(mData) from table where date beetween this1 and
> > this2;
> > > > }
> > > >
> > > > //Every time this1 and this2 value change and loop rotate almost
> 70
> > > > times.
> > > > //I want to store this result in result set and finally return
> this
> > > > result set so i can use this in my //application
> > > > End
> > > >
> > > >
> > > > Ler me know How do i manuplate result set in stored procedure.
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Chris Keating (iAnywhere Solutions) Posted on 2004-02-20 18:18:11.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <4035681b@forums-2-dub> <40357045$1@forums-1-dub> <4035904e@forums-1-dub> <40361a99@forums-2-dub> <40363967@forums-1-dub>
Subject: Re: Nobudy give me answer of my QUESTION.
Lines: 249
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: <40364f62$1@forums-2-dub>
X-Original-Trace: 20 Feb 2004 10:18:10 -0800, keating-xp.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 20 Feb 2004 10:18:03 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 20 Feb 2004 10:18:11 -0800
X-Trace: forums-1-dub 1077301091 10.22.108.75 (20 Feb 2004 10:18:11 -0800)
X-Original-Trace: 20 Feb 2004 10:18:11 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2570
Article PK: 5716

It would be extremely helpful for you to post your procedure.

--

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:40363967@forums-1-dub...
> Hi,
>
> Every time i need to create temp table and my column value is not fix is
> depend on selection so what is the best way and which documnet i have to
> refer.
>
> Thanks in Advance.
>
>
>
> "Jason Hinsperger" <NOJason_HinspergerSPAM@hotmail.com> wrote in message
> news:40361a99@forums-2-dub...
> > You can use a stored procedure to execute the loop and place the results
> > into a temp table and return the contents of the tmep table as a single
> > result set to the application. See the documentation for details on how
> to
> > do this.
> >
> > You can also use the AsaClient DataAdaptor class to build and store
result
> > sets locally in a Dataset.
> >
> > --
> > Jason Hinsperger
> > International and Sustaining Engineering
> > iAnywhere Solutions
> >
> > Whitepapers, TechDocs, and bug fixes are all available through the
> iAnywhere
> > Developer Community at www.ianywhere.com/developer
> > --
> >
> >
> > "Chandresh Patel" <bapashree@yahoo.com> wrote in message
> > news:4035904e@forums-1-dub...
> > > Hi, Chris
> > >
> > > Thank you for your answer and here is my procedure.
> > >
> > > You understand correctly. I created one loop in procedure and this
loop
> > run
> > > for 150 times each times it return 5 value (this is not static always
it
> > > change depend on procedure). So after finished this loop I want one
> result
> > > set with this data.
> > >
> > > Is there any easy way to catch this in procedure and procedure return
> > result
> > > set.
> > >
> > > Sorry for this. Actually In my C# application I called query 150 times
> and
> > > it take some time because database on internet and thats why I create
> > > procedure for this and want data in result set.
> > >
> > >
> > >
> > >
> > > Thanks in Advance.
> > >
> > >
> > >
> > >
> > > "Chris Keating (iAnywhere Solutions)"
<FightSpam_keating@iAnywhere.com>
> > > wrote in message news:40357045$1@forums-1-dub...
> > > > This newsgroup is monitored by volunteers. Please allow a reasonable
> > > amount
> > > > of time before reposting.
> > > >
> > > > That said, you could clarify you questions
> > > >
> > > > 1) If you know that ExecuteReader is capable of handling a
resultset,
> > what
> > > > specifically is the problem. use AsaDataReader Read( ) method in a
> loop
> > to
> > > > get to the next row in the resultset until it returns false.
> > > >
> > > > i.e.,
> > > >
> > > > while( reader.Read() )
> > > > {
> > > > ... process the result set ...
> > > > }
> > > > reader.Close();Another option is to assign the resultset to an
object
> > such
> > > > as a datagrid
> > > >
> > > > i.e.,
> > > >
> > > > dataGrid.DataSource = reader;
> > > >
> > > > BTW This was found in the documentation
> > > >
> > > > ASA Programming Guide
> > > > Developing Applications with the .NET Data Provider
> > > >
> > > > 2) If you have a stored procedure defined, please post its syntax
> rather
> > > > than summarizing. I suspect that you will need a temporary table to
> > store
> > > > the intermediate results and then return the resultset based on a
> query
> > > > against that table.
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > > 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:4035681b@forums-2-dub...
> > > > > Hi,
> > > > >
> > > > > If you not understand what i want then let me know I will describe
> in
> > > > > detail.
> > > > >
> > > > >
> > > > >
> > > > > I am using Sybase Anywhere 9.0.0 (1108) with C# application using
> > > > > iAnywhere.Data.ASAClient
> > > > >
> > > > > I refer this topic
> > > > >
> > > > > ASA Programming Guide
> > > > > Developing Applications with the .NET Data Provider
> > > > >
> > > > > Using stored procedures
> > > > >
> > > > > Question :
> > > > > =======
> > > > >
> > > > > 1. I want one result set when i call stored procedure ( I know
when
> > you
> > > > call
> > > > > ExecuteReader that time it return resutl set)
> > > > >
> > > > > 2. In my procedure
> > > > >
> > > > > Begin
> > > > >
> > > > > loop
> > > > > {
> > > > > Select sum(mData) from table where date beetween this1 and
> > > this2;
> > > > > }
> > > > >
> > > > > //Every time this1 and this2 value change and loop rotate
almost
> > 70
> > > > > times.
> > > > > //I want to store this result in result set and finally return
> > this
> > > > > result set so i can use this in my //application
> > > > > End
> > > > >
> > > > >
> > > > > Ler me know How do i manuplate result set in stored procedure.
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Chandresh Patel Posted on 2004-02-20 19:06:58.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
References: <4035681b@forums-2-dub> <40357045$1@forums-1-dub> <4035904e@forums-1-dub> <40361a99@forums-2-dub> <40363967@forums-1-dub> <40364f62$1@forums-2-dub>
Subject: Re: Nobudy give me answer of my QUESTION.
Lines: 286
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
X-Original-NNTP-Posting-Host: ac825b9d.ipt.aol.com
Message-ID: <40365ad1@forums-2-dub>
X-Original-Trace: 20 Feb 2004 11:06:57 -0800, ac825b9d.ipt.aol.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 20 Feb 2004 11:06:49 -0800, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 20 Feb 2004 11:06:58 -0800
X-Trace: forums-1-dub 1077304018 10.22.108.75 (20 Feb 2004 11:06:58 -0800)
X-Original-Trace: 20 Feb 2004 11:06:58 -0800, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2574
Article PK: 5714

Here it is.

ALTER PROCEDURE "DBA"."CompareData"(IN @sid integer, IN @eid integer)
BEGIN
for(int i=sid; i<=eid; i++)
{
Select sum(sales), sum(tax) from sales where dActivityID=i;
}
END

In this select statement only two values but some times 4 and sometime 10.

Thanks

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

wrote in message news:40364f62$1@forums-2-dub...
> It would be extremely helpful for you to post your procedure.
>
> --
>
> 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:40363967@forums-1-dub...
> > Hi,
> >
> > Every time i need to create temp table and my column value is not fix is
> > depend on selection so what is the best way and which documnet i have to
> > refer.
> >
> > Thanks in Advance.
> >
> >
> >
> > "Jason Hinsperger" <NOJason_HinspergerSPAM@hotmail.com> wrote in message
> > news:40361a99@forums-2-dub...
> > > You can use a stored procedure to execute the loop and place the
results
> > > into a temp table and return the contents of the tmep table as a
single
> > > result set to the application. See the documentation for details on
how
> > to
> > > do this.
> > >
> > > You can also use the AsaClient DataAdaptor class to build and store
> result
> > > sets locally in a Dataset.
> > >
> > > --
> > > Jason Hinsperger
> > > International and Sustaining Engineering
> > > iAnywhere Solutions
> > >
> > > Whitepapers, TechDocs, and bug fixes are all available through the
> > iAnywhere
> > > Developer Community at www.ianywhere.com/developer
> > > --
> > >
> > >
> > > "Chandresh Patel" <bapashree@yahoo.com> wrote in message
> > > news:4035904e@forums-1-dub...
> > > > Hi, Chris
> > > >
> > > > Thank you for your answer and here is my procedure.
> > > >
> > > > You understand correctly. I created one loop in procedure and this
> loop
> > > run
> > > > for 150 times each times it return 5 value (this is not static
always
> it
> > > > change depend on procedure). So after finished this loop I want one
> > result
> > > > set with this data.
> > > >
> > > > Is there any easy way to catch this in procedure and procedure
return
> > > result
> > > > set.
> > > >
> > > > Sorry for this. Actually In my C# application I called query 150
times
> > and
> > > > it take some time because database on internet and thats why I
create
> > > > procedure for this and want data in result set.
> > > >
> > > >
> > > >
> > > >
> > > > Thanks in Advance.
> > > >
> > > >
> > > >
> > > >
> > > > "Chris Keating (iAnywhere Solutions)"
> <FightSpam_keating@iAnywhere.com>
> > > > wrote in message news:40357045$1@forums-1-dub...
> > > > > This newsgroup is monitored by volunteers. Please allow a
reasonable
> > > > amount
> > > > > of time before reposting.
> > > > >
> > > > > That said, you could clarify you questions
> > > > >
> > > > > 1) If you know that ExecuteReader is capable of handling a
> resultset,
> > > what
> > > > > specifically is the problem. use AsaDataReader Read( ) method in a
> > loop
> > > to
> > > > > get to the next row in the resultset until it returns false.
> > > > >
> > > > > i.e.,
> > > > >
> > > > > while( reader.Read() )
> > > > > {
> > > > > ... process the result set ...
> > > > > }
> > > > > reader.Close();Another option is to assign the resultset to an
> object
> > > such
> > > > > as a datagrid
> > > > >
> > > > > i.e.,
> > > > >
> > > > > dataGrid.DataSource = reader;
> > > > >
> > > > > BTW This was found in the documentation
> > > > >
> > > > > ASA Programming Guide
> > > > > Developing Applications with the .NET Data Provider
> > > > >
> > > > > 2) If you have a stored procedure defined, please post its syntax
> > rather
> > > > > than summarizing. I suspect that you will need a temporary table
to
> > > store
> > > > > the intermediate results and then return the resultset based on a
> > query
> > > > > against that table.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > >
> > > > > 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:4035681b@forums-2-dub...
> > > > > > Hi,
> > > > > >
> > > > > > If you not understand what i want then let me know I will
describe
> > in
> > > > > > detail.
> > > > > >
> > > > > >
> > > > > >
> > > > > > I am using Sybase Anywhere 9.0.0 (1108) with C# application
using
> > > > > > iAnywhere.Data.ASAClient
> > > > > >
> > > > > > I refer this topic
> > > > > >
> > > > > > ASA Programming Guide
> > > > > > Developing Applications with the .NET Data Provider
> > > > > >
> > > > > > Using stored procedures
> > > > > >
> > > > > > Question :
> > > > > > =======
> > > > > >
> > > > > > 1. I want one result set when i call stored procedure ( I know
> when
> > > you
> > > > > call
> > > > > > ExecuteReader that time it return resutl set)
> > > > > >
> > > > > > 2. In my procedure
> > > > > >
> > > > > > Begin
> > > > > >
> > > > > > loop
> > > > > > {
> > > > > > Select sum(mData) from table where date beetween this1
and
> > > > this2;
> > > > > > }
> > > > > >
> > > > > > //Every time this1 and this2 value change and loop rotate
> almost
> > > 70
> > > > > > times.
> > > > > > //I want to store this result in result set and finally
return
> > > this
> > > > > > result set so i can use this in my //application
> > > > > > End
> > > > > >
> > > > > >
> > > > > > Ler me know How do i manuplate result set in stored procedure.
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Chris Keating (iAnywhere Solutions) Posted on 2004-02-20 20:37:10.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <4035681b@forums-2-dub> <40357045$1@forums-1-dub> <4035904e@forums-1-dub> <40361a99@forums-2-dub> <40363967@forums-1-dub> <40364f62$1@forums-2-dub> <40365ad1@forums-2-dub>
Subject: Re: Nobudy give me answer of my QUESTION.
Lines: 338
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: keating-xp.sybase.com
X-Original-NNTP-Posting-Host: keating-xp.sybase.com
Message-ID: <40366ff6$1@forums-1-dub>
Date: 20 Feb 2004 12:37:10 -0800
X-Trace: forums-1-dub 1077309430 172.31.141.1 (20 Feb 2004 12:37:10 -0800)
X-Original-Trace: 20 Feb 2004 12:37:10 -0800, keating-xp.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2576
Article PK: 5711

Are you sure that "for(int i=sid; i<=eid; i++)" works?

--

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:40365ad1@forums-2-dub...
> Here it is.
>
> ALTER PROCEDURE "DBA"."CompareData"(IN @sid integer, IN @eid integer)
> BEGIN
> for(int i=sid; i<=eid; i++)
> {
> Select sum(sales), sum(tax) from sales where dActivityID=i;
> }
> END
>
> In this select statement only two values but some times 4 and sometime 10.
>
> Thanks
>
> "Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>
> wrote in message news:40364f62$1@forums-2-dub...
> > It would be extremely helpful for you to post your procedure.
> >
> > --
> >
> > 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:40363967@forums-1-dub...
> > > Hi,
> > >
> > > Every time i need to create temp table and my column value is not fix
is
> > > depend on selection so what is the best way and which documnet i have
to
> > > refer.
> > >
> > > Thanks in Advance.
> > >
> > >
> > >
> > > "Jason Hinsperger" <NOJason_HinspergerSPAM@hotmail.com> wrote in
message
> > > news:40361a99@forums-2-dub...
> > > > You can use a stored procedure to execute the loop and place the
> results
> > > > into a temp table and return the contents of the tmep table as a
> single
> > > > result set to the application. See the documentation for details on
> how
> > > to
> > > > do this.
> > > >
> > > > You can also use the AsaClient DataAdaptor class to build and store
> > result
> > > > sets locally in a Dataset.
> > > >
> > > > --
> > > > Jason Hinsperger
> > > > International and Sustaining Engineering
> > > > iAnywhere Solutions
> > > >
> > > > Whitepapers, TechDocs, and bug fixes are all available through the
> > > iAnywhere
> > > > Developer Community at www.ianywhere.com/developer
> > > > --
> > > >
> > > >
> > > > "Chandresh Patel" <bapashree@yahoo.com> wrote in message
> > > > news:4035904e@forums-1-dub...
> > > > > Hi, Chris
> > > > >
> > > > > Thank you for your answer and here is my procedure.
> > > > >
> > > > > You understand correctly. I created one loop in procedure and this
> > loop
> > > > run
> > > > > for 150 times each times it return 5 value (this is not static
> always
> > it
> > > > > change depend on procedure). So after finished this loop I want
one
> > > result
> > > > > set with this data.
> > > > >
> > > > > Is there any easy way to catch this in procedure and procedure
> return
> > > > result
> > > > > set.
> > > > >
> > > > > Sorry for this. Actually In my C# application I called query 150
> times
> > > and
> > > > > it take some time because database on internet and thats why I
> create
> > > > > procedure for this and want data in result set.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Thanks in Advance.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > "Chris Keating (iAnywhere Solutions)"
> > <FightSpam_keating@iAnywhere.com>
> > > > > wrote in message news:40357045$1@forums-1-dub...
> > > > > > This newsgroup is monitored by volunteers. Please allow a
> reasonable
> > > > > amount
> > > > > > of time before reposting.
> > > > > >
> > > > > > That said, you could clarify you questions
> > > > > >
> > > > > > 1) If you know that ExecuteReader is capable of handling a
> > resultset,
> > > > what
> > > > > > specifically is the problem. use AsaDataReader Read( ) method in
a
> > > loop
> > > > to
> > > > > > get to the next row in the resultset until it returns false.
> > > > > >
> > > > > > i.e.,
> > > > > >
> > > > > > while( reader.Read() )
> > > > > > {
> > > > > > ... process the result set ...
> > > > > > }
> > > > > > reader.Close();Another option is to assign the resultset to an
> > object
> > > > such
> > > > > > as a datagrid
> > > > > >
> > > > > > i.e.,
> > > > > >
> > > > > > dataGrid.DataSource = reader;
> > > > > >
> > > > > > BTW This was found in the documentation
> > > > > >
> > > > > > ASA Programming Guide
> > > > > > Developing Applications with the .NET Data Provider
> > > > > >
> > > > > > 2) If you have a stored procedure defined, please post its
syntax
> > > rather
> > > > > > than summarizing. I suspect that you will need a temporary table
> to
> > > > store
> > > > > > the intermediate results and then return the resultset based on
a
> > > query
> > > > > > against that table.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > >
> > > > > > 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:4035681b@forums-2-dub...
> > > > > > > Hi,
> > > > > > >
> > > > > > > If you not understand what i want then let me know I will
> describe
> > > in
> > > > > > > detail.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > I am using Sybase Anywhere 9.0.0 (1108) with C# application
> using
> > > > > > > iAnywhere.Data.ASAClient
> > > > > > >
> > > > > > > I refer this topic
> > > > > > >
> > > > > > > ASA Programming Guide
> > > > > > > Developing Applications with the .NET Data Provider
> > > > > > >
> > > > > > > Using stored procedures
> > > > > > >
> > > > > > > Question :
> > > > > > > =======
> > > > > > >
> > > > > > > 1. I want one result set when i call stored procedure ( I know
> > when
> > > > you
> > > > > > call
> > > > > > > ExecuteReader that time it return resutl set)
> > > > > > >
> > > > > > > 2. In my procedure
> > > > > > >
> > > > > > > Begin
> > > > > > >
> > > > > > > loop
> > > > > > > {
> > > > > > > Select sum(mData) from table where date beetween this1
> and
> > > > > this2;
> > > > > > > }
> > > > > > >
> > > > > > > //Every time this1 and this2 value change and loop rotate
> > almost
> > > > 70
> > > > > > > times.
> > > > > > > //I want to store this result in result set and finally
> return
> > > > this
> > > > > > > result set so i can use this in my
//application
> > > > > > > End
> > > > > > >
> > > > > > >
> > > > > > > Ler me know How do i manuplate result set in stored procedure.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Chandresh Patel Posted on 2004-02-21 18:27:56.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
References: <4035681b@forums-2-dub> <40357045$1@forums-1-dub> <4035904e@forums-1-dub> <40361a99@forums-2-dub> <40363967@forums-1-dub> <40364f62$1@forums-2-dub> <40365ad1@forums-2-dub> <40366ff6$1@forums-1-dub>
Subject: Re: Nobudy give me answer of my QUESTION.
Lines: 368
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: acaf3b9e.ipt.aol.com
X-Original-NNTP-Posting-Host: acaf3b9e.ipt.aol.com
Message-ID: <4037a32c@forums-1-dub>
Date: 21 Feb 2004 10:27:56 -0800
X-Trace: forums-1-dub 1077388076 172.175.59.158 (21 Feb 2004 10:27:56 -0800)
X-Original-Trace: 21 Feb 2004 10:27:56 -0800, acaf3b9e.ipt.aol.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2579
Article PK: 5717

Thanks


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

wrote in message news:40366ff6$1@forums-1-dub...
> Are you sure that "for(int i=sid; i<=eid; i++)" works?
>
> --
>
> 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:40365ad1@forums-2-dub...
> > Here it is.
> >
> > ALTER PROCEDURE "DBA"."CompareData"(IN @sid integer, IN @eid integer)
> > BEGIN
> > for(int i=sid; i<=eid; i++)
> > {
> > Select sum(sales), sum(tax) from sales where dActivityID=i;
> > }
> > END
> >
> > In this select statement only two values but some times 4 and sometime
10.
> >
> > Thanks
> >
> > "Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>
> > wrote in message news:40364f62$1@forums-2-dub...
> > > It would be extremely helpful for you to post your procedure.
> > >
> > > --
> > >
> > > 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:40363967@forums-1-dub...
> > > > Hi,
> > > >
> > > > Every time i need to create temp table and my column value is not
fix
> is
> > > > depend on selection so what is the best way and which documnet i
have
> to
> > > > refer.
> > > >
> > > > Thanks in Advance.
> > > >
> > > >
> > > >
> > > > "Jason Hinsperger" <NOJason_HinspergerSPAM@hotmail.com> wrote in
> message
> > > > news:40361a99@forums-2-dub...
> > > > > You can use a stored procedure to execute the loop and place the
> > results
> > > > > into a temp table and return the contents of the tmep table as a
> > single
> > > > > result set to the application. See the documentation for details
on
> > how
> > > > to
> > > > > do this.
> > > > >
> > > > > You can also use the AsaClient DataAdaptor class to build and
store
> > > result
> > > > > sets locally in a Dataset.
> > > > >
> > > > > --
> > > > > Jason Hinsperger
> > > > > International and Sustaining Engineering
> > > > > iAnywhere Solutions
> > > > >
> > > > > Whitepapers, TechDocs, and bug fixes are all available through the
> > > > iAnywhere
> > > > > Developer Community at www.ianywhere.com/developer
> > > > > --
> > > > >
> > > > >
> > > > > "Chandresh Patel" <bapashree@yahoo.com> wrote in message
> > > > > news:4035904e@forums-1-dub...
> > > > > > Hi, Chris
> > > > > >
> > > > > > Thank you for your answer and here is my procedure.
> > > > > >
> > > > > > You understand correctly. I created one loop in procedure and
this
> > > loop
> > > > > run
> > > > > > for 150 times each times it return 5 value (this is not static
> > always
> > > it
> > > > > > change depend on procedure). So after finished this loop I want
> one
> > > > result
> > > > > > set with this data.
> > > > > >
> > > > > > Is there any easy way to catch this in procedure and procedure
> > return
> > > > > result
> > > > > > set.
> > > > > >
> > > > > > Sorry for this. Actually In my C# application I called query 150
> > times
> > > > and
> > > > > > it take some time because database on internet and thats why I
> > create
> > > > > > procedure for this and want data in result set.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Thanks in Advance.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Chris Keating (iAnywhere Solutions)"
> > > <FightSpam_keating@iAnywhere.com>
> > > > > > wrote in message news:40357045$1@forums-1-dub...
> > > > > > > This newsgroup is monitored by volunteers. Please allow a
> > reasonable
> > > > > > amount
> > > > > > > of time before reposting.
> > > > > > >
> > > > > > > That said, you could clarify you questions
> > > > > > >
> > > > > > > 1) If you know that ExecuteReader is capable of handling a
> > > resultset,
> > > > > what
> > > > > > > specifically is the problem. use AsaDataReader Read( ) method
in
> a
> > > > loop
> > > > > to
> > > > > > > get to the next row in the resultset until it returns false.
> > > > > > >
> > > > > > > i.e.,
> > > > > > >
> > > > > > > while( reader.Read() )
> > > > > > > {
> > > > > > > ... process the result set ...
> > > > > > > }
> > > > > > > reader.Close();Another option is to assign the resultset to an
> > > object
> > > > > such
> > > > > > > as a datagrid
> > > > > > >
> > > > > > > i.e.,
> > > > > > >
> > > > > > > dataGrid.DataSource = reader;
> > > > > > >
> > > > > > > BTW This was found in the documentation
> > > > > > >
> > > > > > > ASA Programming Guide
> > > > > > > Developing Applications with the .NET Data Provider
> > > > > > >
> > > > > > > 2) If you have a stored procedure defined, please post its
> syntax
> > > > rather
> > > > > > > than summarizing. I suspect that you will need a temporary
table
> > to
> > > > > store
> > > > > > > the intermediate results and then return the resultset based
on
> a
> > > > query
> > > > > > > against that table.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > >
> > > > > > > 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:4035681b@forums-2-dub...
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > If you not understand what i want then let me know I will
> > describe
> > > > in
> > > > > > > > detail.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > I am using Sybase Anywhere 9.0.0 (1108) with C# application
> > using
> > > > > > > > iAnywhere.Data.ASAClient
> > > > > > > >
> > > > > > > > I refer this topic
> > > > > > > >
> > > > > > > > ASA Programming Guide
> > > > > > > > Developing Applications with the .NET Data Provider
> > > > > > > >
> > > > > > > > Using stored procedures
> > > > > > > >
> > > > > > > > Question :
> > > > > > > > =======
> > > > > > > >
> > > > > > > > 1. I want one result set when i call stored procedure ( I
know
> > > when
> > > > > you
> > > > > > > call
> > > > > > > > ExecuteReader that time it return resutl set)
> > > > > > > >
> > > > > > > > 2. In my procedure
> > > > > > > >
> > > > > > > > Begin
> > > > > > > >
> > > > > > > > loop
> > > > > > > > {
> > > > > > > > Select sum(mData) from table where date beetween
this1
> > and
> > > > > > this2;
> > > > > > > > }
> > > > > > > >
> > > > > > > > //Every time this1 and this2 value change and loop
rotate
> > > almost
> > > > > 70
> > > > > > > > times.
> > > > > > > > //I want to store this result in result set and finally
> > return
> > > > > this
> > > > > > > > result set so i can use this in my
> //application
> > > > > > > > End
> > > > > > > >
> > > > > > > >
> > > > > > > > Ler me know How do i manuplate result set in stored
procedure.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Chris Keating (iAnywhere Solutions) Posted on 2004-02-21 19:20:56.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <4035681b@forums-2-dub> <40357045$1@forums-1-dub> <4035904e@forums-1-dub> <40361a99@forums-2-dub> <40363967@forums-1-dub> <40364f62$1@forums-2-dub> <40365ad1@forums-2-dub> <40366ff6$1@forums-1-dub> <4037a32c@forums-1-dub>
Subject: Re: Nobudy give me answer of my QUESTION.
Lines: 428
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: surfec007.sybase.com
X-Original-NNTP-Posting-Host: surfec007.sybase.com
Message-ID: <4037af98@forums-1-dub>
Date: 21 Feb 2004 11:20:56 -0800
X-Trace: forums-1-dub 1077391256 199.93.176.7 (21 Feb 2004 11:20:56 -0800)
X-Original-Trace: 21 Feb 2004 11:20:56 -0800, surfec007.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2580
Article PK: 5718

Anyways, lets assume that you get your procedure working so that if loops
through the rows, I suggest using a TEMP table to store the results of the
select statement. Then, at the end of the procudure, select out of that temp
table.

See DECLARE LOCAL TEMPORARY TABLE.

--

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:4037a32c@forums-1-dub...
> Thanks
>
>
> "Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>
> wrote in message news:40366ff6$1@forums-1-dub...
> > Are you sure that "for(int i=sid; i<=eid; i++)" works?
> >
> > --
> >
> > 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:40365ad1@forums-2-dub...
> > > Here it is.
> > >
> > > ALTER PROCEDURE "DBA"."CompareData"(IN @sid integer, IN @eid integer)
> > > BEGIN
> > > for(int i=sid; i<=eid; i++)
> > > {
> > > Select sum(sales), sum(tax) from sales where dActivityID=i;
> > > }
> > > END
> > >
> > > In this select statement only two values but some times 4 and sometime
> 10.
> > >
> > > Thanks
> > >
> > > "Chris Keating (iAnywhere Solutions)"
<FightSpam_keating@iAnywhere.com>
> > > wrote in message news:40364f62$1@forums-2-dub...
> > > > It would be extremely helpful for you to post your procedure.
> > > >
> > > > --
> > > >
> > > > 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:40363967@forums-1-dub...
> > > > > Hi,
> > > > >
> > > > > Every time i need to create temp table and my column value is not
> fix
> > is
> > > > > depend on selection so what is the best way and which documnet i
> have
> > to
> > > > > refer.
> > > > >
> > > > > Thanks in Advance.
> > > > >
> > > > >
> > > > >
> > > > > "Jason Hinsperger" <NOJason_HinspergerSPAM@hotmail.com> wrote in
> > message
> > > > > news:40361a99@forums-2-dub...
> > > > > > You can use a stored procedure to execute the loop and place the
> > > results
> > > > > > into a temp table and return the contents of the tmep table as a
> > > single
> > > > > > result set to the application. See the documentation for
details
> on
> > > how
> > > > > to
> > > > > > do this.
> > > > > >
> > > > > > You can also use the AsaClient DataAdaptor class to build and
> store
> > > > result
> > > > > > sets locally in a Dataset.
> > > > > >
> > > > > > --
> > > > > > Jason Hinsperger
> > > > > > International and Sustaining Engineering
> > > > > > iAnywhere Solutions
> > > > > >
> > > > > > Whitepapers, TechDocs, and bug fixes are all available through
the
> > > > > iAnywhere
> > > > > > Developer Community at www.ianywhere.com/developer
> > > > > > --
> > > > > >
> > > > > >
> > > > > > "Chandresh Patel" <bapashree@yahoo.com> wrote in message
> > > > > > news:4035904e@forums-1-dub...
> > > > > > > Hi, Chris
> > > > > > >
> > > > > > > Thank you for your answer and here is my procedure.
> > > > > > >
> > > > > > > You understand correctly. I created one loop in procedure and
> this
> > > > loop
> > > > > > run
> > > > > > > for 150 times each times it return 5 value (this is not static
> > > always
> > > > it
> > > > > > > change depend on procedure). So after finished this loop I
want
> > one
> > > > > result
> > > > > > > set with this data.
> > > > > > >
> > > > > > > Is there any easy way to catch this in procedure and procedure
> > > return
> > > > > > result
> > > > > > > set.
> > > > > > >
> > > > > > > Sorry for this. Actually In my C# application I called query
150
> > > times
> > > > > and
> > > > > > > it take some time because database on internet and thats why I
> > > create
> > > > > > > procedure for this and want data in result set.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > Thanks in Advance.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > "Chris Keating (iAnywhere Solutions)"
> > > > <FightSpam_keating@iAnywhere.com>
> > > > > > > wrote in message news:40357045$1@forums-1-dub...
> > > > > > > > This newsgroup is monitored by volunteers. Please allow a
> > > reasonable
> > > > > > > amount
> > > > > > > > of time before reposting.
> > > > > > > >
> > > > > > > > That said, you could clarify you questions
> > > > > > > >
> > > > > > > > 1) If you know that ExecuteReader is capable of handling a
> > > > resultset,
> > > > > > what
> > > > > > > > specifically is the problem. use AsaDataReader Read( )
method
> in
> > a
> > > > > loop
> > > > > > to
> > > > > > > > get to the next row in the resultset until it returns false.
> > > > > > > >
> > > > > > > > i.e.,
> > > > > > > >
> > > > > > > > while( reader.Read() )
> > > > > > > > {
> > > > > > > > ... process the result set ...
> > > > > > > > }
> > > > > > > > reader.Close();Another option is to assign the resultset to
an
> > > > object
> > > > > > such
> > > > > > > > as a datagrid
> > > > > > > >
> > > > > > > > i.e.,
> > > > > > > >
> > > > > > > > dataGrid.DataSource = reader;
> > > > > > > >
> > > > > > > > BTW This was found in the documentation
> > > > > > > >
> > > > > > > > ASA Programming Guide
> > > > > > > > Developing Applications with the .NET Data Provider
> > > > > > > >
> > > > > > > > 2) If you have a stored procedure defined, please post its
> > syntax
> > > > > rather
> > > > > > > > than summarizing. I suspect that you will need a temporary
> table
> > > to
> > > > > > store
> > > > > > > > the intermediate results and then return the resultset based
> on
> > a
> > > > > query
> > > > > > > > against that table.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > >
> > > > > > > > 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:4035681b@forums-2-dub...
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > If you not understand what i want then let me know I will
> > > describe
> > > > > in
> > > > > > > > > detail.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > I am using Sybase Anywhere 9.0.0 (1108) with C#
application
> > > using
> > > > > > > > > iAnywhere.Data.ASAClient
> > > > > > > > >
> > > > > > > > > I refer this topic
> > > > > > > > >
> > > > > > > > > ASA Programming Guide
> > > > > > > > > Developing Applications with the .NET Data Provider
> > > > > > > > >
> > > > > > > > > Using stored procedures
> > > > > > > > >
> > > > > > > > > Question :
> > > > > > > > > =======
> > > > > > > > >
> > > > > > > > > 1. I want one result set when i call stored procedure ( I
> know
> > > > when
> > > > > > you
> > > > > > > > call
> > > > > > > > > ExecuteReader that time it return resutl set)
> > > > > > > > >
> > > > > > > > > 2. In my procedure
> > > > > > > > >
> > > > > > > > > Begin
> > > > > > > > >
> > > > > > > > > loop
> > > > > > > > > {
> > > > > > > > > Select sum(mData) from table where date beetween
> this1
> > > and
> > > > > > > this2;
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > > //Every time this1 and this2 value change and loop
> rotate
> > > > almost
> > > > > > 70
> > > > > > > > > times.
> > > > > > > > > //I want to store this result in result set and
finally
> > > return
> > > > > > this
> > > > > > > > > result set so i can use this in my
> > //application
> > > > > > > > > End
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Ler me know How do i manuplate result set in stored
> procedure.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


Chandresh Patel Posted on 2004-02-23 03:17:10.0Z
From: "Chandresh Patel" <bapashree@yahoo.com>
Newsgroups: ianywhere.public.general
References: <4035681b@forums-2-dub> <40357045$1@forums-1-dub> <4035904e@forums-1-dub> <40361a99@forums-2-dub> <40363967@forums-1-dub> <40364f62$1@forums-2-dub> <40365ad1@forums-2-dub> <40366ff6$1@forums-1-dub> <4037a32c@forums-1-dub> <4037af98@forums-1-dub>
Subject: Re: Nobudy give me answer of my QUESTION.
Lines: 466
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: ac8d0386.ipt.aol.com
X-Original-NNTP-Posting-Host: ac8d0386.ipt.aol.com
Message-ID: <403970b6@forums-1-dub>
Date: 22 Feb 2004 19:17:10 -0800
X-Trace: forums-1-dub 1077506230 172.141.3.134 (22 Feb 2004 19:17:10 -0800)
X-Original-Trace: 22 Feb 2004 19:17:10 -0800, ac8d0386.ipt.aol.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:2581
Article PK: 5719

Now you get it. It works for me. (the only thing is when user select some
thing in program then after i know how many column need)

Thank you very much.


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

wrote in message news:4037af98@forums-1-dub...
> Anyways, lets assume that you get your procedure working so that if loops
> through the rows, I suggest using a TEMP table to store the results of the
> select statement. Then, at the end of the procudure, select out of that
temp
> table.
>
> See DECLARE LOCAL TEMPORARY TABLE.
>
> --
>
> 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:4037a32c@forums-1-dub...
> > Thanks
> >
> >
> > "Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>
> > wrote in message news:40366ff6$1@forums-1-dub...
> > > Are you sure that "for(int i=sid; i<=eid; i++)" works?
> > >
> > > --
> > >
> > > 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:40365ad1@forums-2-dub...
> > > > Here it is.
> > > >
> > > > ALTER PROCEDURE "DBA"."CompareData"(IN @sid integer, IN @eid
integer)
> > > > BEGIN
> > > > for(int i=sid; i<=eid; i++)
> > > > {
> > > > Select sum(sales), sum(tax) from sales where dActivityID=i;
> > > > }
> > > > END
> > > >
> > > > In this select statement only two values but some times 4 and
sometime
> > 10.
> > > >
> > > > Thanks
> > > >
> > > > "Chris Keating (iAnywhere Solutions)"
> <FightSpam_keating@iAnywhere.com>
> > > > wrote in message news:40364f62$1@forums-2-dub...
> > > > > It would be extremely helpful for you to post your procedure.
> > > > >
> > > > > --
> > > > >
> > > > > 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:40363967@forums-1-dub...
> > > > > > Hi,
> > > > > >
> > > > > > Every time i need to create temp table and my column value is
not
> > fix
> > > is
> > > > > > depend on selection so what is the best way and which documnet i
> > have
> > > to
> > > > > > refer.
> > > > > >
> > > > > > Thanks in Advance.
> > > > > >
> > > > > >
> > > > > >
> > > > > > "Jason Hinsperger" <NOJason_HinspergerSPAM@hotmail.com> wrote in
> > > message
> > > > > > news:40361a99@forums-2-dub...
> > > > > > > You can use a stored procedure to execute the loop and place
the
> > > > results
> > > > > > > into a temp table and return the contents of the tmep table as
a
> > > > single
> > > > > > > result set to the application. See the documentation for
> details
> > on
> > > > how
> > > > > > to
> > > > > > > do this.
> > > > > > >
> > > > > > > You can also use the AsaClient DataAdaptor class to build and
> > store
> > > > > result
> > > > > > > sets locally in a Dataset.
> > > > > > >
> > > > > > > --
> > > > > > > Jason Hinsperger
> > > > > > > International and Sustaining Engineering
> > > > > > > iAnywhere Solutions
> > > > > > >
> > > > > > > Whitepapers, TechDocs, and bug fixes are all available through
> the
> > > > > > iAnywhere
> > > > > > > Developer Community at www.ianywhere.com/developer
> > > > > > > --
> > > > > > >
> > > > > > >
> > > > > > > "Chandresh Patel" <bapashree@yahoo.com> wrote in message
> > > > > > > news:4035904e@forums-1-dub...
> > > > > > > > Hi, Chris
> > > > > > > >
> > > > > > > > Thank you for your answer and here is my procedure.
> > > > > > > >
> > > > > > > > You understand correctly. I created one loop in procedure
and
> > this
> > > > > loop
> > > > > > > run
> > > > > > > > for 150 times each times it return 5 value (this is not
static
> > > > always
> > > > > it
> > > > > > > > change depend on procedure). So after finished this loop I
> want
> > > one
> > > > > > result
> > > > > > > > set with this data.
> > > > > > > >
> > > > > > > > Is there any easy way to catch this in procedure and
procedure
> > > > return
> > > > > > > result
> > > > > > > > set.
> > > > > > > >
> > > > > > > > Sorry for this. Actually In my C# application I called query
> 150
> > > > times
> > > > > > and
> > > > > > > > it take some time because database on internet and thats why
I
> > > > create
> > > > > > > > procedure for this and want data in result set.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > Thanks in Advance.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > "Chris Keating (iAnywhere Solutions)"
> > > > > <FightSpam_keating@iAnywhere.com>
> > > > > > > > wrote in message news:40357045$1@forums-1-dub...
> > > > > > > > > This newsgroup is monitored by volunteers. Please allow a
> > > > reasonable
> > > > > > > > amount
> > > > > > > > > of time before reposting.
> > > > > > > > >
> > > > > > > > > That said, you could clarify you questions
> > > > > > > > >
> > > > > > > > > 1) If you know that ExecuteReader is capable of handling a
> > > > > resultset,
> > > > > > > what
> > > > > > > > > specifically is the problem. use AsaDataReader Read( )
> method
> > in
> > > a
> > > > > > loop
> > > > > > > to
> > > > > > > > > get to the next row in the resultset until it returns
false.
> > > > > > > > >
> > > > > > > > > i.e.,
> > > > > > > > >
> > > > > > > > > while( reader.Read() )
> > > > > > > > > {
> > > > > > > > > ... process the result set ...
> > > > > > > > > }
> > > > > > > > > reader.Close();Another option is to assign the resultset
to
> an
> > > > > object
> > > > > > > such
> > > > > > > > > as a datagrid
> > > > > > > > >
> > > > > > > > > i.e.,
> > > > > > > > >
> > > > > > > > > dataGrid.DataSource = reader;
> > > > > > > > >
> > > > > > > > > BTW This was found in the documentation
> > > > > > > > >
> > > > > > > > > ASA Programming Guide
> > > > > > > > > Developing Applications with the .NET Data Provider
> > > > > > > > >
> > > > > > > > > 2) If you have a stored procedure defined, please post its
> > > syntax
> > > > > > rather
> > > > > > > > > than summarizing. I suspect that you will need a temporary
> > table
> > > > to
> > > > > > > store
> > > > > > > > > the intermediate results and then return the resultset
based
> > on
> > > a
> > > > > > query
> > > > > > > > > against that table.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > >
> > > > > > > > > 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:4035681b@forums-2-dub...
> > > > > > > > > > Hi,
> > > > > > > > > >
> > > > > > > > > > If you not understand what i want then let me know I
will
> > > > describe
> > > > > > in
> > > > > > > > > > detail.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > I am using Sybase Anywhere 9.0.0 (1108) with C#
> application
> > > > using
> > > > > > > > > > iAnywhere.Data.ASAClient
> > > > > > > > > >
> > > > > > > > > > I refer this topic
> > > > > > > > > >
> > > > > > > > > > ASA Programming Guide
> > > > > > > > > > Developing Applications with the .NET Data Provider
> > > > > > > > > >
> > > > > > > > > > Using stored procedures
> > > > > > > > > >
> > > > > > > > > > Question :
> > > > > > > > > > =======
> > > > > > > > > >
> > > > > > > > > > 1. I want one result set when i call stored procedure
( I
> > know
> > > > > when
> > > > > > > you
> > > > > > > > > call
> > > > > > > > > > ExecuteReader that time it return resutl set)
> > > > > > > > > >
> > > > > > > > > > 2. In my procedure
> > > > > > > > > >
> > > > > > > > > > Begin
> > > > > > > > > >
> > > > > > > > > > loop
> > > > > > > > > > {
> > > > > > > > > > Select sum(mData) from table where date beetween
> > this1
> > > > and
> > > > > > > > this2;
> > > > > > > > > > }
> > > > > > > > > >
> > > > > > > > > > //Every time this1 and this2 value change and loop
> > rotate
> > > > > almost
> > > > > > > 70
> > > > > > > > > > times.
> > > > > > > > > > //I want to store this result in result set and
> finally
> > > > return
> > > > > > > this
> > > > > > > > > > result set so i can use this in my
> > > //application
> > > > > > > > > > End
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Ler me know How do i manuplate result set in stored
> > procedure.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>