On Thu, Oct 15, 2009 at 10:37 AM, Kavita Raghunathan <kavita.raghunat...@skyfiber.com> wrote: > Thanks much Pavel. > > No you are right I'm more of a L3 protocols > person with some user interfaces and network security, > somehow ended up trying to use sqlite now. I'll look through > your link on SQL.
My advice -- since you are now working with a SQL database, you would become way more efficient if you followed Pavel's advice and learned SQL basics. The basics are really not that hard, but your questions display that you are missing that knowledge. Once you know the basics, you will be well on your way, and will really be encountering SQL-specific and sqlite-specific hurdles. That is where this list comes in to help and becomes useful. > > Regards, > Kavita > ----- Original Message ----- > From: "Pavel Ivanov" <paiva...@gmail.com> > To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> > Cc: "Kelvin Xu" <kelvin...@skyfiber.com> > Sent: Thursday, October 15, 2009 10:28:23 AM GMT -06:00 US/Canada Central > Subject: Re: [sqlite] Replacing a table > > I guess you didn't work with SQL anywhere in your developer life, > right? Read some books or internet pages about it. You can start from > here http://en.wikipedia.org/wiki/SQL and follow any links there. > > To update column in all rows of the table you need to issue the > following statement: > > UPDATE table_name SET column_name = value > > It doesn't require you to loop through all rows although DBMS will > iterate all of them for you. > > > Pavel > > On Thu, Oct 15, 2009 at 11:22 AM, Kavita Raghunathan > <kavita.raghunat...@skyfiber.com> wrote: >> Thanks Pavel and Owen. This is very useful information. >> >> Also how can we change a whole column at a time ? >> In otherwords, the entire column needing to be changed would >> involve looping through each entry and changing that value, >> instead i want to substitute a whole column. >> >> Thanks! >> Kavita >> ----- Original Message ----- >> From: "Owen O'Neill" <oone...@averyberkel.com> >> To: "General Discussion of SQLite Database" <sqlite-users@sqlite.org> >> Sent: Thursday, October 15, 2009 9:59:32 AM GMT -06:00 US/Canada Central >> Subject: Re: [sqlite] Replacing a table >> >> >> Run the sql >> 'delete from "tablename";' >> >> if the table definition is different (different column names or data >> types ) then you will need to drop the table and create a new one. >> 'drop table "tablename";' >> >> http://www.sqlite.org/lang_createtable.html >> >> if the table is huge you might get different performance depending on >> whether your journal settings are to truncate or delete or pad etc. >> >> -----Original Message----- >> From: sqlite-users-boun...@sqlite.org >> [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Kavita Raghunathan >> Sent: Thursday, October 15, 2009 3:51 PM >> To: General Discussion of SQLite Database >> Cc: Kelvin Xu >> Subject: [sqlite] Replacing a table >> >> Hi, >> >> Is there a way to use the sqlite wrappers to "replace" or delete a table >> completely ? >> (without looping through and deleting each row and column) >> The number of columns and rows of the new table is identical to the >> number >> of columns and rows of the old table being replaced. Is there a quick >> way >> to do that? >> >> Thanks, >> Kavita >> _______________________________________________ >> 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 > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Puneet Kishor http://www.punkish.org Carbon Model http://carbonmodel.org Charter Member, Open Source Geospatial Foundation http://www.osgeo.org Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor Nelson Institute, UW-Madison http://www.nelson.wisc.edu ----------------------------------------------------------------------- Assertions are politics; backing up assertions with evidence is science ======================================================================= Sent from Madison, WI, United States _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users