sqlite3

How to handle UTF-8 characters in sqlite2 to sqlite3 migration

Trying the easy approach: sqlite2 mydb.db .dump | sqlite3 mydb-new.db I got this error: SQL error near line 84802: no such column: Ð In that line the script is this: INSERT INTO vehiculo VALUES(127548,'21K0065217',Ñ,'PA007808',65217,279,1989,3,468,'1998-07-30 00:00:00.000000','14/697/98-07',2,'',1); My guess is that the...

Get specific "version" of a column

I have an app that uses SQLite to store data locally. There may be more than one file storing the data. All the files contain a list of items, but only one of them has the "correct" status for the current user (basically, there is a "user" db in $HOME and a "system-wide" one in /etc). Usually, both files will contain the same list of ...

Rails & SQLite3: Date Mis-Match

Rails is returning the wrong date from my database records. For my model ("Target"), if I run in script/console: Target.find :all I get all my records with the "recorded_on" field reading dates from "2000-01-01 xx:xx:xx". If I take the same database and run in the sqlite3 console: SELECT * FROM targets; I get all my records with ...

iPhone SQLite - getting sqlite3error()

Hi I am trying to reuse a sqlite statement in my application in a method. Here's the relevant code if(getsets_statement == nil){ const char *sql = "SELECT DISTINCT num,roll FROM mytable WHERE cls like ? and divname like ?"; if(sqlite3_prepare_v2(database, sql, -1, &getsets_statement, NULL) != SQLITE_OK){ NSAssert1(0, @"Error: Faile...

Sqllite3 prepare insert query in iphone programming

NSString *event=@"max"; NSString *venue=@"tvm"; NSString *edate=@"may 6"; NSString *etime=@"10:30"; int admts=5; NSString *ima=ticobj.iimg; sqlite3 *database; databaseName = @"smbhDB.sql"; sqlite3_stmt *addStatement ; NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *doc...

Why does sqlite3_bind seem to LOOP?

I'm using a few sqlite3_bind routines (in the iPhone SDK) as shown below to make a single update (INSERT or UPDATE) to a table: sqlite3_bind_text(update_statement, 1, aString, -1, SQLITE_TRANSIENT); sqlite3_bind_int(update_statement, 2, anInteger); sqlite3_bind_int(update_statement, 3, pk); However, upon checki...

Has anyone tried any of the SQLite3 wrapper APIs for easier database functionality on the iPhone?

Coming from a non-SQL background, I've been having a hard time absorbing SQLite3 for the past few days. Has anyone had any good results using any of the SQLite3 wrapper APIs out there? Do they work reliably? Which is best? I am also hearing buzz about Core Data coming to the iPhone. Not sure whether that info is trustworthy or not but ma...

sqllite3 prepare insert query in iphone programming

this is not working .. if anybody can rectify this error pls rectify it . when i execute this i got one msg is "EXC_BAD_ACCESS " -(void) adddata{ NSString *event=@"max"; NSString *venue=@"tvm"; NSString *edate=@"may 6"; NSString *etime=@"10:30"; int admts=5; NSString *ima=@"TTTTTTTTT";//ticobj.iimg; sqlite3 *...

What's the easiest way of using SQLite3 in iPhone-OS?

I've heard that it's a bad idea to use plain SQLite3 in an iPhone project. Which frameworks, libs, wrappers, etc. do you use? Which are worth looking at? ...

Advantages and Disadvantages of SQLite.NET and SQL Server Compact

I have used SQLite.NET many times. It always worked fine but I have a friend that is really pestering me that I should use instead SQL Server Compact so I stayed fully in Microsoft environment. Now, I never worked with Compact, and he tells me it works fine for him, but seeing that .MDF extension gives me the creeps. No kidding. Last th...

Database design for physics hardware

Hi everyone, I have to develop a database for a unique environment. I don't have experience with database design and could use everybody's wisdom. My group is designing a database for piece of physics hardware and a data acquisition system. We need a system that will store all the hardware configuration parameters, and track the change...

getting sqlite3 database from a server and copy it into iphone's documents directory?

I need to extract data entries from a server-based sqlite database into different objects in my project. I have only been able to find tutorials and write-ups on how to feed data to a Table View through a local database. Say the database has 5 rows, each with 10 columns. How do I take the text from e.g. column 3, row 5 and make it show...

Why is SQLite not incrementing my primary key?

Here is my table, sqlStmt = [ [ NSString stringWithFormat:@"Create Table %@ (recordNo INTEGER PRIMARY KEY AUTOINCREMENT, noOfPlayer INTEGER, smallBlindAmt INTEGER, bigBlindAmt INTEGER , startingChips INTEGER, roundTimer INTEGER) " , SETTINGS_TABLE ] StringUsingEncoding:NSUTF8StringEncoding ] ; insert query, sqlStmt = [ [ NSString ...

SQL: Insert multiple sets of values in one statement?

Is it possible to insert multiple sets of values to a SQLite table in one statement? I was trying: INSERT INTO the_table VALUES (1,2,'hi'),(2,0,'foo'); with the different ()s representing different insert sets, but I get an error. ...

How to get a list of column names on sqlite3 / iPhone?

I want to migrate my iPhone app to a new database version. Since I don't have some version saved, I need to check if certain column names exist. This Stackoverflow entry suggests doing the select SELECT sql FROM sqlite_master WHERE tbl_name = 'table_name' AND type = 'table' and parse the result. Is that the common way? Alternatives...

how to enable sqlite3 for php?

Hi, I am trying to install sqlite3 for php in ubuntu. I install apt-get php5-sqlite3 and edited php.ini to include sqlite3 extension. When I run phpinfo(); I get SQLITE3 SQLite3 support enabled sqlite3 library version 3.4.2 as shown above, sqlite3 is enabled. However, I get "Class SQLite3 not found" when I use new SQLite3("dat...

how to detect which cell is clicked then generate next view according to it in iphone uitableview?

hello all i am new to iphone development i am working on a application called flash cards... my problem is i want to generate flash cards from database... here is some code to explain home screen---- index View categoryView TileView bookmarks search download indexView is a uitableView category1(section header tit...

SQLite Exception: SQLite Busy

Can anyone provide any input on this error. I am trying to insert into table using Objective C. While I am doing this, I am getting an error SQLite Busy. Why this is happening? ...

How to set Sqlite3 to be case insensitive when string comparing?

I want to select records from sqlite3 database by string matching. But if I use '=' in the where clause, I found that sqlite3 is case sensitive. Can anyone tell me how to use string comparing case-insensitive? Thank you very much! ...

Rails does not recognize sqlite3 REAL datatype

I have created the following table in sqlite3: CREATE TABLE Test ( Id TEXT PRIMARY KEY NOT NULL, Count REAL ); But when I try to generate a model for this table, the schema.rb gives the following error: Could not dump table "Test" because of following StandardError: Unknown type 'REAL' for column 'Count' Is the...