Re: [sqlite] problem in deleting
hi , I like to say it properly, i am deleting ,it does delete. but i am trying to delete again, no error code is returned, Narendran -- View this message in context: http://www.nabble.com/problem-in-deleting-tf2428522.html#a6771299 Sent from the SQLite mailing list archive at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] problem in deleting
hi , i got a confusion in deleting a entry, sqlite> create table hai (key text primary key,value text) ; sqlite> create table hai (key text primary key,value text) ; SQL error: table hai already exists sqlite> insert into hai (key,value) values ('hai1','value1'); sqlite> insert into hai (key,value) values ('hai1','value1'); SQL error: column key is not unique sqlite> delete from hai where key = 'hai1'; sqlite> delete from hai where key = 'hai1'; sqlite> delete from hai where key = 'hai1'; sqlite> delete from hai where key = 'hai1'; sqlite> delete from hai where key = 'hai1'; sqlite> delete from hai where key = 'hai1'; sqlite> delete from hai where key = 'hai1'; sqlite> insert into hai (key,value) values ('hai1','value1'); sqlite> insert into hai (key,value) values ('hai1','value1'); SQL error: column key is not unique sqlite> delete from hai where key = 'hai1'; sqlite> delete from hai where key = 'hai1'; sqlite> delete from hai where key = hai1; SQL error: no such column: hai1 sqlite> delete from hai where key = hai1; SQL error: no such column: hai1 sqlite> delete from hai where key = hai1; SQL error: no such column: hai1 sqlite> delete from hai where key = 'hai1'; sqlite> delete from hai where key = 'hai1'; sqlite> i think ,it should delete the record,it doesn't delete,with api's or thro shell. please do tell me what am i doing wrong Thanks & Regards Narendran B -- View this message in context: http://www.nabble.com/problem-in-deleting-tf2428522.html#a6771178 Sent from the SQLite mailing list archive at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Wish to store a C structure in sqlite column
thanks a lot, I believe i can store a structure now, but there is still a cache . I am in the process on creating a Independant API,I can store a structure in SQLite thro the above specified ways. what if some one else wants to use my API's which i used to create the DBI's ,and the destination Database engine doesn't support the blob datatypes. My question may be silly, but this is a serious issues for me. I am unable to resolve the problem for 3 days,hat's off to everyone. Thanking you , B.Narendran -- View this message in context: http://www.nabble.com/Wish-to-store-a-C-structure-in-sqlite-column-tf2312254.html#a6443235 Sent from the SQLite mailing list archive at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] Wish to store a C structure in sqlite column
Noel Frankinet wrote: > > Narendran a écrit : >> Dear Friends, >> >> >> I am in the process of forming a Generic API,(sql oriented and >> BerkelyDB >> and sister databases). In the process of integration ,i like to store a >> Structure in Sqlite. >> >> as far as my knowledge SQLITE allows me to declare the column types >> suppoted by the programming languare or say i am using blob . My >> requirement >> is i wish to store a structure in the SQLite column. >> >> I am unable to form a sql statement to store the structure ,i am also >> not >> clear with whether i can have a strucure as column type. >> >> suggestions will be really helpful. >> >> Thanking you, >> B.Narendran >> > You will need to turn your c struct into a blob and store that blob. > When retrieving the blob, you need a way to turn it back into your struct. > Its releatively easy if your struct does not contains pointers. > > Best wishes > > -- > Noël Frankinet > Gistek Software SA > http://www.gistek.net > > > - > To unsubscribe, send email to [EMAIL PROTECTED] > - > > > Dear Frankinet, Thanks for ur reply, I am unable to understand what u have said. I am having a structure and I am converting in to a blob. This means i am supposed to remove the '\0' in between the strucure and put a final '\0' (NULL) character . Blob need only on e null character to terminate it. I tried to memcopy the structure elements and store them ,I can store but i am unable to find a way to retrieve it back. typedef struct ethernetcard1 { char port[10]; char ipaddress[20]; char mask[20]; int bandwidth; } what i tried is char *buffer; int bufferlen;buffersize; bufferlen = strlen(port)+strlen(ipaddress)+strlen(mask)+sizeof(int)+1; memcpy(buffer,user.port,strlen(user.port); buffersize = strlen(user.port); memcpy(buffer,user.ipaddress,strlen(user.ipaddress)); buffersize += strlen(user.ipaddress); and finally i included a NULL character to the buffer to make it as string and i can insert in to a text field in sqlite column . I am unable to figure out a way to retrieve it back if i am storing in this way or a blob type I think blob will be similar to this . expecting ur valuable suggestion. Thanking you, Narendran -- View this message in context: http://www.nabble.com/Wish-to-store-a-C-structure-in-sqlite-column-tf2312254.html#a6441692 Sent from the SQLite mailing list archive at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] Wish to store a C structure in sqlite column
Dear Friends, I am in the process of forming a Generic API,(sql oriented and BerkelyDB and sister databases). In the process of integration ,i like to store a Structure in Sqlite. as far as my knowledge SQLITE allows me to declare the column types suppoted by the programming languare or say i am using blob . My requirement is i wish to store a structure in the SQLite column. I am unable to form a sql statement to store the structure ,i am also not clear with whether i can have a strucure as column type. suggestions will be really helpful. Thanking you, B.Narendran -- View this message in context: http://www.nabble.com/Wish-to-store-a-C-structure-in-sqlite-column-tf2312254.html#a6429089 Sent from the SQLite mailing list archive at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] need to form an frame work for database independent API
check the library file location and when compiling give the path name as gcc -I/usr/local/include and -L/usr/local/lib just like the above find the location of the include and library file make sure u installed properly . Thanking you B.Narendran -- View this message in context: http://www.nabble.com/need-to-form-an-frame-work-for-database-independent-API-tf2126447.html#a6074818 Sent from the SQLite forum at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] need to form an frame work for database independent API
I wish to form an database independant API for sqlite and BerkeleyDB . I need to now wht factors should consider . i am new to both . I have problems in running an simple program in sqlite . its say can't find the sqlite3_open( . If i paste the source code for that funstion ,it say that some other is so there . please help to resolve this problem . I am really struck thanks in advance . B. Narendran( Indian) -- View this message in context: http://www.nabble.com/need-to-form-an-frame-work-for-database-independent-API-tf2126447.html#a5867191 Sent from the SQLite forum at Nabble.com. - To unsubscribe, send email to [EMAIL PROTECTED] -