Re: [sqlite] Converting BLOB Data type to String
Hello Igor, I tried what u suggested me,I got a compiler error cannot convert const void * to void* . I am storing string as blob because I want hide my data from others I am writing an application which works on portable apps in my apps I am using sqlite if any one opens the database using tools available in the internet any one can view my data i.e. what I am carrying so I am avoiding this by storing it using blob. Can you please help in converting this i.e. const void * to CString or tell me any other way to hide my data from others (the operation should not be time consuming) Regards, G.Satish -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik Sent: Thursday, April 02, 2009 4:57 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Converting BLOB Data type to String "SATISH" <g.satis...@gmail.com> wrote in message news:49d4529b.034c6e0a.2f1d.0...@mx.google.com >I have written a string into database by converting into "BLOB > Data Type".writing into database is Ok I got a problem when reading > from the database to read a blob from the database I am using the > function "const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);" > this functions returns me const void * where I want to convert this > into "CString".please any one of you can help me in converting const > void * to CString. Try this: void* data = sqlite3_column_blob(my_stmt, col_no); int size = sqlite3_column_bytes(my_stmt, col_no); CString str(static_cast<char*>(data), size); But why do you store your string as BLOB, and not as text, in the first place? Igor Tandetnik ___ 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
Re: [sqlite] Converting BLOB Data type to String
Hello Buddies, I have inserted into database using the sqlite api function "int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*));".Here before binding I have converted the const void * to CString. I am trying to retrieve the data using the sqlite api function "const void *sqlite3_column_blob(sqlite3_stmt*, int iCol);" Regards, G.Satish. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Jens Miltner Sent: Thursday, April 02, 2009 3:12 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Converting BLOB Data type to String Am 02.04.2009 um 07:45 schrieb SATISH: > Hello Buddies, > >I have written a string into database by converting into > "BLOB Data > Type".writing into database is Ok I got a problem when reading from > the > database to read a blob from the database I am using the function > "const > void *sqlite3_column_blob(sqlite3_stmt*, int iCol);" this functions > returns > me const void * where I want to convert this into "CString".please > any one > of you can help me in converting const void * to CString. How did you write the data to the database? SQLite does not have per- column data types, but rather uses per-value data types, i.e. whatever your inserted the data as will be used as the data type for that value. Did you try to just retrieve the value as a string (using sqlite3_column_text)? ___ 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] SQLITEBUSYTIMEOUT
Hi! I am having 10 threads in my application by default my application uses UTF-16, where I use the 10 threads to open the same sqlite file and write in 10 different tables simultaneously.these all threads write around 7000 records in 10 different tables. While a thread opens the connection I will set the SQLite Busy timeout to 60 seconds. Each thread will sleep until their turn comes and writes into database.After Complete execution of 10 threads . I have found 12 records which were not written into sqlite file out of 7000 Records. Can U Please tell me Why this loss of Information is occurring. Regards G.Satish. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] History of SQL
Hi all, I want to set up a history of changes in a database schema. I hoped I could simply set up triggers for changes to the SQLite_Master table, like this: create table "BF SQLite_Master History" -- record changes to SQLite_Master ( ID integer primary key , Date date -- julianday utc of the date & time of the change , Event text -- insert, delete, or update , SQL text -- SQL prior to change for delete and update, after change for insert ) ; create trigger "BF SQLite_Master Insert" before insert on SQLite_Master begin insert into "BF SQLite_Master History" ( Date , Event , SQL ) select julianday('now', 'utc') , 'insert' , new.SQL ; end ; But I get an error: SQL error near line 1: cannot create trigger on system table Is it possible to enable this functionality? Thanks, G.Satish ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Maximum Size of Record
Hi, I have seen the link which you sent.I didn't found any thing in which you sent regarding the size of number or text Field.In the link which u sent there mentioned the size limit of blob I didn't found any size limit regarding text and number.Can I assume the size of number and text as unlimited. Regards, G.Satish. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin.Engelschalk Sent: Wednesday, December 10, 2008 5:45 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Maximum Size of Record Hi, See http://www.sqlite.org/limits.html Martin Satish schrieb: > Hi Igor, > > Can I know the Maximum size of Record in sqlite or Can I > know the maximum size of NUMBER,TEXT and BLOB Data types. > > > > Regards, > > G.Satish. > > ___ > 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] Maximum Size of Record
Hi Igor, Can I know the Maximum size of Record in sqlite or Can I know the maximum size of NUMBER,TEXT and BLOB Data types. Regards, G.Satish. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Function Name
HI! What is the c/c++ API function given by SQLite to attach a database to another database or tell me how to get access the tables in the other database using a c/c++ API function Regards Satish.G ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Violating Primary key Constraint
Hi! You Said me to create the field as "INT PRIMARY KEY NOT NULL" instead of "INTEGER PRIMARY KEY NOT NULL".Even we spell differently they are working same.it is also auto incrementing. sqlite> create table dummytable (recid integer PRIMARY KEY NOT NULL, label text); sqlite> insert into dummytable (label) VALUES ('foo'); sqlite> select * from dummytable; 1|foo sqlite> create table secondtable (recid INT PRIMARY KEY NOT NULL, label text); sqlite> insert into secondtable (label) VALUES ('foo'); 1|foo I am not getting any constraint failed error Regards, Satish.G -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ian Walters Sent: Tuesday, November 25, 2008 11:17 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Violating Primary key Constraint Hi Satish, I just re-read your original email and Igor's response seemed appropriate. The original email read as if you were reporting a problem rather than asking a question. As for you question: sqlite> create table dummytable (recid integer PRIMARY KEY NOT NULL, label text); sqlite> insert into dummytable (label) VALUES ('foo'); sqlite> select * from dummytable; 1|foo sqlite> create table secondtable (recid INT PRIMARY KEY NOT NULL, label text); sqlite> insert into secondtable (label) VALUES ('foo'); SQL error: secondtable.recid may not be NULL -- Ian Satish wrote: > Hi Igor! > > Thanks for the reply.The thing I need is I don't want the field to be > auto incremented it should show me the error that constraint violated even > if I give NULL or empty value.how can I do this.Don't send me links which > doesn't have matter at all.First try to understand the problem and then give > me reply. > > Regards, > Satish.G > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Igor Tandetnik > Sent: Tuesday, November 25, 2008 10:59 AM > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Violating Primary key Constraint > > "Satish" <[EMAIL PROTECTED]> wrote in > message news:[EMAIL PROTECTED] >> I have created a table in sqlite.Upto my knowledge a column which is >> declared as primary key will not accept null and even if I don't give >> any value to that field an error occurs that violating the constraint >> >> For Example >> >> Create table emp(empno integer PRIMARY KEY,...,...) >> >> . Even if I give u a NULL as a value to the field that is >> declared as primary key .it is accepting > > http://sqlite.org/autoinc.html ___ 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
Re: [sqlite] Violating Primary key Constraint
Hi Igor! You Said me to create the field as "INT PRIMARY KEY" instead of "INTEGER PRIMARY KEY".Even we spell differently they are working same.it is also auto incrementing. Regards, Satish.G -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor Tandetnik Sent: Tuesday, November 25, 2008 11:13 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Violating Primary key Constraint "Satish" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >Thanks for the reply.The thing I need is I don't want the field to > be > auto incremented Spell the field in some way other than precisely "INTEGER PRIMARY KEY". E.g. "INT PRIMARY KEY" would work as you expect. Igor Tandetnik ___ 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] Foreign Key
Hi All! I have a small question that Foreign key Constraint is now supported by SQLite or not.I had this question because in an SQLite table for a Foreign key "ON DELETE CASCADE or ON UPDATE CASCADE " are not working.Is there any problem with my database or with SQLite. Regards, Satish.G ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Violating Primary key Constraint
Hi Igor! Thanks for the reply.The thing I need is I don't want the field to be auto incremented it should show me the error that constraint violated even if I give NULL or empty value.how can I do this.Don't send me links which doesn't have matter at all.First try to understand the problem and then give me reply. Regards, Satish.G -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor Tandetnik Sent: Tuesday, November 25, 2008 10:59 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Violating Primary key Constraint "Satish" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have created a table in sqlite.Upto my knowledge a column which is > declared as primary key will not accept null and even if I don't give > any value to that field an error occurs that violating the constraint > > For Example > > Create table emp(empno integer PRIMARY KEY,...,...) > > . Even if I give u a NULL as a value to the field that is > declared as primary key .it is accepting http://sqlite.org/autoinc.html -- With best wishes, Igor Tandetnik With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925 ___ 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] Violating Primary key Constraint
Hi All! I have created a table in sqlite.Upto my knowledge a column which is declared as primary key will not accept null and even if I don't give any value to that field an error occurs that violating the constraint For Example Create table emp(empno integer PRIMARY KEY,...,...) . Even if I give u a NULL as a value to the field that is declared as primary key .it is accepting . Even if I Don't give any value to the field that is declared as primary key it is auto incrementing. Instead of showing the error constraint violated it is auto increment that field value(I did not specify the column to auto increment). Regards, Satish.G ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] SQLite file security
Hi! I am basically a windows application developer. I am developing an application for desktop which uses a database. I choose SQLite as my database and my issue is if any one finds my application is using SQLite database they can corrupt my database or they can see the contents of my database using a program(they can open my SQLite file). Now my question is how I can provide security to my database for example no one can access my database except my application .how can I provide security Plz provide me best solution to provide security to my database without any Data loss. Regards, Satish.G ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Setbusytimeout(int nMillisec)
Hi Can anyone tell me what setbusytimout function will do.if it locks database its not happening.i had opened the same database with two objects before opening the database with second object I set setime out value to 2000msec even though database is opened using the second object Regards, Satish.G ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] (no subject)
Hi! Can I get some samples to work on sqlite that is how to create a database and inserting ... don' t think again I am joking plz help me.it was bit confusing when iam using sqlite command prompt Regards, Satish -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of P Kishor Sent: Friday, November 14, 2008 11:35 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] (no subject) On 11/13/08, Satish <[EMAIL PROTECTED]> wrote: > Hi! > > Really I am Serious about this I am very new to database and I want > to use sqllite.so I want to know.THE Reason why asked this question is I > have seen a video of google tech bytes in that the presenter said that > sqllite doesn't support foreign key and alter table.is this True.i want to > know based on this I can proceed further. If you are serious, start with reading the documentation on sqlite.org. Check out the list of FAQs, the features, datatypes, syntax, etc. Do some background work more than just watching a video of "google tech bytes" whatever that is. Then post a well formed question on the list, with a clear subject line, and you will be promptly helped. Until then you will likely get a response equivalent to "Wtf, is this a joke? :/" > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Cory Nelson > Sent: Friday, November 14, 2008 11:22 AM > To: General Discussion of SQLite Database > Subject: Re: [sqlite] (no subject) > > On Thu, Nov 13, 2008 at 9:31 PM, Satish <[EMAIL PROTECTED]> wrote: > > Hi! > > > >Will sqllite support Foreign Key and ALTER Table Comands .I want to > know > > is there any documentation that helps me to know what are the classes that > I > > can use and program.I use vc++ to connect to database.tell me if there any > > wrapper classes which I can use and also provide me documentation about > > those clases and functions present in it and how to use them. > > > > Wtf, is this a joke? :/ > > -- > Cory Nelson ___ 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
Re: [sqlite] (no subject)
Hi! Really I am Serious about this I am very new to database and I want to use sqllite.so I want to know.THE Reason why asked this question is I have seen a video of google tech bytes in that the presenter said that sqllite doesn't support foreign key and alter table.is this True.i want to know based on this I can proceed further. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cory Nelson Sent: Friday, November 14, 2008 11:22 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] (no subject) On Thu, Nov 13, 2008 at 9:31 PM, Satish <[EMAIL PROTECTED]> wrote: > Hi! > >Will sqllite support Foreign Key and ALTER Table Comands .I want to know > is there any documentation that helps me to know what are the classes that I > can use and program.I use vc++ to connect to database.tell me if there any > wrapper classes which I can use and also provide me documentation about > those clases and functions present in it and how to use them. > Wtf, is this a joke? :/ -- Cory Nelson ___ 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] (no subject)
Hi! Will sqllite support Foreign Key and ALTER Table Comands .I want to know is there any documentation that helps me to know what are the classes that I can use and program.I use vc++ to connect to database.tell me if there any wrapper classes which I can use and also provide me documentation about those clases and functions present in it and how to use them. Regards, G.SATISH ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Mailing Request
[EMAIL PROTECTED] Regards, G.Satish ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users