Unix Technical Forum

Retrieving entire columns from a resultset

This is a discussion on Retrieving entire columns from a resultset within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Hi, I would like to know if there is anyway of retreiving an entire column of data from a ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 09:46 PM
=?Utf-8?B?TWl0aGlsYVA=?=
 
Posts: n/a
Default Retrieving entire columns from a resultset

Hi,

I would like to know if there is anyway of retreiving an entire column of
data from a resultset into say an array or a vector.

e.g. If the resultset contains columns ID (int), Name(varchar), age(int)
then I'd like retrieve the ID values from each tuple in one go into say an
int array or a vector.

(I am using a mysql database and a mysql ODBC driver to connect to it)

Thanks,
Mithila
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 09:47 PM
Scot T Brennecke
 
Posts: n/a
Default Re: Retrieving entire columns from a resultset

It sounds like you may be able to use what's called "bulk row fetching".
What language, version, libraries, etc. are you using?

In article <F6874AB5-D7C4-4B22-A675-FAA2F3039DE0@microsoft.com>,
MithilaP@discussions.microsoft.com says...
> I would like to know if there is anyway of retreiving an entire column of
> data from a resultset into say an array or a vector.
>
> e.g. If the resultset contains columns ID (int), Name(varchar), age(int)
> then I'd like retrieve the ID values from each tuple in one go into say an
> int array or a vector.
>
> (I am using a mysql database and a mysql ODBC driver to connect to it)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 09:47 PM
=?Utf-8?B?TWl0aGlsYVA=?=
 
Posts: n/a
Default Re: Retrieving entire columns from a resultset

Hi,

I am using C++ (compatible with visual studio 6), mysql odbc driver 3.51,
mysql 4.0.12.

Thanks,
Mithila

"Scot T Brennecke" wrote:

> It sounds like you may be able to use what's called "bulk row fetching".
> What language, version, libraries, etc. are you using?
>
> In article <F6874AB5-D7C4-4B22-A675-FAA2F3039DE0@microsoft.com>,
> MithilaP@discussions.microsoft.com says...
> > I would like to know if there is anyway of retreiving an entire column of
> > data from a resultset into say an array or a vector.
> >
> > e.g. If the resultset contains columns ID (int), Name(varchar), age(int)
> > then I'd like retrieve the ID values from each tuple in one go into say an
> > int array or a vector.
> >
> > (I am using a mysql database and a mysql ODBC driver to connect to it)

>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 09:47 PM
Scot T Brennecke
 
Posts: n/a
Default Re: Retrieving entire columns from a resultset

Are you using MFC and a class derived from CRecordset to perform the
ODBC? If so, you can use the built-in support for "bulk record field
exchange" in your application. If not using MFC, you can still use the
same methodology that MFC uses and call the ODBC functions directly, if
you look at the MFC source code and the DBFETCH sample.

In article <35887A32-F785-4841-A46A-202CA49B19B3@microsoft.com>,
MithilaP@discussions.microsoft.com says...
> Hi,
>
> I am using C++ (compatible with visual studio 6), mysql odbc driver 3.51,
> mysql 4.0.12.
>
> Thanks,
> Mithila
>
> "Scot T Brennecke" wrote:
>
> > It sounds like you may be able to use what's called "bulk row fetching".
> > What language, version, libraries, etc. are you using?
> >
> > In article <F6874AB5-D7C4-4B22-A675-FAA2F3039DE0@microsoft.com>,
> > MithilaP@discussions.microsoft.com says...
> > > I would like to know if there is anyway of retreiving an entire column of
> > > data from a resultset into say an array or a vector.
> > >
> > > e.g. If the resultset contains columns ID (int), Name(varchar), age(int)
> > > then I'd like retrieve the ID values from each tuple in one go into say an
> > > int array or a vector.
> > >
> > > (I am using a mysql database and a mysql ODBC driver to connect to it)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:50 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com