Re: [sqlite] LIKE IN

2019-11-22 Thread Simon Davies
Hi, On Fri, 22 Nov 2019 at 13:18, Hamish Allan wrote: > > Hi, > > Is it possible to achieve the effect of combining the LIKE and IN operators? > > So for instance if I have tables: > > CREATE TABLE names (name TEXT); > INSERT INTO names VALUES ('Alexandra'); > INSERT INTO names VALUES ('Rob'); >

Re: [sqlite] I can insert multiple rows with the same primary key when one of the value of the PK is NULL ...

2019-07-20 Thread Simon Davies
Hi Alex, On Thu, 18 Jul 2019 at 17:02, Alexandre Billon wrote: > > Hello, > > I have created a table. > > CREATE TABLE "sales" ( > "client"TEXT, > "salesman" TEXT, > "revenue" REAL, > PRIMARY

Re: [sqlite] Returning NULL or empty values when the SELECT does not satisfy all of the query

2019-04-05 Thread Simon Davies
On Fri, 5 Apr 2019 at 14:45, Jose Isaias Cabrera wrote: > > Greetings. > > I have a few tables that I am bringing data from, but I found a bug in my > logic, which I am trying to see if I can make it work. Please look at this > scenario > > create table t (n INTEGER PRIMARY KEY, a, b, c, d, e,

Re: [sqlite] INSERTing from another table data

2019-03-19 Thread Simon Davies
On Tue, 19 Mar 2019 at 15:07, Tim Streater wrote: > > My use case is a mixture of these. My need is to copy a row from a table in > one db (db1) to a table with identical schema in another db (db2). The > complication is that there is an id column, so the row needs to get a new id > in db2. >

Re: [sqlite] SQLite3 with C

2018-08-15 Thread Simon Davies
Hi Ricardo, On 15 August 2018 at 06:26, Ricardo Lima wrote: > I built a straightforward program in C. It's just a STACK structure (first > in, last out) that takes input from the user and stores it into the stack. > After I close the program, all the data vanishes since I don't have a >

Re: [sqlite] not build with SQLITE_OMIT_VIRTUALTABLE

2018-05-03 Thread Simon Davies
On 3 May 2018 at 14:07, Michele Dionisio wrote: > Hi all, > > last sqlite 3230100 does not build with -DSQLITE_OMIT_VIRTUALTABLE and the > error is: > > | sqlite3-sqlite3.o: In function `sqlite3RunParser': > | sqlite3.c:(.text+0x6e644): undefined reference to

Re: [sqlite] Sqlite query to get the offset of an entry in the list.

2018-04-27 Thread Simon Davies
On 27 April 2018 at 15:51, Hegde, Deepakakumar (D.) wrote: > Hi All, > > We have a requirement where in offset of the primary key ID is needed as per > the sorted list. . . . > 1 AAA > 3 BBB > 5 CCC > 4 WWW > 2 ZZZ > > So position of ID 3 as per the sorted

Re: [sqlite] SQL Syntax fault on UPDATE statement

2016-08-17 Thread Simon Davies
On 17 August 2016 at 09:39, R Smith wrote: > > > On 2016/08/17 9:05 AM, flo wrote: >> >> Hi everyone, . . . > Well, it is perfectly valid to give boolean operations as an expression. > If I said " id = 3 AND 6 then the resulting value would be 2 (If you are > unsure why that

Re: [sqlite] Regarding redirecting SQL results and errors to a single output file.

2016-06-27 Thread Simon Davies
On 27 June 2016 at 10:28, Kaja Varunkumar wrote: > Hello, > > sqlite -echo test.sqlite < test44.sql > test44.out. > When I am running above command in windows command prompt, succeed query > redirected to test44.out and errors are displayed on the command prompt. > Here

[sqlite] help with query

2016-04-06 Thread Simon Davies
On 6 April 2016 at 12:22, e-mail mgbg25171 wrote: > Here are my tables specified as... tbl_nm | col1, col2... > std_nms | id, nm > raw_nms | id, nm > nm_pairs | id, std_nms_id, raw_nms_id > > I'm wondering how to supply a single std_nms.nm and get back a list of pairs > i.e. std_nm.nm,

[sqlite] sqlite error 25 during bind

2016-04-06 Thread Simon Davies
On 6 April 2016 at 12:16, Kumar Suraj wrote: > Hi . . . > Here is table definition and insert statement which is causing this > > #define CREATE_TABLE_DNINDEX "CREATE TABLE IF NOT EXISTS TBL (dn BLOB, > pclassid INTEGER, pkey INTEGER, kindex INTEGER PRIMARY KEY ASC)" > > #define INSERT_DN

[sqlite] Can't understand why I need this cast

2016-02-18 Thread Simon Davies
On 18 February 2016 at 15:29, Richard Hipp wrote: > On 2/18/16, Simon Davies wrote: >> > > The documentation says: "An expression of the form "CAST(expr AS > type)" has an affinity thta is the same as a column with a declared > type of "type"

[sqlite] Can't understand why I need this cast

2016-02-18 Thread Simon Davies
On 18 February 2016 at 12:34, Richard Hipp wrote: > On 2/18/16, Simon Davies wrote: >> sqlite> select '11' <= 11; >> 0 >> sqlite> select '11' <= cast(11 as integer); >> 1 >> sqlite> select '11' >= 11; >> 1 > > Sort order in S

[sqlite] Can't understand why I need this cast

2016-02-18 Thread Simon Davies
sqlite> select '11' <= 11; 0 sqlite> select '11' <= cast(11 as integer); 1 sqlite> select '11' >= 11; 1 Certainly seems odd... On 18 February 2016 at 12:20, Rob Willett wrote: > Tim, > > We actually do store the timestamps as epoch seconds, but we wrote a quick > piece of SQL to test something

[sqlite] Setting SQLITE_OMIT_FLOATING_POINT has surprising undocumented consequences

2016-01-15 Thread Simon Davies
On 14 January 2016 at 22:31, Warren Young wrote: > For no especially good reason, I decided to turn off all SQLite features I?m > not using now and which I have no plans to use in the future. > > My current DB doesn?t use any FP columns, so I rebuild SQLite with > SQLITE_OMIT_FLOATING_POINT and

[sqlite] 'order by' doesn't work with 'group_concat()'

2016-01-05 Thread Simon Davies
On 5 January 2016 at 00:14, Yuri wrote: > Please consider this example: . . . > The 'order by' clause doesn't work, because if it did the result would have > been: > 1|x,y > 2|x,y > > sqlite3-3.9.2 > > Yuri See http://www.sqlite.org/lang_aggfunc.html last sentence " group_concat(X)

[sqlite] How do i submit a bug?

2015-10-05 Thread Simon Davies
On 5 October 2015 at 10:48, Jacob wrote: > Hi John, > > I have tried to create an in memory database according to the > documentation on this link > https://www.sqlite.org/inmemorydb.html > > The documentation lists: (C code) > > rc = sqlite3_open("file:memdb1?mode=memory=shared", ); > > It

[sqlite] order by not working in combination with random()

2015-08-18 Thread Simon Davies
On 17 August 2015 at 21:50, Simon Slavin wrote: > > On 17 Aug 2015, at 9:46pm, Jeffrey Mattox wrote: > >> Could the random() be made part of an expression (that doesn't change the >> result) to fool the optimizer into only doing the random() once, like this: >> >> SELECT ( random() *

[sqlite] How to enable shared cache mode?

2015-08-13 Thread Simon Davies
On 13 August 2015 at 19:17, Joe Mistachkin wrote: > > Aaron Hudon wrote: >> >> I've looked through the source, and see there is a method in >> UnsafeNativeMethods.cs that exposes this internally to the >> assembly, but nothing that's public. > > Currently, it's only used by the test suite. In

[sqlite] Could frequent 'database is locked' errors mean SQLite is not a good fit for my application?

2015-07-02 Thread Simon Davies
On 2 July 2015 at 15:09, Kathleen Alexander wrote: > Hi, > > I apologize if this is an incorrect forum for this question, but I am > pretty new to SQLite and have been unable to resolve this issue through > other searches. Feel free to direct me to a more appropriate forum. > > Essentially, I

[sqlite] confusing error msgs

2015-06-12 Thread Simon Davies
On 12 June 2015 at 06:42, Hick Gunter wrote: > You are creating each table in a separate file; a foreign key may only > reference a table in the same file. > > Your type declarations are faulty in that you are omitting an opening > parenthesis in a DECIMAL 4,3) declaration. > > SQLite does not

[sqlite] Regarding testing

2015-04-27 Thread Simon Davies
On 27 April 2015 at 12:54, Sairam Gaddam wrote: > How SQLite is tested and can I get those test cases? 4th entry under "Overview Documents" on http://www.sqlite.org/docs.html

[sqlite] Problems with pragma journal_mode

2015-04-16 Thread Simon Davies
On 16 April 2015 at 10:10, Janke, Julian wrote: > Hi everyone, > > I'm relatively new to SQLite and currently I'm experimenting a little bit > with the SQLite database on an embedded system. > I want to change the journal mode of a database to WAL. So I did the > following: > > rc =

[sqlite] Select query becomes distinct on where matches unique with null value

2015-04-11 Thread Simon Davies
On 11 April 2015 at 07:07, Mike Gladysch wrote: > Hi, . > Data: > 1;1;null;test;null;null > 2;2;null;test;null;null > 3;3;null;test;null;null > 4;4;something;test;null;null > > Select col1, col2, col3, col4, col5, col6 > From table > Where col3 is null and col4 ='test' > > Delivers different

[sqlite] Sqlite3 Bug Found

2015-03-19 Thread Simon Davies
On 6 March 2015 at 08:38, Carabas, Costin wrote: > Hello, > > I was working on version 3.8.8.2 of sqlite3 and I found a bug that is trace > related. It can be reproduced in 3 steps: > > 1. ".t log" - opens log for tracing > > 2. ".t" - no argument. Closes the file descriptor that was

[sqlite] SQLITE_OPEN_EXCLUSIVE

2015-03-15 Thread Simon Davies
On 15 March 2015 at 12:54, Felipe Gasper wrote: > This seems to support the idea that O_EXCL is SQLITE_OPEN_EXCLUSIVE..? "The SQLITE_OPEN_EXCLUSIVE flag is always used in conjunction with the SQLITE_OPEN_CREATE flag, which are both directly analogous to the O_EXCL and O_CREAT flags of the POSIX

[sqlite] SQLITE_OPEN_EXCLUSIVE

2015-03-15 Thread Simon Davies
On 15 March 2015 at 06:06, Felipe Gasper wrote: > Hi all, > > Does the SQLITE_OPEN_EXCLUSIVE flag exist as analogous to O_EXCL in > C open()? i.e., is this how I can say, ?open a database, but only if it?s a > new database?? https://www.sqlite.org/capi3ref.html#sqlite3vfsxopen >

[sqlite] fix rowid's of fts table

2015-03-12 Thread Simon Davies
On 12 March 2015 at 20:20, Rael Bauer wrote: > > Hi, > . . . > Now I have restructured the normal table (i.e. delete column) using the > algorithm mentioned here a couple of times (insert into normal select > (columns) from normal_OLD, etc..) > > This "resets" the rowid's of the normal table.

[sqlite] Multi-table index ersatz?

2015-03-03 Thread Simon Davies
On 3 March 2015 at 11:10, Eric Grange wrote: > > Hi, > > I have problem where I need a "multi-table index" ersatz, or maybe a better > data structure :-) > > The problem is as follow: > >- Table A : some fields plus fields A1 & A2 >- Table B : some fields plus fields B1 & B2 > > Both

[sqlite] outer join/order by bug?

2015-02-24 Thread Simon Davies
On 24 February 2015 at 15:20, Simon Davies wrote: > On 24 February 2015 at 15:02, Grisha Vinevich wrote: >> There seems to be some problem with left outer join in Windows version of >> sqlite3. >> I try to use the following (simplified) schema: >> . . . >>

[sqlite] outer join/order by bug?

2015-02-24 Thread Simon Davies
On 24 February 2015 at 15:02, Grisha Vinevich wrote: > There seems to be some problem with left outer join in Windows version of > sqlite3. > I try to use the following (simplified) schema: > > CREATE TABLE "A" ( "Name" text); > CREATE TABLE "Items" ( "ItemName" text , "Name" text ); > INSERT

Re: [sqlite] Possible to get table size (in bytes)?

2015-02-04 Thread Simon Davies
On 4 February 2015 at 18:26, Rael Bauer wrote: > Hi, > > Is it possible to get the information of how many bytes a table is taking up > in the database? For Windows, see http://www.sqlite.org/download.html#a10 There are other links for other operating systems > Thanks >

Re: [sqlite] Update Statements using Sub query

2015-01-20 Thread Simon Davies
On 20 January 2015 at 13:09, MikeSnow wrote: > I was wondering if anyone could help > I am trying to use Excel to create update statements based on certain > criteria. > For example...this works > UPDATE CDR_Adjusted SET "DateTime"=DATE||" "||TIME; > (This is

Re: [sqlite] Is this date supposed to be less than or more than the other?

2015-01-02 Thread Simon Davies
On 3 January 2015 at 00:12, J Decker wrote: > Okay... > https://www.sqlite.org/lang_datefunc.html > > https://www.sqlite.org/datatype3.html /* lists DateTime as a distinct type > */ Could you point out where exactly > > I understand it's kept as a string... and there's no

Re: [sqlite] Using binding in sqlite insert statements

2014-12-09 Thread Simon Davies
On 9 December 2014 at 10:56, Prakash Premkumar wrote: > Hi, > > I'm trying to use the sqlite_bind function calls to pass values to the > insert queries in sql. > > Here's the code I'm trying to execute: http://pastebin.com/kMvAHsrk > > I get an error after the

Re: [sqlite] Discrepancy with indexing and WHERE clause with AND/OR

2014-11-10 Thread Simon Davies
On 10 November 2014 16:03, Don V Nielsen wrote: > Isn't this the result of the results cache? The two queries are identical. > The query plan changes... . . . sqlite> explain query plan select count(*) from v wherez = 0 and ...> (

Re: [sqlite] sqlite3.8.7 crashes when creating an index with WAL mode disabled

2014-11-04 Thread Simon Davies
On 4 November 2014 04:17, RP McMurphy wrote: > Consider the following build cmd line: > > gcc -o sqlite3.exe -DSQLITE_OMIT_WAL sqlite3.c shell.c > > The build succeeds when using MinGW on Windows. > > Now start the built exe with a memory database: > > sqlite3

Re: [sqlite] Inserting a row with all defaults set in table

2014-10-25 Thread Simon Davies
On 25 October 2014 14:49, Stephen Chrzanowski wrote: > I've got a table that has defaults set for all fields > > CREATE TABLE [tEvents] ( > [EventID] INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, > [Airline] CHAR DEFAULT '', > [TicketID] INTEGER DEFAULT 0, > [Resolved]

Re: [sqlite] how to join 3 tables from a sqlite database?

2014-03-25 Thread Simon Davies
On 25 March 2014 14:09, Christian Dallinger wrote: > Hello, I want to join these 3 tables from my database: > > http://pastebin.com/f8FP0G0C something like select Macadress, timestamp, result, user, '', '', '', '' from checklog union select MacAdress, timestamp,

Re: [sqlite] How to write a query

2014-03-05 Thread Simon Davies
On 5 March 2014 10:24, Igor Korot wrote: > Hi, Simon, > . . . >> >> Possibly: >> select v1, v2 from ( select 1 as ordr, f1 as v1, f2 as v2 from t union >> all select 2, f3, f4 from t ) order by ordr, v1; >> > > With UNION I will have 2 DB hits, correct? > Meaning I execute the

Re: [sqlite] How to write a query

2014-03-05 Thread Simon Davies
On 5 March 2014 10:04, Igor Korot wrote: > Hi, ALL, > Let's say I have a table with following data: > > field1field2field3 field4 > 12 3 4 > 5 6 7 8 > > How do I write a query which will produce the output as:

Re: [sqlite] Select with dates

2013-09-12 Thread Simon Davies
On 12 September 2013 06:34, jwzumwalt wrote: > I have not used the date function in select statements before. > I have valid entries for the current month, what am I doing wrong? > > SELECT * FROM "entry" WHERE > bankdate > date('now','end of month','-1 month') >

Re: [sqlite] How to use aux_data effectively?

2013-09-06 Thread Simon Davies
On 6 September 2013 16:38, Pepijn Van Eeckhoudt wrote: > Hi, > > In the extension I'm developing (https://bitbucket.org/luciad/libgpkg) > I'm currently adding support for queries like: > select Distance( > GeomFromText('Point(13.457 3)'), > geometry > ) from table; >

Re: [sqlite] v3.8 .import misbehaves

2013-08-28 Thread Simon Davies
On 28 August 2013 14:16, wrote: > OK, now copy the data line several times, and you'll see there are errors > for several lines, unrelated to the final CRLF (which I removed this next > sample). > > -- data -- > "Year","Debt","GDP1","GDP2","RGDP","dRGDP","Infl","debtgdp" >

Re: [sqlite] v3.8 .import misbehaves

2013-08-28 Thread Simon Davies
On 28 August 2013 13:51, wrote: > I did. I just download the precompiled binaries for Windows, and this is > what I see (for that sample data file): > > C:\temp>sqlite3.exe > SQLite version 3.8.0 2013-08-26 04:50:08 > Enter ".help" for instructions > Enter SQL statements

Re: [sqlite] Number of Colum!!!

2013-08-13 Thread Simon Davies
On 13 August 2013 15:11, techi eth wrote: > Is their any limit on number of Colum in SQLite3 table? > > Cheers - > > Techi ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Query on Update or Selective Insert

2013-08-07 Thread Simon Davies
On 7 August 2013 15:25, Simon Slavin wrote: > > On 7 Aug 2013, at 9:50am, techi eth wrote: > >> I am trying to update 100 variables at a time & due to some of the reason 99 >> th or any mid index variable cause update to fail. >> >> In that case this

Re: [sqlite] Query optimization: Checking for existence before performing action

2013-07-29 Thread Simon Davies
On 29 July 2013 12:57, Navaneeth.K.N wrote: > Hello, > > I am trying to optimize the SQL calls that my application makes. I > have a scenario where words are inserted into a table. Now each word > will have a column called "confidence". There is a unique primary key > on

Re: [sqlite] Access Permission on Table

2013-07-22 Thread Simon Davies
On 22 July 2013 10:02, techi eth wrote: > Is their any statement I can build using SQLite3, which will provide me > access permission over table. > > Let us say I have 3 tables (table 1, table 2, table 3). Here I am looking > Read permission for one->many but Write can be done

Re: [sqlite] How to select from a temp table with same name as a main table.

2013-06-18 Thread Simon Davies
On 17 June 2013 23:19, dochsm wrote: > I have a table in the main database called 'students' and a two page block of > sql that processes it, referring to it as simply 'students'. > > Experimenting with a different approach, I created a temp table, also called >

Re: [sqlite] getting transactions working with prepare, step & finallise

2013-06-12 Thread Simon Davies
On 12 June 2013 16:50, e-mail mgbg25171 wrote: > Tbank you in anticipation for any forthcoming advice > I include my program below in Powerbasic (not disimilar to C) > and wonder what I need to do in order to "wrap" > multiple statements (which use prepare,step &

Re: [sqlite] Foreign Key constraint problem while dropping tables inside transaction

2013-05-13 Thread Simon Davies
On 13 May 2013 16:52, Simon Slavin wrote: > > On 13 May 2013, at 3:54pm, Григорий Григоренко wrote: > >> sample database is: >> >> PRAGMA FOREIGN_KEYS=1; >> CREATE TABLE cat(id INTEGER PRIMARY KEY, name); >> INSERT INTO cat VALUES (1, 'Alice'); >> CREATE

Re: [sqlite] Is there a command to lock a database for a short while (0.25 sec, say)

2013-04-17 Thread Simon Davies
On 17 April 2013 14:39, J Trahair wrote: > Hi everyone > > Can my application lock the database for its own exclusive use at the > beginning of a series of INSERTs UPDATEs and SELECTs, then unlock it again > afterwards? I've read about the five locking states

Re: [sqlite] FreeBSD and SQLITE_ENABLE_LOCKING_STYLE

2013-04-11 Thread Simon Davies
On 11 April 2013 09:03, Baptiste Daroussin wrote: > Ok so I was not going in the right direction :) > > So how it is possible to corrupt a database on nfsv4? Does that ring a bell > to someone? In case you have not already seen it:

Re: [sqlite] IMPORT fails INTEGER column but lets same data sail through as INT

2013-03-20 Thread Simon Davies
On 19 March 2013 15:08, rol...@logikalsolutions.com wrote: > version 3.7.9 2011-11-01 00:52:41 > KUbuntu 12.04 LTS 32-bit > > ex1.sql > > CREATE TABLE table_ex1( > Groupid INTEGER PRIMARY KEY, > GroupName TEXT > ); > .separator '|' > .import ex1.csv table_ex1 > .quit

Re: [sqlite] insert / replace into joined tables.

2013-03-01 Thread Simon Davies
On 1 March 2013 13:29, chas cartmel wrote: > Hi guys/gals. > > First post to this group. > > I have a problem which can be solved in Access/ SQL Server but not seemingly > in SQLite. I am trying to update a value in a table from another identical > table where that value has

Re: [sqlite] got selected items ok but can't update using them

2013-02-20 Thread Simon Davies
On 20 February 2013 11:36, e-mail mgbg25171 wrote: > After a bit of a struggle I've got the fields I want but I'm failing to use > them in an update operation. > This > > SELECT i,o,n FROM > ( > SELECT alias_id i, > (SELECT orig_itm FROM stmnts where ID = alias_id) o,

Re: [sqlite] about delete problem

2013-01-16 Thread Simon Davies
On 16 January 2013 08:16, YAN HONG YE wrote: > create table mytable( ID integer primary key autoincrement, name nvarchar(32) > ); > insert into mytable(name) values("aa1"); > insert into mytable(name) values("aa2"); > insert into mytable(name) values("aa3"); > insert into

Re: [sqlite] special aggregate feature vs query optimization

2013-01-10 Thread Simon Davies
On 10 January 2013 17:04, Eduardo Morras wrote: > On Thu, 10 Jan 2013 14:53:52 +0100 > E.Pasma wrote: > >> Hello, >> >> A query of the form: "SELECT max(x), y FROM table" returns the value >> of y on the same row that contains the maximum x value. > > True

Re: [sqlite] Result of multi-command _exec() that errors ?

2012-12-04 Thread Simon Davies
On 4 December 2012 11:02, Simon Slavin wrote: > (Yes, I know I should be preparing and binding for security reasons, but that > doesn't work here.) > > What is the result when using _exec() on multiple statements when one of the > statements errors ? I read this page: > >

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-03 Thread Simon Davies
On 3 December 2012 19:29, Igor Korot wrote: > Simon, > > On Mon, Dec 3, 2012 at 11:03 AM, Simon Slavin wrote: >> >> On 3 Dec 2012, at 6:53pm, Igor Korot wrote: >> > > Here is the session: > > sqlite> CREATE TABLE test(id1 integer,

Re: [sqlite] What is wrong with this update SQL

2012-11-22 Thread Simon Davies
On 22 November 2012 11:20, Staffan Tylen wrote: > I run this (sql.txt): > > create table table1 (age_band); > insert into table1 values(31); > UPDATE table1 SET age_band = (case when age_band <= 10 then ' 0 - 10' > when age_band BETWEEN 11 AND 20 then ' 11 - 20' when

Re: [sqlite] how to use julianday function

2012-11-08 Thread Simon Davies
On 9 November 2012 02:42, YAN HONG YE wrote: > sqlite> select > fmn,DATE('NOW'),supplierDate,julianday('now'),julianday(supplierDate),julianday('supplierDate') > from t93c_adl where supplierDate>julianday('now') limit 5 ; > 854954|2012-11-09|12/01/2012|2456240.61186149|| >

Re: [sqlite] sqlite-users Digest, Vol 59, Issue 7

2012-11-08 Thread Simon Davies
On 9 November 2012 01:40, YAN HONG YE wrote: > select date( supplierDate, '+2 days' ) ; > use this cmd couldn't solve the problem; > will have nothing on this column: > > sqlite> select fmn,'84 day'+supplierDate from t93c_adl where fmn like > '85493%'; > 854939|95 >

Re: [sqlite] couldn't use is null function

2012-11-08 Thread Simon Davies
On 9 November 2012 01:49, YAN HONG YE wrote: > sqlite> SELECT fmn,IMPLANTATIONgrading FROM T93C_ADL WHERE > IMPLANTATIONgrading i > s not null and fmn like '85495%'; > 854954|R > 854952| >

Re: [sqlite] finding duplicate records i.e. records with same values across 4 colums...

2012-11-08 Thread Simon Davies
On 8 November 2012 11:23, e-mail mgbg25171 wrote: > I'm using SQLIte. > All columns can have duplicate values but it would be helpful to report > on those rows which are identical across all columns. > More specifically I'm looking for matching itm values where the

Re: [sqlite] Bug: Inconsistency wrt. indirectly defined columns

2012-11-07 Thread Simon Davies
On 7 November 2012 20:36, <stahl...@dbs.uni-hannover.de> wrote: > Quoting Simon Davies <simon.james.dav...@gmail.com>: > . . . > >> I think this is the documented behaviour: >> http://www.sqlite.org/datatype3.html >> >> tab1.id has integer affinity,

Re: [sqlite] Bug: Inconsistency wrt. indirectly defined columns

2012-11-07 Thread Simon Davies
On 7 November 2012 16:41, wrote: > Hi! > > I have encountered inconsistent behavior regarding indirectly defined > columns. > > In the following example: > > CREATE TABLE main ( id INTEGER PRIMARY KEY ); > CREATE TABLE tab1 ( id INTEGER REFERENCES main, str

Re: [sqlite] FW: about date question

2012-11-07 Thread Simon Davies
On 7 November 2012 09:42, YAN HONG YE wrote: > the table had a column: SupplierDate Date > I wanna add 84 days : > SELECT SupplierDate+84 as date1 FROM ADL; > BUT result have noting > when use: > select date(supplierdate+'2 day') from t93c_adl limit 3; > the result is: >

Re: [sqlite] couldn't use is null function

2012-11-07 Thread Simon Davies
On 7 November 2012 08:27, YAN HONG YE wrote: > SELECT * FROM ADL WHERE Project_grading is null; > can't select anything. sqlite> create table ADL( id integer primary key, data text, Project_grading integer ); sqlite> insert into ADL( data, Project_grading ) values( '1', 1 );

Re: [sqlite] SUGGESTION: "now" as alias for "strftime('%s','now')"

2012-11-02 Thread Simon Davies
On 2 November 2012 13:08, Григорий Григоренко wrote: > > Thu, 1 Nov 2012 19:57:42 + от Simon Slavin : > >> > Please read >> >> > >> > Surely, I did) Don't get me wrong - my point is not that Sqlite is lacking

Re: [sqlite] primary key with bulk insert (UNION SELECT)

2012-10-12 Thread Simon Davies
On 11 October 2012 15:07, Alan Frankel wrote: > I have a table that uses an autogenerated id as primary key. I want to do > bulk inserts using UNION SELECT, but it doesn't seem to be happy unless I > specify an id for each row: > > sqlite> create table

Re: [sqlite] Size

2012-10-04 Thread Simon Davies
On 4 October 2012 14:06, Alami Omar wrote: > Hello, does SQLite format files have any size(fie size of the sqlite file) > info on the header ? Thank you. http://www.sqlite.org/fileformat.html#filesize Regards, Simon ___

Re: [sqlite] export html error

2012-09-21 Thread Simon Davies
On 21 September 2012 10:35, Kevin Benson wrote: > On Fri, Sep 21, 2012 at 4:30 AM, YAN HONG YE wrote: > >> C:\t9>sqlite3 -html -header t9_engine.db "select id,partnumber,'img >> src= >> t'||pic||'height=120px',pcs from engine where id>7 " >> n.html

Re: [sqlite] Foreign Key

2012-09-08 Thread Simon Davies
On 7 September 2012 21:28, Dennis Klein wrote: > Hallo, > > I am Using the latest Version of the precompiled shell Application from the > Download section, and the C/C++ Sources in Version 3.7.11 > > Now i created my tables, using Primary Key and Foreign Key

Re: [sqlite] query function release problem

2012-08-02 Thread Simon Davies
On 2 August 2012 08:28, YAN HONG YE wrote: . . . > when I use command > " jii select ccc" > it shows a problem: > > "jii.exe has encountered a problem and needs to close. We are sorry for the > inconvenience." > > I couldn't resolve it. > > void query_table(sqlite3 *l_db) >

Re: [sqlite] C++ - Finalizing my SQLite interface

2012-07-27 Thread Simon Davies
On 27 July 2012 15:22, Arbol One wrote: > Before calling the destructor, I would like to make sure that all the > sqlite3_stmt have been 'finalized', is there a function in SQLite that that > can help me do this, or should I just use 'NULL'? The documentation is there to help

Re: [sqlite] how many rows deleted

2012-07-11 Thread Simon Davies
On 12 July 2012 00:21, deltagam...@gmx.net wrote: > Can I retrieve how many rows are affected from a delete statement like > std::string delete_stmt("DELETE FROM mylog WHERE > strftime('%Y-%m-%d',thedate) BETWEEN ? AND ? "); > http://www.sqlite.org/c3ref/changes.html

Re: [sqlite] cann't work

2012-07-11 Thread Simon Davies
On 11 July 2012 10:00, YAN HONG YE wrote: > two same structure tables, when use this sql: > insert into table2 values(select * from table1 where filename like "%55"); > > but show error: sqlite error 1 - near "select": syntax error insert into table2 select * from table1

Re: [sqlite] How to use variables in statements ?

2012-06-13 Thread Simon Davies
On 13 June 2012 10:40, deltagam...@gmx.net wrote: > Im using c++ and like to write from within c++ into sqlite3 db. > I saw some tutorials on the sqlite pages, but the > statements have always been defined in advance and they have been constant. > > How to add now new data to

Re: [sqlite] Query by License -Consulta por Licencia

2012-05-16 Thread Simon Davies
2012/5/16 Guillermo Soland : > Mr. Representative of SQLite: > > > Hello, my name is Guillermo G. Soland, I live in the city of Villa > Constitución, Santa Fe, Argentina, I graduated as a Computer Systems Analyst, > but now I do not practice my profession for profit because my

Re: [sqlite] Having in prepared statement with parameters

2012-05-09 Thread Simon Davies
On 9 May 2012 14:17, Pavel Ivanov wrote: >> As the last three statements are exactly the same (in meaning). >> Can someone explain what's happening? > > I think you've got trapped by double value storage imprecision. > Comparing double values for exact equality is pretty

Re: [sqlite] ROLLBACK TO savepoint cancels earlier RELEASEs

2012-05-09 Thread Simon Davies
On 9 May 2012 10:33, wrote: > Hi All, > > 1: SAVEPOINT 1 > 2: insert A > 3: RELEASE SAVEPOINT 1 > 4: SAVEPOINT 2 > 5: insert B > 6: ROLLBACK TO SAVEPOINT 2 > > ROLLBACK in line 6 cancels also line 2 in addition to line 5. > > I want to cancel just line 5. > >

Re: [sqlite] SQlite exclusive table lock

2012-05-03 Thread Simon Davies
On 3 May 2012 20:29, Harnek Manj wrote: > Hi Simon, > > Yes I have multiple Threads which are accessing the database. Currently if I > am doing a write operation the whole database file is locked, I want the > locking applied only to the table in operation. > > So

Re: [sqlite] Is it possible to preclude the latest sqlite 3.7.11 Windows warning message?

2012-04-23 Thread Simon Davies
On 23 April 2012 13:04, Frank Chang wrote: > > >       Good morning, We are trying to compile  the latest SQLITE 3.7.11 > release but we keep getting the Windows Visual Studio 8 warning message: > warning C4232: nonstandard extension used : 'pCurrent' : address

Re: [sqlite] help

2012-04-23 Thread Simon Davies
2012/4/23 Ковригина Ольга : > Hello,support! > Tell me how to resize columns in a table? > I do like this: > ALTER TABLE t1 MODIFY (c1 TYPE VARCHAR(2500)); > or > ALTER TABLE t1 ALTER (c1 TYPE VARCHAR(2500)); > But it does not work. > The column does not have a size:

Re: [sqlite] sqlite3_transaction can't work

2012-04-05 Thread Simon Davies
On 5 April 2012 09:44, YAN HONG YE wrote: > sqlite3_transaction trans(db); can't work in c, I don't know why? Give us a clue: what are you expecting, and what actually happens... Regards, Simon ___ sqlite-users mailing list

Re: [sqlite] SQLITE Binding Issue when using [] brackets

2012-04-02 Thread Simon Davies
On 1 April 2012 21:23, ap wrote: > > http://sqlite.org/c3ref/bind_blob.html > > Brackets are recommended for attribute names in some cases, it seems the > binding for :VVV does not permit :[VVV]. Is this the case? Square brackets are a quoting mechanism for identifiers

Re: [sqlite] put jpg into sqlite database

2012-03-30 Thread Simon Davies
On 30 March 2012 10:39, YAN HONG YE wrote: > this following code is my import girl.jpg to my sqlite database, but I don't > know why JPG didn't up to the bin.db. > > #include > #include > #include > #include"sqlite3.h" > > #pragma comment(lib, "sqlite3.lib") > > sqlite3 *

Re: [sqlite] how to add time in a new column

2012-03-29 Thread Simon Davies
On 29 March 2012 12:36, Black, Michael (IS) wrote: > You'll need to export the table and data.  Change the SQL to what you want. > Then import again. > > Does the shell have ability to name the columns on the insert  statements > from the .dump to make this easier?  I

Re: [sqlite] .headers error

2012-03-27 Thread Simon Davies
On 27 March 2012 06:03, YAN HONG YE wrote: > C:\sqlite\lib>sqlite3 -html foods.db "select * from dzh;" >mm.html "-headers > on" > > sqlite3: Error: too many options: "-headers on" > Use -help for a list of options. > how to write this command? sqlite3 -html -header foods.db

Re: [sqlite] version 3.7.3 on linux, commands do not respond

2012-03-22 Thread Simon Davies
2012/3/22 Conxita Marín : > It has to be something more complexof course, I tried the same database in > Debian Lenny + Sqlite3 3.5.9 and it works perfectly: > > conxita@my_other_linux# sqlite3 backup_bd > SQLite version 3.5.9 > Enter ".help" for instructions > sqlite> .tables >

Re: [sqlite] Join-source issue when using sub '(' join-source ')'

2012-03-19 Thread Simon Davies
On 19 March 2012 13:05, Pavel Ivanov wrote: >> According to the documentation on SELECT statements >> http://www.sqlite.org/lang_select.html >> It seems possible to write join chains as A join (B join C). (using a '(' >> join-source ')' single-source ) > ... >> It seems that

Re: [sqlite] The number of parameters passed to user functions

2012-03-13 Thread Simon Davies
On 13 March 2012 10:59, Max Vlasov wrote: > Hi, > > Is there a way to know the number of parameters passed for user function > with undefined argument count (nArg = -1 in the Sqlite3_create_function > call). > > I could not find a function specific to this task and thought

Re: [sqlite] Unique qualifier

2012-03-12 Thread Simon Davies
On 12 March 2012 15:49, Bryce Lembke wrote: > I cannot seem to get the UNIQUE constraint to work in sqlite. > > The following is the trace from my command line. > > Note that if I remove the UNIQUE constraint, it works fine. > > C:\>sqlite myDB.db > > SQLite version 3.6.17 > >

Re: [sqlite] import txt file to sqlite

2012-03-12 Thread Simon Davies
On 12 March 2012 08:35, YAN HONG YE wrote: > I wanna import a text file to sqlite db, this follow code is right? >        char *zErrMsg = 0; >        sqlite3 *db; > >        rc=sqlite3_open("foods.db",); >        sqlite3_exec(db, "CREATE TABLE contact (fliename varchar(128)

Re: [sqlite] Efficient random sampling in a large table using builtin functions.

2012-03-08 Thread Simon Davies
___ > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on > behalf of Simon Davies [simon.james.dav...@gmail.com] > Sent: Thursday, March 08, 2012 8:33 AM > To: General Discussion of SQLite Database > Subject: EXT :Re: [sqlite] Efficient random sampling in a

Re: [sqlite] Efficient random sampling in a large table using builtin functions.

2012-03-08 Thread Simon Davies
On 8 March 2012 14:20, Black, Michael (IS) wrote: > You don't say what language you are working in.  IN C++ I would just declare > a "set" and put random row numbers in it until I had enough.  Then use that > set to build the SQL. > > SQLite's random() doesn't have a

Re: [sqlite] Views and Performance

2012-03-02 Thread Simon Davies
On 2 March 2012 16:23, Duquette, William H (318K) wrote: > Howdy! > > Suppose I have two related tables, t1 and t2, and I write a view like this: > >    CREATE VIEW myview AS SELECT * FROM t1 JOIN t2 USING (some_column); > > If I am querying data just from t1, is

Re: [sqlite] read each line in sqlite database

2012-03-01 Thread Simon Davies
On 1 March 2012 18:43, Don V Nielsen wrote: > I think Simon's solution is in error, and Igor's is correct.  In Simon's > case, Slevel will be set to 1 if price1 is greater than 30. It will be set to 2, as required by OP. > However, the > original c function would set

  1   2   3   4   >