[sqlite] New default table on DB initialization

2011-04-07 Thread RAKESH HEMRAJANI
Hi, Need a default table to be created on database initialization. i was able to achieve that by executing one create statement query at the end of the function openDatabase. however the problem is that on opening the same DB for the second time, the query fails with error table already

[sqlite] insert statement using temp variable

2011-04-04 Thread RAKESH HEMRAJANI
hi, need help with very basic question.. More of C than SQLite. have a very simple C program using sqlite DB. .. int i=0; rc = sqlite3_exec(db, "create table emp (empid num);", callback, 0, ); rc = sqlite3_exec(db, "insert into emp values(i);", 0, 0, ); ---

[sqlite] block alter table command / table Constraints

2011-03-31 Thread RAKESH HEMRAJANI
? table sales(cost price, sale price) i need a constraint cost price < sale price so that i dont have to do code level checks during insert statements thanks and regards Rakesh Hemrajani ___ sqlite-us

[sqlite] Return failure from User Defined Function

2011-03-29 Thread RAKESH HEMRAJANI
Hello Experts, How to return failure from a user defined function such that it halts the main query? for example: assuming i have simple user defined function checkLessThanTen(arg 1) While calling this function in my query (say select checkIsNumber('11') from employee) how to

[sqlite] Query within user defined funtion / UDF in sqlite

2011-03-09 Thread RAKESH HEMRAJANI
Hello Experts, How can i execute a query from user defined function. the user defined function is defined inside sqlite itself (in shell.c opendb function, there is user defined function shellstatic but it doenst query the DB) for example: an user defined function is intended to get

[sqlite] Implementing sequence nextval in sqlite

2011-03-07 Thread RAKESH HEMRAJANI
Hello experts I am newbie to sqlite, have started understanding the code, at the moment m stuck and not able to understand how to generate byte code Probleme statement is : I want to implement nextval keyword in sqlite E.g Select seq.nextval from employee so o/p should be next available