I have an sqlite string column that is assigned to a string. I need to make sure it isn't nil before assigning. I'm doing this:
char *isNil = sqlite3_column_text(selectstmt, 2);
if(isNil != nil){
myName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt, 2)];}
which gives the warning:
warning: initialization ...
I want to get the number of selected rows as well as the selected data. At the present I have to use two sql statements: one is select * from XXX where XXX; the other is select count(*) from XXX where XXX; Can it be realised with a single sql string?
I've checked the source code of sqlite3, and I found the function of sqlite3_changes()....
I could use this query to select all orders with a date on a monday:
SELECT * from orders WHERE strftime("%w", date)="1";
But as far as I know, this can't be speed up using an index, as for every row strftime has to be calculated.
I could add an additional field with the weekday stored, but I want to avoid it. Is there a solution tha...
I'm trying to create a new SQLite database from scratch by writing the schema for my new tables (only one so far though), and the INSERT statements for that table in one file.
Then I go into sqlite3 and try to create the database as follows:
$ sqlite3 newdatabase.db
SQLite version 3.4.0
Enter ".help" for instructions
sqlite> .read ./sc...
I am looking to retrieve a list of columns in a table. The database is the latest release of SQLite (3.6, I believe). I am looking for code that does this with a SQL query. Extra bonus points for metadata related to the columns (e.g. length, data type, etc...)
...
I have the follow sql statement in a program I am building, where id_list is sometimes a very large list.
for id in id_list:
self.cursor.execute("""update songs set rating='L' where trackid=?""", (id,))
self.db.commit()
Is there a more efficient way of doing this that doesn't involve so many update queries?
...
I am writing a Python (2.5) GUI Application that does the following:
Imports from Access to an Sqlite database
Saves ui form settings to an Sqlite database
Currently I am using pywin32 to read Access, and pysqlite2/dbapi2 to read/write Sqlite.
However, certain Qt objects don't automatically cast to Python or Sqlite equivalents when...
Using pysqlite how can a user-defined-type be used as a value in a comparison, e. g: “... WHERE columnName > userType”?
For example, I've defined a bool type with the requisite registration, converter, etc. Pysqlite/Sqlite responds as expected for INSERT and SELECT operations (bool 'True' stored as an integer 1 and returned as True).
B...
Sqlite3 by default sorts only by ascii letters. I tried to look in google, but the only thing I found were informations about collations. Sqlite3 has only NOCASE, RTRIM and BIARY collations. How to add support for a specific locale?
(I'm using it in Rails application)
...
I was wondering if anyone has seen a library that abstracts away SQLite and Tokyo-Cabinet to the same API. Basically I'm looking for something that will allow me to test and dev with SQLite, and later move to TC for production.
Anyways the language I'm using specifically is Lua, but I'm sure such a library doesn't exist for Lua, so a L...
The downloads page on www.sqlite.org appears to only have links to the current version, and I would like to get a previous version. I cannot see any obvious links to historical versions on the site and (unless I'm missing something obvious) there does not appear to be a sourceforge project.
Can someone point me at an archive of old S...
I am using django for running my project. And I am using postgresql_psycopg2 engine for my production db, but the test runner uses sqllite3 for running the tests. Keeping my production db(postgresql)in mind I tried building a query which uses "coalesce". But sqllite3 doesn't recognize this. How do I get pass this. I can use postgresql_ps...
My data fits a tree form naturally. Therefore, I have a simple SQL table to store the data: {id, parentid, data1, ..., dataN}
I want to be able to "zoom in" on the data and produce a report which summarizes the data found below the current branch.
That is, when standing in the root, I want to have the totals of all the data. When I ha...
For the iPhone, since sqlite3 doesn't support ALTER for a column, how do I change the data type of a column on a table that needs to preserve its data?
...
I have used sqlite in c++, python and now (perhaps) in C#. In all of these i have no idea how to insert a blob into a table. How do i store and retrieve a blob in sqlite?
...
Is there any common sqlite3 connection class available for working with the iPhone SDK. I realize that it is quite easy to connect and run queries everytime, but to save up more time it would be a real help if we could use a class to handle all the sql directly.
I would imagine something which returns a NSMutableArray if you pass a quer...
Firefox 3 now stores bookmarks in a Sqlite file called profiles.sqlite.
This file is locked while Firefox 3 is running.
I know that there are backup files, but they are old (only written when FF exits).
I do not want the user to have to install a plug-in.
Is there a way to grab the bookmarks while FF 3 is running?
I am developing in...
Anyone out there statically linking sqlite (as opposed to using the dynamic linking)?
I am having issues with users with jailbroken phones not having the same version of sqlite that the stock iPhone assumes (and hence causing crashes). I'm assuming that staticly linking a known version of sqlite in my app is the answer...
...
SQLite3.
Can I make a field AUTOINCREMENT after made a table?
I mean ,I make a table.
then , after that,
can I make it as a AUTOINCREMENT ?
or do i have to say AUTOINCREMENT
when I make a table>
Is it only the chance to make it AUTOINCREMENT ?
...
I have a text field and its breaking my sql statement. How do i escape all the chars in that field? I am using sqlite with http://sqlite.phxsoftware.com/ in C#
...