qtsql

Using SQLite with QT

I am thinking of using SQLite as a backend DB for a C++ applicatiojn I am writing. I have read the relevant docs on both teh trolltech site and sqlite, but the information seems a little disjointed, there is no simple snippet that shows a complete CRUD example. I want to write a set of helper functions to allow me to execute CRUD action...

QSqlQuery UPDATE/INSERT DateTime with server's time (eg CURRENT_TIMESTAMP)

I am using QSqlQuery to insert data into a MySQL database. Currently all I care about is getting this to work with MySQL, but ideally I'd like to keep this as platform-independent as possible. What I'm after, in the context of MySQL, is to end up with code that effectively executes something like the following query: UPDATE table SET ...

Can I create a table with check constrain whose values are dependent on sql query

Is it possible to create a table which has a check constraint on one of the column whose value lies within the result set given by another sql query eg. create table tablename ( name varchar(10), rollno int )check rollno in (select rollno from anotherDatabase.TableName,candidateRoll) or any thing like that. I dont have to use it an...

multiple sql statements in QSqlQuery using the sqlite3 driver

I have a file containing several sql statements that I'd like to use to initialize a new sqlite3 database file. Apparently, sqlite3 only handles multiple statements in one query via the sqlite3_exec function, and not through the prepare/step/finalize functions. That's all fine, but I'd like to use the QtSQL api rather than the c api dire...

problem with QSqlTalbeModel . table is not showing

hello, i have a QsqlTableModel that is assigned to a table view . my problem is that it doesn't populate the table inside the table view . it's still empty and it says (Unable to find table shots) - when printing lastError.text() - the function retrieveShotResults..(check code below) is to test if there is a table called shots and yes...