On Thu, May 21, 2009 at 01:44:19PM -0700, rajyalakshmi bommaraju scratched on 
the wall:
> If there are x columns in the row , now I have to keep saying
> getnext columnname,get next column value for that name for x times.
> instead I get values into tuple in one call.


  Somewhere, at some level, you have to extract each value from each
  column of each row.  The fact that this is fairly exposed to you
  doesn't make it any more expensive than an API that hides all that
  behind one API function call.

  The SQLite API has a function that let you extract whole tables with
  one call.  Want to guess how it works?


  Function calls in and of themselves aren't that expensive.
  
   -j


> --- On Thu, 5/21/09, Pavel Ivanov <paiva...@gmail.com> wrote:
> 
> From: Pavel Ivanov <paiva...@gmail.com>
> Subject: Re: [sqlite] Fw: Question about reading all database data into memory
> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
> Date: Thursday, May 21, 2009, 11:33 AM
> 
> Why do you expect performance improvement in your approach as opposed
> to implemented now?
> 
> Pavel
> 
> On Thu, May 21, 2009 at 1:56 PM, rajyalakshmi bommaraju
> <rbommar...@yahoo.com> wrote:
> > I did not get any reply so adding bit more explanation for what I need.
> >
> > In a C program, I am trying to read data from database. I use 
> > sqlite3_prepare_v2 to execute "Select * from abc", sqlite3_step to get a 
> > row, and sqlite3_col_name,sqlite3_col_val to get column values.? I read 
> > columns one by one for each row. Instead I would like to read (x,y,z) { 
> > example sake, assume that x,y,z columns exist} from a row at a time into 
> > variables as a tuple. Can I do that?
> >
> > Is there a way, I can attach tuple to the database query and get the data 
> > as an array of tuple? Is it possible.
> >
> > Experts, please throw some light on this.
> >
> > Thanks
> > Raji
> > ?5/20/09, rajyalakshmi bommaraju <rbommar...@yahoo.com> wrote:
> >
> > From: rajyalakshmi bommaraju <rbommar...@yahoo.com>
> > Subject: [sqlite] Question about reading all database data into memory
> > To: sqlite-users@sqlite.org
> > Date: Wednesday, May 20, 2009, 9:16 PM
> >
> > HI,
> >
> > .? If I have to read all the database data into memory, I needed to execute 
> > sqlite3_prepare_v2 statement,and then sqlite3_step to access the rows, and 
> > processing each row to get the rows content.? This does not look efficient. 
> > Is there any other way to do this?
> >
> > Thanks
> > Raji
> >
> >
> >
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> >
> >
> >
> > _______________________________________________
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 
> 
>       
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to