[sqlite] What is a Relation?
Just to kill time over coffee - what do you take the word to mean? I've just been reading a 1991 James Martin book on Object Orientation and he was using it to talk about links between entities. Chris Date was very specific that a relation was essentially a table. Mainly however, people seem to use the word to describe the connections you can make by performing joins between tables. What do you think is 'correct'? How did the other meaning gain currency? I see James Martin owns an island in Bermuda and has been handing out millions all over the place - a good incentive to start writing those books you've been thinking about. -- View this message in context: http://www.nabble.com/What-is-a-Relation--tp24674278p24674278.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] a system for arbitrarily tagging rows in a table
On Sun, Jul 26, 2009 at 9:23 PM, Jay A. Kreibich wrote: > On Sat, Jul 25, 2009 at 09:26:16AM -0700, Jim Showalter scratched on the wall: >> You can have the tags in a separate table that has a foreign-key to >> the table with the rows in in you want to tag, > > That's essentially what the OP is doing, except they've built a > many-to-many relationship using a bridge table, rather than a > one-to-many using a simple foreign key. This allows any tag to be > associated with any row without duplicating any of the tags, allowing > for better data normalization. Indeed. My query is working quite well for now. I do realize that it will not be efficient for very large datasets, but it is quite good for my needs. > >> If you need to search for >> multiple tags at a time, each requires a join: > > Right, and that's the problem. If you've got an application that > allows you to search for tags with an arbitrary number of tags, you > need a different query for each situation (one tag, two tags, etc.). > Also, adding two more JOINs (since you need to join through the > bridge table) for each additional search target means your performance > degrades very quickly when you've got four or five search tags. > > This is why I suggested looking at Relational division. Even if SQL > doesn't support it directly, there are other ways of doing it to make > the query more generic. With division, you can do something like (in the > terms of the OP's post): > > (foo JOIN foo_tag JOIN tag) / (search_tags) = foo with search_tags > > This basically builds a table of all foo:tag combinations and then > divides out our search tags, resulting in a list of foo.f_id values > that have an association with all of the tags found in search_tags. > You can then JOIN the results of this expression back to the tags. I gave relational division a gander. The text was a bit thick so my eyes started glazing after a while, but it piqued my curiosity sufficiently that I am going to go back to it and try and understand it better. > The OP asked to have the search tags removed from the results, which > is also a bit of a trick to do in a generic way. Yes, this is a "view" problem that is fairly easily solved in the application layer. Essentially, one wants to see all the tags for the result returned for a given tag... for example, for a given nationality, "US," show me all the ethnicities, but, since I already know that all the rows in the result are for nationality = "US," there is no point in displaying "US" along with the rows. Much easier to do this in the application logic. > > Anyways... The relational division makes any query search -- from > 1 to 1000 tags -- have the same structure. As long as the division > performance is good, the query performance shouldn't horribly > degrade as you add more search tags. > >> select t >> from tagged as t >> join t.tags as tag1 >> join t.tags as tag2 >> where tag1 = some value >> and tag2 = some value. > > This points in the direction of a one-to-many structure, only the > syntax is not making sense to me. JOINs work on tables, not columns, > and WHERE expressions work on columns, not tables. > > You're also only doing the first half of the problem, since you need > to join this back to the tags to get the result the OP was looking for > (including pulling back out the search targets). It's a trickier > problem than it first looks, especially if you want to do it in one > SQL statement with a minimal number of sub-SELECTs. > > -j > >> - Original Message - >> From: "Jay A. Kreibich" >> To: ; "General Discussion of SQLite Database" >> >> Sent: Friday, July 24, 2009 9:21 PM >> Subject: Re: [sqlite] a system for arbitrarily tagging rows in a table >> >> >> > On Fri, Jul 24, 2009 at 09:20:29PM -0500, P Kishor scratched on the >> > wall: >> >> I am trying to develop a "tagging" system, whereby each row in a >> >> table >> >> can be tagged with arbitrary number of tags. >> > >> > This smells of a Relational division problem. If you're dealing >> > with >> > tags you might want to have a look at that (Celko has a few good >> > articles on it). Since SQL lacks a native Relational division >> > operator, chances are a solution in that direction is going to be >> > more complex -- at least for this problem. But any time I've done >> > tags or attributes, sooner or later I find myself needing to do a >> > division. They come in handy any time you say "my data is vertical >> > but I need it horizontal." You might want to read up on them just >> > to >> > have that knowledge available. >> > >> > >> >> TABLE foo (f_id INTEGER PRIMARY KEY, f_name TEXT); >> >> TABLE tag (t_id INTEGER PRIMARY KEY, t_name TEXT); >> >> TABLE foo_tag (f_id INTEGER, t_id INTEGER); >> > >> > >> >> I have the following solution. Could I do better or differently? >> > >> > I'm not sure about "better", but here's different: >> > >> > sqlite> SELECT foo.f_name, tag.t_name >>
Re: [sqlite] Little Help on SQL
On 27/07/2009 12:16 PM, Rick Ratchford wrote: > It's a seasonal map, so every year must overlay onto a 366 day grid. > > The table that contains the data has assigned each day a day number from 1 > to 366. If the year isn't a leap year, then day 60 will simply not be > registered for that year. Fair enough ... it's just that that's not what first comes to mind upon reading "Day Numbers (1 to 366)" Cheers, John ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] a system for arbitrarily tagging rows in a table
On Sat, Jul 25, 2009 at 09:26:16AM -0700, Jim Showalter scratched on the wall: > You can have the tags in a separate table that has a foreign-key to > the table with the rows in in you want to tag, That's essentially what the OP is doing, except they've built a many-to-many relationship using a bridge table, rather than a one-to-many using a simple foreign key. This allows any tag to be associated with any row without duplicating any of the tags, allowing for better data normalization. > If you need to search for > multiple tags at a time, each requires a join: Right, and that's the problem. If you've got an application that allows you to search for tags with an arbitrary number of tags, you need a different query for each situation (one tag, two tags, etc.). Also, adding two more JOINs (since you need to join through the bridge table) for each additional search target means your performance degrades very quickly when you've got four or five search tags. This is why I suggested looking at Relational division. Even if SQL doesn't support it directly, there are other ways of doing it to make the query more generic. With division, you can do something like (in the terms of the OP's post): (foo JOIN foo_tag JOIN tag) / (search_tags) = foo with search_tags This basically builds a table of all foo:tag combinations and then divides out our search tags, resulting in a list of foo.f_id values that have an association with all of the tags found in search_tags. You can then JOIN the results of this expression back to the tags. The OP asked to have the search tags removed from the results, which is also a bit of a trick to do in a generic way. Anyways... The relational division makes any query search -- from 1 to 1000 tags -- have the same structure. As long as the division performance is good, the query performance shouldn't horribly degrade as you add more search tags. > select t > from tagged as t > join t.tags as tag1 > join t.tags as tag2 > where tag1 = some value > and tag2 = some value. This points in the direction of a one-to-many structure, only the syntax is not making sense to me. JOINs work on tables, not columns, and WHERE expressions work on columns, not tables. You're also only doing the first half of the problem, since you need to join this back to the tags to get the result the OP was looking for (including pulling back out the search targets). It's a trickier problem than it first looks, especially if you want to do it in one SQL statement with a minimal number of sub-SELECTs. -j > - Original Message - > From: "Jay A. Kreibich" > To: ; "General Discussion of SQLite Database" > > Sent: Friday, July 24, 2009 9:21 PM > Subject: Re: [sqlite] a system for arbitrarily tagging rows in a table > > > > On Fri, Jul 24, 2009 at 09:20:29PM -0500, P Kishor scratched on the > > wall: > >> I am trying to develop a "tagging" system, whereby each row in a > >> table > >> can be tagged with arbitrary number of tags. > > > > This smells of a Relational division problem. If you're dealing > > with > > tags you might want to have a look at that (Celko has a few good > > articles on it). Since SQL lacks a native Relational division > > operator, chances are a solution in that direction is going to be > > more complex -- at least for this problem. But any time I've done > > tags or attributes, sooner or later I find myself needing to do a > > division. They come in handy any time you say "my data is vertical > > but I need it horizontal." You might want to read up on them just > > to > > have that knowledge available. > > > > > >> TABLE foo (f_id INTEGER PRIMARY KEY, f_name TEXT); > >> TABLE tag (t_id INTEGER PRIMARY KEY, t_name TEXT); > >> TABLE foo_tag (f_id INTEGER, t_id INTEGER); > > > > > >> I have the following solution. Could I do better or differently? > > > > I'm not sure about "better", but here's different: > > > > sqlite> SELECT foo.f_name, tag.t_name > > ...> FROM tag AS target > > ...> NATURAL JOIN foo_tag AS target_ft > > ...> NATURAL JOIN foo > > ...> NATURAL JOIN foo_tag > > ...> NATURAL JOIN tag > > ...> WHERE target.t_name = 'bar' > > ...> AND tag.t_id != target.t_id > > ...> ORDER BY foo.f_name, tag.t_name; > > > > This basically folds your IN sub-select back into the main query. > > We join "foo" to the tag table in two directions... one to find > > the search target tag id and the other to produce the output. > > > > "tag AS target" with the first WHERE clause should return one row. > > We join that through "foo_tag AS target_ft" to get a list of foo > > ids > > that have the search target tag. We then build the normal output > > list by joining that back through the foo_tag bridge table to the > > tags, and throw out any rows with an output tag id that matches the > > search target tag id. > > > > Simple! > > > > Best of all, the tar
Re: [sqlite] Little Help on SQL
It's a seasonal map, so every year must overlay onto a 366 day grid. The table that contains the data has assigned each day a day number from 1 to 366. If the year isn't a leap year, then day 60 will simply not be registered for that year. Not only will day 60 not appear except every 4 years, but other days will not appear year to year because they fall on a weekend. The data does not cover weekends. Therefore, although the grid (table) may contain 10 years of data, for example, this does not mean that you will have 10 day 1's, 2's, 3's, etc. There will be different counts for each day number from this 10 year sample. So what I was looking to do (and have successfully done so) is to get a count of each DOY (day of year) in the sampling. This allows for calculations that need to know how many actual particular DOY there is rather than how many years there is. :-) Rick #>-Original Message- #>From: sqlite-users-boun...@sqlite.org #>[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of John Machin #>Sent: Sunday, July 26, 2009 8:43 PM #>To: General Discussion of SQLite Database #>Subject: Re: [sqlite] Little Help on SQL #> #>On 27/07/2009 7:40 AM, Rick Ratchford wrote: #> #>> I have a TABLE with a column of Day Numbers (1 to 366) #>called DayNum. #> #>> Let's say that you want get a count of each DayNum. #> #>> How do I word my statement so that it gives me a count of #>each DayNum, #>> which is from 1 to 366? #> #>Consider leap years ... day number 60 means February 29 in a #>leap year and March 01 in other years. The last day of the #>year is day 366 in a leap year and day 365 in other years. #>Comparing day numbers that relate to different years seems #>not very meaningful. Grouping by day numbers that relate to #>different years seems likewise not very meaningful (for day #>numbers greater than 59). #> #>What are you trying to achieve? #> #> #>___ #>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] Little Help on SQL
On 27/07/2009 7:40 AM, Rick Ratchford wrote: > I have a TABLE with a column of Day Numbers (1 to 366) called DayNum. > Let's say that you want get a count of each DayNum. > How do I word my statement so that it gives me a count of each DayNum, which > is from 1 to 366? Consider leap years ... day number 60 means February 29 in a leap year and March 01 in other years. The last day of the year is day 366 in a leap year and day 365 in other years. Comparing day numbers that relate to different years seems not very meaningful. Grouping by day numbers that relate to different years seems likewise not very meaningful (for day numbers greater than 59). What are you trying to achieve? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Little Help on SQL
Seems my answer was a simple one after all. I only needed to be aware of GROUP BY. Found it though. GROUP BY DayNum. Works. :-) Rick #>-Original Message- #>From: sqlite-users-boun...@sqlite.org #>[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Rick Ratchford #>Sent: Sunday, July 26, 2009 4:40 PM #>To: 'General Discussion of SQLite Database' #>Subject: [sqlite] Little Help on SQL #> #>Hello. #> #>I'm not yet there in my study of SQL with Rick's book, so I #>thought someone might help me with an SQL query I need pretty quick. #> #>I have a TABLE with a column of Day Numbers (1 to 366) called DayNum. #> #>I already have my SQL to where it will extract a number of #>complete years from January to December. #> #>Let's say that you want get a count of each DayNum. #> #>For example, say the SQL is setup to grab 5 complete years of #>data. Since there are no weekends included, this means that #>you are not necessarily going to get: #> #>DayNum(1) 5 total #>DayNum(2) 5 total #>DayNum(3) 5 total #> #>etc. #> #>Rather, if any particular day falls on a weekend, it won't be #>in the dataset, so you may have: #> #>DayNum(1) 5 total #>DayNum(2) 4 total #>DayNum(3) 4 total #>DayNum(4) 3 total #> #>etc. #> #>How do I word my statement so that it gives me a count of #>each DayNum, which is from 1 to 366? #> #>Thanks. #> #>Rick #> #> #> #> #>___ #>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] Little Help on SQL
Hello. I'm not yet there in my study of SQL with Rick's book, so I thought someone might help me with an SQL query I need pretty quick. I have a TABLE with a column of Day Numbers (1 to 366) called DayNum. I already have my SQL to where it will extract a number of complete years from January to December. Let's say that you want get a count of each DayNum. For example, say the SQL is setup to grab 5 complete years of data. Since there are no weekends included, this means that you are not necessarily going to get: DayNum(1) 5 total DayNum(2) 5 total DayNum(3) 5 total etc. Rather, if any particular day falls on a weekend, it won't be in the dataset, so you may have: DayNum(1) 5 total DayNum(2) 4 total DayNum(3) 4 total DayNum(4) 3 total etc. How do I word my statement so that it gives me a count of each DayNum, which is from 1 to 366? Thanks. Rick ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] .lib file?
Thank A.J. Milan! Forcing VS2008 to compile the amalgamation as C (as opposed to the default C++) took care of everything. I also had the comment-out the #include sqlite3.h header file, and let it use all the 'built-in' stuff (else you get an undefined for the _sqlite3_version extern!) Works fine now too. Great forum! > -Original Message- > From: sqlite-users-boun...@sqlite.org > [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of A.J.Millan > Sent: Sunday, July 26, 2009 12:19 PM > To: sqlite-users@sqlite.org > Subject: [sqlite] .lib file? > > Basides the mentioned option of build a .lib file and link it statically > against your code, or a dinamic library, there are the option of include the > sqlite3.c file in your code without so many problems with the casting of > pointers -and some others-. > > If you are using a C++ project in MS Visual Studio, the sqlite3.c file must > be compiled as "C". > > See in: File-Properties > C/C++ > Advanced > Compile As > > Select "Compile as C Code (/TC)" > > The rest of the project can remain compiled as usual C/C++ files. > > Probably you must disable the use of precompiled headers also. > > HTH. > > A.J.Millan > > > > -Original Message- > > From: Paul Claessen paul at claessen.com > > Sat Jul 25 15:48:37 GMT 2009 > > To: paul at claessen.com; General Discussion of SQLite Database > > Subject: Re: [sqlite] .lib file? > >> Two points though: > > > 1. The amalgated sources were, apparently, not written with MS Visual > > Study in mind, since compiling it results in over 100 errors > > (mostly invalid pointer conversions) > > 2. If I have a number of apps, it would really be more efficient to use > > the DLL. > > > I'm sure I can fix all the pointer casts (shouldn't be necessary if the > > code used more consistent types!), but that would take me a > > lot of time, plus, there should be a way to simply use the .dll: since > > there IS a windows console app, there must be either a .lib > > file somewhere, or there is an alternative way of using DLL's from a > > windows console app, that I'm not aware of. > > ___ > 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] .lib file?
The library created by MinGW's dlltool will be a static archive in ar(1) format. The contained object files might be compatible between ld(1) and Microsoft's linker - I honestly don't know, since I use Qt on the gcc (*nix) and MinGW (Windows) toolchains and have limited experience with recent Microsoft C++ compilers. If they're compatible, then all the better, but I suspect compatibility will be one way only, i.e. with MinGW's linker accepting objects produced by the Microsoft toolchain and not the other way around. HTH. Mihai Limbasan On 07/26/2009 12:46 AM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Paul Claessen wrote: > >> Actually, I was able to generate a .lib file from the DLL using Doug's >> suggesting (link /lib /def:sqlite3.def). >> Works fine now! >> > > MinGW comes with a tool named 'pexports.exe' that can generate the def > file directly from any dll so you don't have to rely on a hand > maintained def file. It also has dlltool which can take that def file > and generate a lib but I don't know if it is a generic lib file or in > MinGW format. > > Roger > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.9 (GNU/Linux) > > iEYEARECAAYFAkprfSAACgkQmOOfHg372QRjkgCeJVX6cpXGQrEC1yvk94q98Evm > D+gAoJ9j3AzwbS2YKzQGcdjPAHUuEBVd > =fCCI > -END PGP SIGNATURE- > ___ > 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] .lib file?
Basides the mentioned option of build a .lib file and link it statically against your code, or a dinamic library, there are the option of include the sqlite3.c file in your code without so many problems with the casting of pointers -and some others-. If you are using a C++ project in MS Visual Studio, the sqlite3.c file must be compiled as "C". See in: File-Properties > C/C++ > Advanced > Compile As Select "Compile as C Code (/TC)" The rest of the project can remain compiled as usual C/C++ files. Probably you must disable the use of precompiled headers also. HTH. A.J.Millan > -Original Message- > From: Paul Claessen paul at claessen.com > Sat Jul 25 15:48:37 GMT 2009 > To: paul at claessen.com; General Discussion of SQLite Database > Subject: Re: [sqlite] .lib file? >> Two points though: > 1. The amalgated sources were, apparently, not written with MS Visual > Study in mind, since compiling it results in over 100 errors > (mostly invalid pointer conversions) > 2. If I have a number of apps, it would really be more efficient to use > the DLL. > I'm sure I can fix all the pointer casts (shouldn't be necessary if the > code used more consistent types!), but that would take me a > lot of time, plus, there should be a way to simply use the .dll: since > there IS a windows console app, there must be either a .lib > file somewhere, or there is an alternative way of using DLL's from a > windows console app, that I'm not aware of. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How to get the actual user-name and password?
Simon: Thanks for your's input. Really it is there, in the last line. I has been blind. A.J. Millan On 26 Jul 2009, at 12:47pm, a...@zator.com wrote: > I can't find the way to accesso to the list and get the forgotten > password. Click on the link at the bottom of every post. Simon. ___ 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] util.c compilation error in SQLite book
Hi, I got the book, "The definitive guide to SQLite". Wondering if anyone has same issue or know the answer. Following is the error when compiling the example CAPI example code [tjy...@ibm examples]$ ls capi commonfoods.sql perlruby tcl capi_ext foods.db java python sql.sql [tjy...@ibm examples]$ [tjy...@ibm capi]$ gmake gcc -c -D_REENTRANT -fPIC -pthread -W -Wall -g -D DEBUG util.c util.c: In function âexecuteâ: util.c:9: warning: passing argument 5 of âsqlite3_execâ from incompatible pointer type util.c:14: warning: passing argument 1 of âsqlite3_freeâ discards qualifiers from pointer target type util.c: In function âprint_errorâ: util.c:27: error: âsâ undeclared (first use in this function) util.c:27: error: (Each undeclared identifier is reported only once util.c:27: error: for each function it appears in.) util.c:32: warning: passing argument 1 of âsqlite3_freeâ discards qualifiers from pointer target type util.c:27: warning: second parameter of âva_startâ not last named argument util.c: In function âprint_sql_resultâ: util.c:43: warning: unused variable âstmtâ util.c:42: warning: unused variable âtailâ util.c:41: warning: unused variable ârcâ util.c:80: warning: control reaches end of non-void function util.c: At top level: util.c:195: warning: unused parameter âdataâ gmake: *** [util.o] Error 1 [tjy...@ibm capi]$ Tracing the C code and found va_start using "s" undeclared. >if(msg) { >va_list ap; >va_start(ap,s); [tjy...@ibm capi]$ ls authorizer.c capi.suoDebugMakefile test.c authorizer.ilk columns.c ex1.cmprintf.c test.db authorizer.vcproj columns.ilk exec_busy.c parameters.c util.c auth_trans columns.vcproj exec.c parameters.ilk util.h auth_trans.c create.cexec.ilk parameters.vcproj capi.cpp create.ilk exec.vcproj select.c capi.ncb create.oget_table.c select.ilk capi.sln create.vcproj main.c select.vcproj [tjy...@ibm capi]$ T.J. Yang _ Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics. Check it out. http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How to get the actual user-name and password?
On 26 Jul 2009, at 12:47pm, a...@zator.com wrote: > I can't find the way to accesso to the list and get the forgotten > password. Click on the link at the bottom of every post. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] How to get the actual user-name and password?
I can't find the way to accesso to the list and get the forgotten password. Thanks. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Use VDBE in extension
Hey there, I am trying to access the VDBE directly from within a loadable extension. Compiling works, but loading the extension fails with > undefined symbol: sqlite3VdbeCreate My includes look like this: > #include "sqlite3ext.h" > #include "sqliteInt.h" > #include "vdbe.h" Code: > Vdbe *v = sqlite3VdbeCreate(pParse->db); How can I make it work? -bear ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] sqlite db2 error in symbian
i am writing this query to insert data in symbian but i am getting err1=-311 and sqldb2 error in symbia { TInt err1 =stmt.Prepare(db,_L("INSERT INTO MyContacts(ServerContactID,UserName,FirstName,LastName,Country,IsBlocked,RequestStatus,MarkForDeletion) VALUES(:ServerContactID,:UserName,:FirstName,:LastName,:Country,:IsBlocked,:RequestStatus,:MarkForDeletion)")); //,:TimeStamp,:MobileNumber,:OfficePh,:Address1,:Address2,:Email,:HomePh error.AppendNum(err1); iChitDemoAppUi->Log(_L8("error code ")); iChitDemoAppUi->Log(error); TInt paramIndex1 = stmt.ParameterIndex(_L(":ServerContactID")); TInt paramIndex2 = stmt.ParameterIndex(_L(":UserName")); TInt paramIndex3 = stmt.ParameterIndex(_L(":FirstName")); TInt paramIndex4 = stmt.ParameterIndex(_L(":LastName")); TInt paramIndex5 = stmt.ParameterIndex(_L(":Country")); TInt paramIndex6 = stmt.ParameterIndex(_L(":IsBlocked")); TInt paramIndex7 = stmt.ParameterIndex(_L(":RequestStatus")); TInt paramIndex8 = stmt.ParameterIndex(_L(":MarkForDeletion")); err1= stmt.BindInt(paramIndex1,userID); error.AppendNum(err1); iChitDemoAppUi->Log(_L8("error code ")); iChitDemoAppUi->Log(error); iChitDemoAppUi->Log(_L8("inside addContacts ")); err1 = stream.BindText(stmt, paramIndex2); temp.Append(username); stream.WriteL(temp); temp.Zero(); stream.Close(); err1 = stream.BindText(stmt, paramIndex3); temp.Append(firstName); stream.WriteL(temp); temp.Zero(); stream.Close(); err1 = stream.BindText(stmt, paramIndex4); temp.Append(LastName); stream.WriteL(temp); temp.Zero(); stream.Close(); err1 = stream.BindText(stmt, paramIndex5); temp.Append(CountryName); stream.WriteL(temp); temp.Zero(); stream.Close(); err1= stmt.BindInt(paramIndex6, isBlocked); err1 = stream.BindText(stmt, paramIndex7); temp.Append(requestStatus); stream.WriteL(temp); temp.Zero(); stream.Close(); err1= stmt.BindInt(paramIndex8,markForDeletion); //TimeStamp,MobileNumber,OfficePh,Address1,Address2,Email,HomePh err1 = stmt.Exec(); stream.Close(); stmt.Reset(); } ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users