Re: [sqlite] Bug when uUsing Parameters with views

2009-12-15 Thread Simon Davies
2009/12/15 D. Richard Hipp : > >> > > Because string '2' is not the same thing as integer 2. > > sqlite3> select 2='2'; > 0 > sqlite3> > Why sqlite> select cast( 2 as integer ) = '2'; 1 > > D. Richard Hipp > d...@hwaci.com > Simon ___

Re: [sqlite] Bug when uUsing Parameters with views

2009-12-15 Thread Simon Davies
2009/12/15 Cariotoglou Mike : > Simon, thanks for the answer. your code helped track down the issue, > which I *still* believe to be a bug: > . . . > > select * from > (select *," > cast((select count(*) from ITEM_ARTIST where > ARTIST_id=artists.artist_id) as int) CNT > from

Re: [sqlite] Bug when uUsing Parameters with views

2009-12-15 Thread Simon Davies
2009/12/15 Cariotoglou Mike : > I checked in the bug database, and this does not seem to have been > reported, and IMHO it is definitely a bug. > workarounds exist,as pointed out by me and others. still, I would like > to hear from the core team whether this is > recognized as a

Re: [sqlite] EPC Based Search

2009-12-15 Thread Simon Davies
2009/12/15 Ram Mandavkar : > > Hello All, > >      I am New to SQL-Lite DB, > I had one ASSET table having EPC as varchar(50) field and 5000 records in > it. > > If i want to search > ( >   CREATE TRIGGER "main"."TR_MULTIREAD_BEFORE" BEFORE INSERT ON READMODE >       BEGIN

Re: [sqlite] rowid of the current insert

2009-12-10 Thread Simon Davies
2009/12/10 Yuzem : > > CREATE TABLE movies(id integer,title text,unique(id)) > > Generally I have an unique id from imdb but some times the movie isn't > available. > I understand that there is a column called rowid that is the primary key. > I would like to insert the rowid

Re: [sqlite] compiling Sqlite with ICU

2009-12-10 Thread Simon Davies
2009/12/10 Sylvain Pointeau : > Hi, > > I would like to use ICU with sqlite, I am on mac os x 10.6.2 > How should I do? I installed ICU but sqlite3 seems to not check ICU when > compiling. > I would like to use ICU via the sqlite shell. > > Please could someone explain

Re: [sqlite] how to show blob data while select in sqlite3 shell?

2009-12-09 Thread Simon Davies
2009/12/9 liubin liu <7101...@sina.com>: > > sqlite> INSERT OR REPLACE INTO periods_value VALUES (0, 1, > x'000102030400a0afaabbaa'); > sqlite> > sqlite> SELECT * FROM periods_value; > 0|1| > sqlite> > > how to show the blob data? Select id, valid, hex( value ) from periods_value; Regards, Simon

Re: [sqlite] Multiples natural left joins problem

2009-12-06 Thread Simon Davies
2009/12/6 Yuzem : > > Is this a bug in new versions that will be fixed or it is the new behavior? In 3.6.20, so long as you include the alias, you will get your expected results: SELECT movies.id, title, files, icon_modified, icon_width FROM ( movies NATURAL LEFT JOIN files)

Re: [sqlite] Multiples natural left joins problem

2009-12-04 Thread Simon Davies
2009/12/4 Yuzem : > >> What query are you trying with the above tables, and how do the >> results differ from what you expect? >> > This is the query: > SELECT movies.id,title,files,icon_modified,icon_width > FROM (movies natural left join files) natural left join

Re: [sqlite] Multiples natural left joins problem

2009-12-03 Thread Simon Davies
avin actually... >> >> You need to read up on the different types of JOIN that SQL allows.  No >> reason to use a LEFT JOIN if you want a RIGHT JOIN, an INNER JOIN or a >> CROSS JOIN. >> > It says that right join is not supported and inner and cross join don't

Re: [sqlite] Multiples natural left joins problem

2009-12-03 Thread Simon Davies
2009/12/3 Simon Davies <simon.james.dav...@googlemail.com>: > 2009/12/3 Yuzem <naujnit...@gmail.com>: >>> SELECT a.id,a.title,a.rating,tag.tag FROM (movies natural left join >>> user) as a natural left join tag; >>> >> It doesn't work, it says:

Re: [sqlite] Multiples natural left joins problem

2009-12-03 Thread Simon Davies
2009/12/3 Yuzem : > > Thanks both for the replies. . . . . > SimonDavies wrote: >> >> SELECT a.id,a.title,a.rating,tag.tag FROM (movies natural left join >> user) as a natural left join tag; >> > It doesn't work, it says: no such column a.id > If I use movies.id I have the

Re: [sqlite] Multiples natural left joins problem

2009-12-03 Thread Simon Davies
2009/12/3 Pavel Ivanov : > If using "natural left join" is not a requirement for you then this > works as you expect it: > > select movies.id, title, rating, tag > from movies left join user on movies.id = user.id >        left join tag on movies.id = tag.id; > Or: SELECT

Re: [sqlite] Doubts about usage of sqlite3.exe and foreign keys (enable this feature)

2009-12-02 Thread Simon Davies
2009/12/2 Ubirajara Marques da Cruz : > To Support, > > > > I am trying to develop a data base what need to specify  foreign key to > preserve problems with insertion of datas. > > > > I have four tables like i describe below: > . . . > > When i start sqlite3 and inside

Re: [sqlite] open transaction

2009-11-27 Thread Simon Davies
2009/11/27 : > How could I know if a transaction is already open? Does a specific > command exist? > Cheers http://www.sqlite.org/c3ref/get_autocommit.html Rgds, Simon ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] New sqlite bug report: Problem with /* */ comment followed by Non-SQL (sqlite-specific) command

2009-11-20 Thread Simon Davies
2009/11/20 Norbert : > Hi, > > I use SQLite 3.6.16 on Ubuntu Linux Karmic Koala, installation via > normal Ubuntu repository. At home (Linux) and also in the office > (Windows XP), I encountered the following problem. > > Source of test.sql: > > *BEGIN OF

Re: [sqlite] execute or prepare+step+finalize

2009-11-11 Thread Simon Davies
2009/11/11 T : > > i`ve done it, and i think i understand it :) > > thank you.. > > > few more question to be sure that i`m not missing something important.. > > if i use prepared statements only (dont use exec function in program at all) > i dont need callback function,

Re: [sqlite] sqlite3_free()

2009-11-11 Thread Simon Davies
2009/11/11 T : > > is this right way how to do it: > > sqlite_free (errmsg); > > ??? > > > or this: > > > sqlite3_free (NULL); >From http://www.sqlite.org/c3ref/free.html: "The sqlite3_free() routine is a no-op if is called with a NULL pointer." > > or how should i do

Re: [sqlite] execute or prepare+step+finalize

2009-11-11 Thread Simon Davies
2009/11/11 T : > . . . > >> and finaly i get SQLITE_DONE but it still doesnt show me table i have >> selected... > > See http://www.sqlite.org/c3ref/column_blob.html > > > i dont understand what exactly do you mean.. > > combination of these: > > sqlite3_value

Re: [sqlite] execute or prepare+step+finalize

2009-11-11 Thread Simon Davies
2009/11/11 T : > > i think i understand why it doesnt work for select *.. > > because sqlite_step executes one row at time.. so after i prepare SELECT * , > i need to use sqlite_step as many times as table i`m selecting from has rows > (in this case 3 times).. > so i made

Re: [sqlite] 3.6.20 NATURAL self-join still not fixed

2009-11-07 Thread Simon Davies
2009/11/7 Kristoffer Danielsson : > > Using SQLite 3.6.20 (SQLITE_ENABLE_STAT2=1). > > PRAGMA foreign_keys=OFF; > > BEGIN TRANSACTION; > > CREATE TABLE Test > ( >  TestID INTEGER PRIMARY KEY, >  T1 INTEGER NOT NULL, >  T2 INTEGER NOT NULL, >  T3 INTEGER NOT NULL, >  

Re: [sqlite] A constraint bug?

2009-10-31 Thread Simon Davies
2009/10/31 Mick : > This is more FYI than needing it (as I have already worked around it), but I > have discovered that an IGNORE constraint on an insert, when one of the > fields in the constraint is NULL, will insert a duplicate record into the > database. > > i.e. > > CREATE

Re: [sqlite] .import on a .csv file

2009-10-22 Thread Simon Davies
2009/10/22 Scott Baker : > I'm trying to .import a CSV file and I can't quite figure out the syntax. > > I created a table, and then did: > > .separator , > .import /tmp/foo.csv mytable > > This works sort of, unless my data has , in it. Something like "last, > first". Because

Re: [sqlite] Select * from table where field = "value" does not work when "value" is also a field....

2009-10-14 Thread Simon Davies
2009/10/13 Hillebrand Snip : > I have a database with the following fields: > 1) Status (it will hold values like "Open", "Closed", "Submitted"... etc...) > 2) Closed (boolean field which contains 1 or 0) > > If i enter a query like:  Select * from Issues where Status !=

Re: [sqlite] Datetime mystery

2009-10-08 Thread Simon Davies
2009/10/8 Fredrik Karlsson : > Hi, > > > > On Thu, Oct 8, 2009 at 12:04 AM, P Kishor wrote: >> On Wed, Oct 7, 2009 at 5:02 PM, Fredrik Karlsson wrote: >>> Dear list, >>> >>> I am sorry if I am asking a FAQ, but what is differnent with

Re: [sqlite] Strange File Import Error

2009-09-22 Thread Simon Davies
2009/9/22 Rich Shepard <rshep...@appl-ecosys.com>: > On Tue, 22 Sep 2009, Simon Davies wrote: > >>> 117172|Engineered Structures Inc.|Brockway Center|10875 SW Herman >>> Rd|Tualatin|97062-8033|Washington|NWR|45.3834|-122.7882|1542|Nonresidential >>> Constr

Re: [sqlite] Strange File Import Error

2009-09-22 Thread Simon Davies
2009/9/22 Rich Shepard <rshep...@appl-ecosys.com>: > On Tue, 22 Sep 2009, Simon Davies wrote: > >> Remove the trailing pipe character > >   Did that as soon as I learned it made no difference. Each line should be > clean and there are 25 columns defined in it. Q

Re: [sqlite] Strange File Import Error

2009-09-22 Thread Simon Davies
2009/9/22 Rich Shepard : > On Tue, 22 Sep 2009, Simon Slavin wrote: > >> Use a text editor on the file and change all occurrences of (including the >> quotes) >> >> "," >> >> to >> >> "|" >> >> then set .separator to the single character | before you import the >> file. >

Re: [sqlite] Strange File Import Error

2009-09-22 Thread Simon Davies
2009/9/22 Pavel Ivanov : >>   If I understand correctly, I can remove all quotes as long as the only >> commas delineate columns. Or, I can use the pipe as a separator and remove >> all quotes, too. Correct? > > AFAIK, you can do only the first - remove all quotes and make sure

Re: [sqlite] Date comparisons

2009-09-21 Thread Simon Davies
2009/9/21 Barton Torbert : > Hello, > > I am having trouble doing a rather odd data comparison. > > I have two table, each with a DateTime field.  The timestamps in these fields > do not match exactly.  I want to find the row in the second table that is > within a specific

Re: [sqlite] Why are allowed to keep a text of 3 characters in a field that has been set to 2?

2009-09-21 Thread Simon Davies
2009/9/21 Guillermo Varona Silupú : > Hi > In these SQL commands: > > CREATE TABLE "test" ("code" char(2)); > INSERT INTO test (code) VALUES("123") > > Why are allowed to keep a text of 3 characters in a field that has been > set to 2? > Is a bug? No - I suggest that you

Re: [sqlite] Viewer for blobs in hex?

2009-09-21 Thread Simon Davies
2009/9/21 Yan Bertrand : >                Hi all, > > > > I would like to display the contents of blobs in my table as > hexadecimal. I have not found any easy way of doing this. I tried : > > -          wxSQLitePlus, but it does not display blobs contents (or I > could

Re: [sqlite] How can I do to build this query with a text that contains ' and "?

2009-09-20 Thread Simon Davies
2009/9/20 Guillermo Varona Silupú : > Hi > I want to insert this text: > > 1' equivale a 12" > > cQry := "INSERT INTO Tabla1 (Code,Equiv) VALUES (10, "1' equivale a 12"") INSERT INTO Tabla1 (Code,Equiv) VALUES (10, '1'' equivale a 12"'); > > TIA > Best Regards > GVS > >

Re: [sqlite] Creating custom function for recursive queries

2009-09-16 Thread Simon Davies
2009/9/16 Marcel Strittmatter : > Hi > > I implemented a custom function that returns a comma separated list of > primary keys as a string by making recursive queries. This works well > if I don't use subqueries. But I like to use subqueries like this > > SELECT *

Re: [sqlite] JOIN (SELECT o.pid, SUM(o.qty) 'qty_sold' FROM ORDERS o) qs

2009-09-15 Thread Simon Davies
009/9/15 Gert Cuykens : >   SELECT t.pid, >          t.txt, >          t.price, >          t.qty - IFNULL(qs.qty_sold, 0) 'onhand_qty' >     FROM PRODUCTS t > LEFT JOIN (SELECT o.pid, >                  SUM(o.qty) 'qty_sold' >             FROM ORDERS o) qs ON qs.pid = t.pid

Re: [sqlite] One more SQL statement question

2009-09-09 Thread Simon Davies
2009/9/10 Dennis Volodomanov : > Hello, > > I have one more SQL query question - the people on this list have been very > helpful in the past, so thank you! > > I'm trying to create a trigger that would delete unreferenced rows from a > table. > > Let's say the schema is

Re: [sqlite] Integer Storage class

2009-09-02 Thread Simon Davies
2009/9/2 Sebastian Bermudez : > Ok. my problem is my SQLITE front end (SQLITE ADMINISTRATOR v 0.8.3.2) ... > show me 0 (cero) in that column. Looks like SQLITE ADMINISTRATOR v 0.8.3.2 only deals with signed 32 bit values. 2147483647 it accepts as a valid value,

Re: [sqlite] Integer Storage class

2009-09-02 Thread Simon Davies
2009/9/2 Sebastian Bermudez : > hi! i have an table ( articles ) with a column for EAN13 Barcodes like ( > 7790080066784). > I have created the column with Integer data type... ( i have chose that data > type after read the SQLITE DOC where it' say: "INTEGER. The

Re: [sqlite] triggers question, OLD reference is not available after SET statment

2009-08-27 Thread Simon Davies
2009/8/27 Jarod Tang : > Hi List users, > > In my code, i create two triggers (Trigger_A, Trigger_B) on a table ( > sample_db), but after execution, it's found that Trigger_A is not executed > correctly ( old.msg_box hasnt be put into table log ). And it seems to me > that

Re: [sqlite] how to make journal file roll back to my database file?

2009-08-26 Thread Simon Davies
2009/8/26 Zhanjun You : > hello all, >        I have read the article " > http://www.sqlite.org/fileformat.html#journal_file_formats; and " > http://www.sqlite.org/fileformat.html#rollback_journal_method",but I am even > more confused, anyone have some sample code for

Re: [sqlite] Re triving the database name from the sqlite pointer ....

2009-08-18 Thread Simon Davies
2009/8/18 Atul_Vaidya : > > Hi, >   I have a Sqlite3 pointer. Is there any way to get the filename of this > pointer ? Execute "PRAGMA database_list;" See http://www.sqlite.org/pragma.html#pragma_database_list > Regards, > Atul Rgds, Simon

Re: [sqlite] Error 14 - SQLITE_CANTOPEN

2009-08-13 Thread Simon Davies
2009/8/13 Simon Slavin : > > On 13 Aug 2009, at 12:47pm, Otto Grunewald wrote: > >> on the website at the following address: >> >> http://www.sqlite.org/c3ref/exec.html >> >> The second paragraph states the following: >> >> The error message passed back through the 5th

Re: [sqlite] Merging blobs on disk without taking up memory???

2009-08-03 Thread Simon Davies
2009/8/3 sorka : > > Hi. I have a table that stores pieces of an image as a bunch of blobs. I get > the pieces out of order and store them in a table until I get all of the > pieces I need. I then want to assemble them in order and store the resulting > complete image in in

Re: [sqlite] Some SQL statements are not executing

2009-07-20 Thread Simon Davies
2009/7/20 Gary Verhaegen : > Hi everybody, . . . > I have narrowed the problem to the few following lines : > > > #define DEBUG > > int db_execute(sqlite3 *db, char stmt[STR_LEN]) { > DEBUG   PRINT("\nentering db_execute with statement %s.", stmt); >       int ret=0; >  

Re: [sqlite] Is there a substitute for Sqlite3_get_table ?

2009-07-17 Thread Simon Davies
2009/7/17 Atul_Vaidya : > > Hi, . . . > My question is, is it possible in > SQlite to retrieve the data stored in the database in the format in which it > is stored when the data was inserted in it ? for eg: if I store the data as > an Int, will I get it back as

Re: [sqlite] How to create a table that has a field that can hold a 64-bit interger

2009-07-15 Thread Simon Davies
2009/7/15 Dieter Dasberg : > Hello, > . . . > > This > > create table test (Afield INTEGER) > > leads always to a data-size of 4 byte, What makes you think this? See http://www.sqlite.org/datatype3.html > what I need is a data-size of 8 byte. > > What can I do? > > Best

Re: [sqlite] SQLITE is not working in pthread

2009-07-10 Thread Simon Davies
2009/7/10 Pramoda M. A : > > Hi, > >  We r using Fedora Linux 10. Our application is, when any device is inserted, > we will detect that create thread using pthread_create API. Which will find > all MP3 files in the device and extract the metadata present in the mp3

Re: [sqlite] Query by Day

2009-07-06 Thread Simon Davies
2009/7/6 Rick Ratchford : > Greetings! > Hi Rick, > I'm having trouble with what I thought would be a simple SQL query. > >    SQLString = "SELECT strftime('%d', Date) as Day, IsSwingTop1 as Tops, > IsSwingBtm1 as Btms " & _ >                "FROM TmpTable WHERE Day =

Re: [sqlite] Column headers of result

2009-07-04 Thread Simon Davies
2009/7/5 BareFeet : >>> > Hi Simon, > >>> How can I get just the column headers without all the result rows? >> >> Turn headers on, then perform a search which gives no results. > > Unfortunately, the sqlite3 command line tool does not show the headers > when there are no

Re: [sqlite] Value returned by sqlite3_column_bytes for strings

2009-07-03 Thread Simon Davies
2009/7/3 chandan : > Hi all, >    Consider the following scenario, >    1. A table contains a column of type "text". >    2. The value of this column for the first row is say "linux". > > If we execute the SQL statement: "select name from some_tbl where id = ?" >

Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-19 Thread Simon Davies
2009/6/19 hiral : > Hi Simon / John, > > Thank you for replies. > >> You are able to repeatably corrupt the db under SQLite 3.5.9? It would >> be worthwhile publishing a script that can do that. >  > "was getting error often" or "did get error ONCE"?? > I am running

Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-18 Thread Simon Davies
2009/6/18 hiral : > Hi Simon, > > Thank you for your quick reply. > > I am sorry for more general questions. > > As I mentioned I was getting corrupted db error with sqlite-3.5.9, but when > I tried with sqlite-3.6.4 it is no more corrupting the db. > -- so was it a bug

Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-18 Thread Simon Davies
2009/6/17 hiral : > Hi Simon, > >  I looked into it but couldn't find the exact reason for my bug. > >  If you have any idea please let me know. Sorry, other than the link, I can not help. > >  Also I would appreciate, if you can let me know what does this error mean >

Re: [sqlite] Sqlite-3.5.9: getting sqlite_autoindex error

2009-06-17 Thread Simon Davies
2009/6/17 hiral : > Any suggestion on this !!! Your database has been corrupted. http://www.sqlite.org/lockingv3.html#how_to_corrupt Rgds, Simon > > On Tue, Jun 16, 2009 at 4:34 PM, h o wrote: > >> Hi, >> >> I am using sqlite-3.5.9 and

Re: [sqlite] How does SQLite handle newlines in values?

2009-06-13 Thread Simon Davies
2009/6/13 Florian v. Savigny : > > > I'm very sorry if this is a very stupid question. Intuitively, I would > assume that of course, any TEXT or BLOB field may contain > newlines. I'm, however, puzzled about two things (it all refers to the > commandline interface): > > - while

Re: [sqlite] sqlite programmed in C++

2009-06-02 Thread Simon Davies
2009/6/2 Sylvain Pointeau : > Hello, > I would like to know if someone already though about to introduce C++ in > SQLite? > I just think about a minimal subset of C++ that will not make any > performance penalty > (like C with classes) Prob good idea to look through

Re: [sqlite] Select on foreign key NULL

2009-05-26 Thread Simon Davies
2009/5/26 Leo Freitag : > Hallo, > > I got some problems with a select on a foreign key with value null. > I want to filter all male singers. > > CREATE TABLE 'tblsinger' ('id' INTEGER PRIMARY KEY, 'name' TEXT, > 'fkvoice' INTEGER, 'sex' TEXT); > INSERT INTO "tblsinger"

Re: [sqlite] setting a date in a BEFORE INSERT trigger

2009-05-09 Thread Simon Davies
2009/5/9 Sam Carleton : > This is my first BEFORE INSERT trigger in SQLite and I am getting an error: > > SQL error: near "new": syntax error > > My goal is that on an insert only the insertedby value is provide. > The trigger will set that to the updatedby, insertedon

Re: [sqlite] Newbie trying to list resultSet with C

2009-05-08 Thread Simon Davies
2009/5/8 Simon Davies <simon.james.dav...@googlemail.com>: > 2009/5/8 Nuno Magalhães <nunomagalh...@eu.ipp.pt>: >> Greetings. >> >> I've managed to compile the example, after installing the amalgamation >> and using -lsqlite3 in gcc, otherwise it'll complain

Re: [sqlite] Newbie trying to list resultSet with C

2009-05-08 Thread Simon Davies
2009/5/8 Nuno Magalhães : > Greetings. > > I've managed to compile the example, after installing the amalgamation > and using -lsqlite3 in gcc, otherwise it'll complain about undefined > references. > > I can't figure out how to read a simple result set. I know i shoud use

Re: [sqlite] Combining .output and .read in a batch file

2009-05-07 Thread Simon Davies
2009/5/7 Leo Freitag : > Hallo, > > I try to get run the following in a batch file > > Open database "test.db" > Set output to "o.txt" > Read sql-statement form "r.sql" > > === r.sql - Start === > select * from table1; > === r.sql - End === > > Thinks like the following

Re: [sqlite] in memory database and jdbc

2009-04-30 Thread Simon Davies
2009/4/29 Tom van Ees : > Hi, > > my java application uses a 80Mb reference database (read-only) that needs to > be consulted app. 4M times during a batch run. I would like to use the > in-memory capabilities of sqlite3 to improve the performance of my app. > > In order

Re: [sqlite] Error Binding Parameter to Compiled Statement

2009-04-17 Thread Simon Davies
2009/4/17 jonwood : > > Greetings, > > I'm getting an error compiling a parameter to a compiled statement. > Unfortunately, since I'm using a customer wrapper class around sqlite, > posting my code won't be much help. Here's what I'm doing: > > I create a compiled

Re: [sqlite] select with a like containing a line feed

2009-04-03 Thread Simon Davies
2009/4/3 Sylvain Pointeau : > re-hi, > but how do we do if we are on unix and there is some CR on those field? > I cannot insert CR in my statement (only line feed) > > do you have any suggestion? > > Cheers, > Sylvain > Something like this: SQLite version 3.4.2 Enter

Re: [sqlite] Source code position out of sync debugging in VS 2008

2009-03-28 Thread Simon Davies
2009/3/28 Vinnie : > > I have added sqlite.c to my Visual Studio 2008 project and everything seems > to be working in terms of database calls. However, when I step into an actual > sqlite routine using the debugger, the source code position is out of sync > with the actual

Re: [sqlite] Unnecessary line breaks in .dump output

2009-03-27 Thread Simon Davies
2009/3/27 Simon Davies <simon.james.dav...@googlemail.com>: > 2009/3/27 Francois Botha <igitur+sql...@gmail.com>: >> >> Uhm, sorry. I'm new here.  I don't want to paste the SQL script in an email, >> because it contains line breaks and I don't want the for

Re: [sqlite] Unnecessary line breaks in .dump output

2009-03-27 Thread Simon Davies
2009/3/27 Francois Botha : > (my apologies if this is a duplicate) > > >> Attachments don't make it through the mailing list, >> > > Uhm, sorry. I'm new here.  I don't want to paste the SQL script in an email, > because it contains line breaks and I don't want the

Re: [sqlite] Unnecessary line breaks in .dump output

2009-03-27 Thread Simon Davies
2009/3/27 Francois Botha : > > The example you used, works 100% for me.  I attach a sql script for which I > experience the problem. > Attachments don't make it through the mailing list, Rgds, Simon ___ sqlite-users mailing

Re: [sqlite] Getting field data back from SQLite db

2009-03-16 Thread Simon Davies
2009/3/16 : > Hello, > > I am new on SQLite so bear with me :-) > > Can someone give me a simple c solution on following: > > I execute select telnr from contacts where name="David" > > I just want to get from the found record the content of field telnr back to > my c > program

Re: [sqlite] How to interrupt a running query in SQLite?

2009-03-13 Thread Simon Davies
2009/3/13 manohar s : > Thanks for that. I Should have searched that :). > > Now I am Executing  the Vacuum query, and sqlite3_interrupt() is called from > a different thread, It is interrupted. > But once interrupted query execution is failing with SQLITE_ERROR. It has to >

Re: [sqlite] datetime as integer

2009-03-13 Thread Simon Davies
2009/3/13 John Machin : > On 12/03/2009 12:21 AM, Nicolás Solá wrote: >> Hi I’m using Trac software and it is implemented using SQLITE3. In Trac DB >> schema there is a table called “milestone”. It has a field called “due” and >> it means due date. The problem is that it uses

Re: [sqlite] Read back the specified triggers

2009-03-03 Thread Simon Davies
2009/3/3 Spitzer, Thomas : > I plan to implement the parametrisation of an embedded device with > sqlite. > Therfore I need the triggers heavily, for writing the changed values > into the hardware. > > Testing workes fine, so far. But I did not find a possibility to read >

Re: [sqlite] Unab to close data base due to unfinalized statements

2009-02-11 Thread Simon Davies
2009/2/11 : > Hi , > i am using sqlite with vc++, i tried to insert a row into data base with > prepared statement using bind operations, i reset the statement after using > it but when i try to close DB it is giving error "Unable to close data base > due to

Re: [sqlite] Programmed backup & restore

2009-02-10 Thread Simon Davies
2009/2/10 Gorshkov : > I am developing an application, and I need the ability to create > backups, and restore, from withing the program. > > Telling the user "download sqllite.exe, open a dos box, cd to XXX, and > then .." isn't an option, but I don't see any

Re: [sqlite] Resolving some compiler warnings when closing db

2009-02-03 Thread Simon Davies
2009/2/3 Billy Gray : > Hi all, > . . . > #import > ... > - (void) closeDb { >// first loop thru any existing statements and kill'em >sqlite3_stmt *pStmt; >while( (pStmt = sqlite3_next_stmt(db, 0)) != 0 ){ >sqlite3_finalize(pStmt); >} > >int result =

Re: [sqlite] sqlite3_bind_int returns SQLITE_RANGE

2009-02-02 Thread Simon Davies
2009/2/2 hussainfarzana : > > Dear All, > > We are working with SQLite Version 3.6.10. > We tried to insert or update the records in the database using > sqlite3_prepare and binding the values using sqlite3_bind functions.We have > started with the index 1.We have a table

Re: [sqlite] Transfer data between databases

2009-01-09 Thread Simon Davies
2009/1/9 Pierre Chatelier : > Hello, > > This may be a question with a very short answer... > I have two separate SQLite database files, but containing the same > kind of tables. Is there a quick way to copy rows from one table of a > file to the same table of the other file

Re: [sqlite] confusing with how to to this in sqlite

2008-12-23 Thread Simon Davies
2008/12/23 Rachmat Febfauza : > = > > thanks to Simon. it works. but i have some question. i hope u can help me > to explain these : > > 1. is it necessary or not to specify min(awal1.begin). No. "Begin" is part of the 'group by' clause. Each distinct

Re: [sqlite] confusing with how to to this in sqlite

2008-12-21 Thread Simon Davies
2008/12/21 Rachmat Febfauza : > > It looks like you are using the sqlite3 shell, so experiment with .separator > > Have you used .help? > > Rgds, > Simon > > > yes i am using sqlite3 shell, i mean not to make display like mysql does, but > the difference column that i want

Re: [sqlite] confusing with how to to this in sqlite

2008-12-20 Thread Simon Davies
2008/12/20 Rachmat Febfauza : > > i have to change 'FOOD ' to 'FOOD', but the result is not that i hope. > > Rachmat: If what Simon says is correct (and I have no reason to doubt > it) you might also get your query to work by specifying a collating > sequence of RTRIM on the

Re: [sqlite] confusing with how to to this in sqlite

2008-12-19 Thread Simon Davies
2008/12/20 Rachmat Febfauza : > I have problem with executing this query in sqlite. to reconstruct problem > please follow the following steps. > > > 1. create table awal1, akhir1 and hasil1 first. > > CREATE TABLE awal1(Code char(5),Level varchar(8), Category varchar(50), >

Re: [sqlite] sqlite3_exec - statement length limit?

2008-11-25 Thread Simon Davies
2008/11/25 SQLiter <[EMAIL PROTECTED]>: > > Is there a limit on the length of the SQL that can be executed using this > function. I mean stmt1;stmt2;...stmtn upto what length. Even if there is > no limit is it nevertheless prudent not to exceed a certain maximum length? > --

Re: [sqlite] Foreign Key

2008-11-25 Thread Simon Davies
2008/11/25 Satish <[EMAIL PROTECTED]>: > 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

Re: [sqlite] Describe [table];

2008-11-21 Thread Simon Davies
2008/11/21 Arigead <[EMAIL PROTECTED]>: >. >. > Question is given that "describe" isn't available, can I interrogate any > of the system tables in order to work out what a table contains? http://www.sqlite.org/pragma.html or use "SELECT * FROM sqlite_master;" > > Thanks for any help Rgds,

Re: [sqlite] What query should I use?

2008-11-20 Thread Simon Davies
2008/11/19 wojtek <[EMAIL PROTECTED]>: > Hiall, > I have a problem with a query that I thought is easy. I have a database > containing a following data: > CREATE TABLE [Magazyn] > ( >[IdMagazyn] integer PRIMARY KEY AUTOINCREMENT , >[IdMat] integer, >[Partia] varchar (10), >[Ilosc]

Re: [sqlite] Enforcing Uniqueness for tables created using a select statement?

2008-11-20 Thread Simon Davies
2008/11/20 Christophe Leske <[EMAIL PROTECTED]>: > Hi, > > i am creating my table as such: > > create temp table idlookup as select id from ... > > I would like ID to be unique in my idlookup table. How would I do this > using this construct? create temp table idlookup as select distinct id from

Re: [sqlite] HELP: prep'ed query ... LF function to return column_isNull??

2008-11-08 Thread Simon Davies
2008/11/7 Rob Sciuk <[EMAIL PROTECTED]>: > > I don't see in the documentation a function to return whether or not the > database value returned by the sqlite3_step() function is NULL. Surely > there should be such a beast, no? > > Something like: >int sqlite3_column_isNull( stmt, i ) ; >

Re: [sqlite] create table default expr

2008-11-03 Thread Simon Davies
2008/11/3 John <[EMAIL PROTECTED]>: > Hi > > I want to (if possible) create a table with a default timestamp in a > format other than "-MM-DD ..." per example below. I have tried a few > variants but always get same error. > > Can this be done and if so, how? > > create table ( >

Re: [sqlite] rowid increment

2008-10-29 Thread Simon Davies
2008/10/29 Shaun R. <[EMAIL PROTECTED]>: > The rowid looks to reuse numbers when a row is deleted, how can i stop this? > > For example, i insert 3 rows, then i delete row 2, when entering a new row > after that the rowid is 2 rather than 4. I want the rowid to be 4. use AUTOINCREMENT keyword:

Re: [sqlite] About select records from table

2008-10-29 Thread Simon Davies
Hi yoky, 2008/10/29 yoky <[EMAIL PROTECTED]>: > Hi all, >I create a table with 250 columns and this table has 3 records, I > want to select the records from the table which satisfy certain conditions. > the SQL statement like this: >select * from tablename where (conditions); >

Re: [sqlite] Join criteria referencing case select result in 3.6.2 produces different results from 3.4.2

2008-09-17 Thread Simon Davies
2008/9/17 Dan <[EMAIL PROTECTED]>: > > >> >> On 3.4.2 we get: >> 3.0|3660.5|3 >> 6.0|1360.3|6 >> >> On 3.6.2 we get: >> |5020.8|3 >> > > 3.6.2 has a bug involving DISTINCT or GROUP BY queries that use > expression aliases (AS clauses) in the select-list. Problem is fixed > in cvs: > >

[sqlite] Join criteria referencing case select result in 3.6.2 produces different results from 3.4.2

2008-09-17 Thread Simon Davies
Hi All, We have been using SQLite 3.4.2 for some time. On investigating upgrading to 3.6.2, we found that different results were produced for one query. The following illustrates: CREATE TABLE tst1( tst1Id INTEGER, width REAL, thickness REAL ); CREATE TABLE tst2( tst2Id INTEGER,

Re: [sqlite] [sqlite-announce] Foreign key trigger in transactiontriggers wrongly

2008-09-17 Thread Simon Davies
2008/9/17 Bjorn Rauch <[EMAIL PROTECTED]>: >> From: Simon Davies <[EMAIL PROTECTED]>> Date: 2008/9/16> Subject: Re: >> [sqlite-announce] Foreign key . . . . > Yes, indeed it works this way. But I am executing these commands from a .NET > application usin

Re: [sqlite] Update command working from command line but not from a C program

2008-09-16 Thread Simon Davies
2008/9/16 Aravinda babu <[EMAIL PROTECTED]>: > Hi all, > . . . > static const char *updateCmd = "UPDATE cert_store_table set lastRowFlag = > :lastRowFlag where lastRowFlag = :lastRowFlag;" ; > < same named parameter twice > . . . > Is there

Re: [sqlite] SQL statement to get min/max values

2008-08-15 Thread Simon Davies
Not sure about replacing the collation sequence - does not sound easier than recreating the table. You could just add a view: sqlite> CREATE TABLE test_table (ID INTEGER PRIMARY KEY, ...> ExternalID2 INTEGER, ...> ExternalID INTEGER, ...>

Re: [sqlite] SQL statement to get min/max values

2008-08-15 Thread Simon Davies
Hi Dennis, Declaring the column as integer does not prevent you from storing strings: SQLite version 3.6.0 Enter ".help" for instructions sqlite> BEGIN TRANSACTION; sqlite> CREATE TABLE test_table (ID INTEGER PRIMARY KEY, ExternalID2 INTEGER, ...> ExternalID ...> INTEGER, Value INTEGER);

Re: [sqlite] db vs shell

2008-07-29 Thread Simon Davies
2008/7/29 Robert Citek <[EMAIL PROTECTED]>: > On Tue, Jul 29, 2008 at 2:35 AM, <[EMAIL PROTECTED]> wrote: >> On Tue, Jul 29, 2008 at 02:29:53AM -0500, Robert Citek wrote: >>> $ sqlite3 -version >>> 3.4.2 >> >> On 3.4.0 and 3.5.9 here, the pure-SQL version is -much- faster than the shell >> pipe.

Re: [sqlite] Sqlite Endianness

2008-07-25 Thread Simon Davies
2008/7/25 Dave Gierok <[EMAIL PROTECTED]>: > Does anyone know what endianness a Sqlite database is stored in? Or does > that depend on the endianness of the machine it was created on? I am > wondering because we ship a game that runs on Xbox 360, which uses the > PowerPC architecture and has

Re: [sqlite] Format of the data

2008-07-22 Thread Simon Davies
2008/7/22 Joanne Pham <[EMAIL PROTECTED]>: > Hi All, > I am current using sqlite 3.5.9 and below is command to get the data from my > database as: > .output '/opt/phoenix/monitor/exportData' > .mode csv > select '#Monitored applications' , group_concat(appName) from appMapTable; > The

Re: [sqlite] Problem with Inner Join

2008-07-14 Thread Simon Davies
2008/7/14 Ralf <[EMAIL PROTECTED]>: > I'm having problems with Inner Joins on m:n relations > > book <--> bookauthor <--> author > > SELECT authorname FROM author INNER JOIN book INNER JOIN bookauthor ON > book.Id_book = bookauthor.Id_book ON author.Id_author = bookauthor.Id_author > WHERE

<    1   2   3   4   >