Re: [sqlite] Bug? SQLite command-line result is different from Perl DBI::Sqlite result

2020-01-07 Thread Igor Korot
Hi, On Tue, Jan 7, 2020 at 2:01 AM Clemens Ladisch wrote: > > Richard Hipp wrote: > > On 1/5/20, Keith Medcalf wrote: > >> select * from a, b, c using (id); -- very strange result > > > > PostgreSQL and MySQL process the query as follows: > > > >SELECT * FROM a, (b JOIN c USING(id)); > > >

Re: [sqlite] Bug? SQLite command-line result is different from Perl DBI::Sqlite result

2020-01-07 Thread Clemens Ladisch
Richard Hipp wrote: > On 1/5/20, Keith Medcalf wrote: >> select * from a, b, c using (id); -- very strange result > > PostgreSQL and MySQL process the query as follows: > >SELECT * FROM a, (b JOIN c USING(id)); > > SQLite processes the query like this: > >SELECT * FROM (a,b) JOIN c USING

Re: [sqlite] Bug? SQLite command-line result is different from Perl DBI::Sqlite result

2020-01-05 Thread Keith Medcalf
On Sunday, 5 January, 2020 04:42, Richard Hipp wrote: >On 1/5/20, Keith Medcalf wrote: >> Hrm. Inconsistent/incorrect results. Consider: >> create table a(id integer primary key, a); >> insert into a values (1,1), (2,1), (3,1); >> create table b(id integer primary key, b); >> insert into b

Re: [sqlite] SQLite command-line result is different from Perl DBI::Sqlite result (Keith Medcalf)

2020-01-05 Thread Simon Slavin
On 5 Jan 2020, at 5:01pm, Amer Neely wrote: > But the question still remains, why the different results? The optimizer gets improved from time to time in SQLite versions. SQLite solved the problem faster by breaking down your query differently: deciding whether to do one scan or use two

Re: [sqlite] Bug? SQLite command-line result is different from Perl DBI::Sqlite result

2020-01-05 Thread Amer Neely
> On 1/5/20, Keith Medcalf wrote: >> >> Hrm. Inconsistent/incorrect results. Consider: >> >> create table a(id integer primary key, a); >> insert into a values (1,1), (2,1), (3,1); >> create table b(id integer primary key, b); >> insert into b values (1,2), (3,2), (4,2); >> create table c(id

Re: [sqlite] SQLite command-line result is different from Perl DBI::Sqlite result (Keith Medcalf)

2020-01-05 Thread Amer Neely
> On Saturday, 4 January, 2020 18:31, Amer Neely > wrote: > >> I'm fairly new to SQLite, but have been using MySQL / mariadb in a local >> and web-based environment for several years. So far I'm happy and >> impressed with SQLite, but I recently noticed some odd behaviour with >> one of my

Re: [sqlite] SQLite command-line result is different from Perl DBI::Sqlite result (Igor Korot)

2020-01-05 Thread Amer Neely
-- > What is your version of Perl and the SQLite module? This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level (with 2 registered patches, see perl -V for more detail) Copyright 1987-2013, Larry Wall SQLite version 3.30.1 2019-10-10 20:19:45 Enter ".help" for

Re: [sqlite] Bug? SQLite command-line result is different from Perl DBI::Sqlite result

2020-01-05 Thread Richard Hipp
On 1/5/20, Richard Hipp wrote: > > Note that both MySQL and SQLite do allow you to use parentheses, as > shown in my examples, to define the order of evaluation. PostgreSQL > does not, sadly. > Apparently, in PostgreSQL you have to say: SELECT * FROM (SELECT * FROM a, b) AS x JOIN c

Re: [sqlite] Bug? SQLite command-line result is different from Perl DBI::Sqlite result

2020-01-05 Thread Richard Hipp
On 1/5/20, Keith Medcalf wrote: > > Hrm. Inconsistent/incorrect results. Consider: > > create table a(id integer primary key, a); > insert into a values (1,1), (2,1), (3,1); > create table b(id integer primary key, b); > insert into b values (1,2), (3,2), (4,2); > create table c(id integer

[sqlite] Bug? SQLite command-line result is different from Perl DBI::Sqlite result

2020-01-04 Thread Keith Medcalf
edcalf >Sent: Saturday, 4 January, 2020 19:32 >To: SQLite mailing list >Subject: Re: [sqlite] SQLite command-line result is different from Perl >DBI::Sqlite result > > > > > >-- >The fact that there's a Highway to Hell but only a Stairway to Heaven >says a lot ab

Re: [sqlite] SQLite command-line result is different from Perl DBI::Sqlite result

2020-01-04 Thread Keith Medcalf
-- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. On Saturday, 4 January, 2020 18:31, Amer Neely wrote: >I'm fairly new to SQLite, but have been using MySQL / mariadb in a local >and web-based environment for several

Re: [sqlite] SQLite command-line result is different from Perl DBI::Sqlite result

2020-01-04 Thread Igor Korot
Hi, On Sat, Jan 4, 2020 at 7:31 PM Amer Neely wrote: > > Hello all, > I'm fairly new to SQLite, but have been using MySQL / mariadb in a local > and web-based environment for several years. So far I'm happy and > impressed with SQLite, but I recently noticed some odd behaviour with > one of my

[sqlite] SQLite command-line result is different from Perl DBI::Sqlite result

2020-01-04 Thread Amer Neely
Hello all, I'm fairly new to SQLite, but have been using MySQL / mariadb in a local and web-based environment for several years. So far I'm happy and impressed with SQLite, but I recently noticed some odd behaviour with one of my queries. Using the command-line in a shell (Mac High Sierra) I get a

Re: [sqlite] SQLite DELUXE Re: sqlite command line tool NUL support

2018-01-25 Thread Luke Amery
https://www.sqlite.org/privatebranch.html This command both creates the new repository and populates it with all the latest SQLite could -> This command both creates the new repository and populates it with all the latest SQLite code On Wed, Jan 24, 2018 at 10:44 PM Richard Hipp

Re: [sqlite] SQLite DELUXE Re: sqlite command line tool NUL support

2018-01-24 Thread Richard Hipp
On 1/24/18, petern wrote: > Have you worked out an automated way for your changes to shadow and > auto-merge from the official trunk? https://www.sqlite.org/privatebranch.html -- D. Richard Hipp d...@sqlite.org ___

Re: [sqlite] SQLite DELUXE Re: sqlite command line tool NUL support

2018-01-24 Thread J Decker
On Wed, Jan 24, 2018 at 1:30 PM, petern wrote: > Have you worked out an automated way for your changes to shadow and > auto-merge from the official trunk? That is, aside from collision edits, > is it automated? Longer term, your shadow distribution also needs >

[sqlite] SQLite DELUXE Re: sqlite command line tool NUL support

2018-01-24 Thread petern
Have you worked out an automated way for your changes to shadow and auto-merge from the official trunk? That is, aside from collision edits, is it automated? Longer term, your shadow distribution also needs new/merged test cases and a regression test run to re-qualify the merged changes at each

Re: [sqlite] sqlite command line tool NUL support

2018-01-24 Thread J Decker
This is a picture. This is a tortoise git log view of merges. https://drive.google.com/open?id=1RosGlprJRoutFsou2XDRlflxc8xWoHks On Wed, Jan 24, 2018 at 8:59 AM, J Decker wrote: > > So for output of a select in the shell ( unlike .dump ) is this. > > for(i=1; i

[sqlite] sqlite command line tool NUL support

2018-01-24 Thread J Decker
So for output of a select in the shell ( unlike .dump ) is this. for(i=1; iout, ",%s", sqlite3_column_text(pSelect, i)); } option 1) add text conversion in the column_text to escape NUL characters. in TEXT... then everyone everywhere would inherit the

Re: [sqlite] sqlite command line tool fails to dump data

2018-01-22 Thread Simon Slavin
On 22 Jan 2018, at 4:46pm, J Decker wrote: > create table [with\0nul] ( `col\0``umn` ) Could you not ? In fact, could everybody not ? [Goes to look for ice bag or strong alcohol, whichever appears first.] Simon. ___ sqlite-users

Re: [sqlite] sqlite command line tool fails to dump data

2018-01-22 Thread J Decker
On Sun, Jan 21, 2018 at 11:48 PM, Clemens Ladisch wrote: > J Decker wrote: > >> *If any NUL characters occur at byte| offsets less than the value of the > >> fourth parameter then the resulting| string value will contain embedded > >> NULs.* > > > > So it's best used as data,

Re: [sqlite] sqlite command line tool fails to dump data

2018-01-21 Thread Clemens Ladisch
J Decker wrote: >> *If any NUL characters occur at byte| offsets less than the value of the >> fourth parameter then the resulting| string value will contain embedded >> NULs.* > > So it's best used as data, and not keys > and I see unless custom aggregate()s or function()s ... If you want

Re: [sqlite] sqlite command line tool fails to dump data

2018-01-21 Thread J Decker
On Sun, Jan 21, 2018 at 7:42 AM, Clemens Ladisch wrote: > J Decker wrote: > > insert into test (a,b) values ( ?,? ) > > bind 'hello\0world.' 'te\0st' > > says: > | If a non-negative fourth parameter is provided to

Re: [sqlite] sqlite command line tool fails to dump data

2018-01-21 Thread Clemens Ladisch
J Decker wrote: > insert into test (a,b) values ( ?,? ) > bind 'hello\0world.' 'te\0st' says: | If a non-negative fourth parameter is provided to sqlite3_bind_text() | or sqlite3_bind_text16() or sqlite3_bind_text64() then that parameter | must be

Re: [sqlite] sqlite command line tool fails to dump data

2018-01-21 Thread Luuk
On 21-01-18 16:16, J Decker wrote: > create table test (a,b) > insert into test (a,b) values ( ?,? ) > bind 'hello\0world.' 'te\0st' luuk@opensuse:~/tmp> sqlite3 SQLite version 3.8.10.2 2015-05-20 18:17:19 Enter ".help" for usage hints. Connected to a transient in-memory database. Use ".open

[sqlite] sqlite command line tool fails to dump data

2018-01-21 Thread J Decker
sqlite test.db create table test (a,b) insert into test (a,b) values ( ?,? ) bind 'hello\0world.' 'te\0st' .dump table -- output CREATE TABLE test (a,b); INSERT INTO test VALUES('hello','te'); ___ sqlite-users mailing list

Re: [sqlite] command shell .timeout

2017-08-03 Thread Roman Fleysher
Thank you, Richard. Roman From: sqlite-users [sqlite-users-boun...@mailinglists.sqlite.org] on behalf of Richard Hipp [d...@sqlite.org] Sent: Thursday, August 03, 2017 3:38 PM To: SQLite mailing list Subject: Re: [sqlite] command shell .timeout On 8/3

Re: [sqlite] command shell .timeout

2017-08-03 Thread Richard Hipp
On 8/3/17, Roman Fleysher wrote: > Dear SQLiters, > > I am using sqlit3 command shell. It has ".timeout" command. What is the > difference between: > > .timeout MS > PRAGMA busy_timeout = milliseconds; They accomplish the same thing. The ".timeout" command (which

[sqlite] command shell .timeout

2017-08-03 Thread Roman Fleysher
Dear SQLiters, I am using sqlit3 command shell. It has ".timeout" command. What is the difference between: .timeout MS PRAGMA busy_timeout = milliseconds; I am getting "database is locked" when accessing the same file from multiple concurrent shells and trying to set timeouts to avoid this.

Re: [sqlite] (dot) commands will execute from sqlite command line but not from query

2016-12-31 Thread Richard Hipp
On 12/31/16, Paul Lambert wrote: > > Issue 2. No matter how I mix the use of .system in a trigger I cannot get > the syntax checker to allow for (dot) functions .system or .shell to > work. I know there is a qualifier about where the (dot) functions are > parsed but I have

Re: [sqlite] (dot) commands will execute from sqlite command line but not from query

2016-12-31 Thread Simon Slavin
On 31 Dec 2016, at 7:55pm, Paul Lambert wrote: > Issue 2. No matter how I mix the use of .system in a trigger I cannot get > the syntax checker to allow for (dot) functions .system or .shell to > work. Dot functions are not part of SQLite. They are handled directly by the

[sqlite] (dot) commands will execute from sqlite command line but not from query

2016-12-31 Thread Paul Lambert
On Linux with sqlite 3.13.0 installedI have successfully invoked the (dot) commands .system and .shell. Below are the results. In both instances the application at the target location launched as expected. (Ignore the Gtk message as it relates to the modal dialog box employed in the the

Re: [sqlite] Command line not accepting multi-line statements.

2016-11-08 Thread John G
Thanks, that worked. John Gillespie On 8 November 2016 at 14:30, Richard Hipp wrote: > On 11/8/16, John G wrote: > > I normally use the 3.8.8.3 supplied with MacOS El Capitan. > > I downloaded version 3.15.1 from the Download page - precompiled > >

Re: [sqlite] Command line not accepting multi-line statements.

2016-11-08 Thread Dominique Devienne
On Tue, Nov 8, 2016 at 3:30 PM, Richard Hipp wrote: > On 11/8/16, John G wrote: > > I normally use the 3.8.8.3 supplied with MacOS El Capitan. > > I downloaded version 3.15.1 from the Download page - precompiled > > command-line tools :

Re: [sqlite] Command line not accepting multi-line statements.

2016-11-08 Thread Richard Hipp
On 11/8/16, John G wrote: > I normally use the 3.8.8.3 supplied with MacOS El Capitan. > I downloaded version 3.15.1 from the Download page - precompiled > command-line tools : (sqlite-tools-osx-x86-3150100.zip). > > When I tried copying and pasting multiple or multi-line

[sqlite] Command line not accepting multi-line statements.

2016-11-08 Thread John G
I normally use the 3.8.8.3 supplied with MacOS El Capitan. I downloaded version 3.15.1 from the Download page - precompiled command-line tools : (sqlite-tools-osx-x86-3150100.zip). When I tried copying and pasting multiple or multi-line statements from my editor (jEdit) the command-line shell

Re: [sqlite] Regarding file extension for sqlite command prompt

2016-06-25 Thread R.A. Nagy
Use .read to load & execute .sql files. The .open is for databases, not external / textual command files. Here are some introductory videos: https://www.youtube.com/playlist?list=PLItP5KoawLqkPV2jqAVCH79fZGO5k0Uzy On Fri, Jun 24, 2016 at 6:07 AM, Kaja Varunkumar

[sqlite] Regarding file extension for sqlite command prompt

2016-06-25 Thread Kaja Varunkumar
Hello, I am new to SQLite, I have seen the commands for command prompt of SQLite. I have some query files with format .sql. Whenever I try to open the files using command .open and read the files . I am getting an error of file encrypted and not in the database. My question's, are there any

[sqlite] Command line sqlite3 program bug

2015-09-09 Thread Domingo Alvarez Duarte
Tue Sep 08 2015 9:40:37 pm CEST CEST from "Gerry Snyder" > Subject: Re: [sqlite] Command line sqlite3 >program >bug > > The Command Line Interface has the command: > > ..bail on > > which will do what you want. > > HTH, > > Gerry Snyder >

[sqlite] Command line sqlite3 program bug

2015-09-08 Thread Domingo Alvarez Duarte
Hello ! After seem several emails from a user asking about how to use sqlite3 through shell scripts, I remember my experiences with sqlite3 but didn't mind to report it, but now I think that it's worth mention it because it'll hurt several users. The bug/problem is that the sqlite3 command

[sqlite] Command line sqlite3 program bug

2015-09-08 Thread Gerry Snyder
The Command Line Interface has the command: .bail on which will do what you want. HTH, Gerry Snyder --- On 9/8/2015 9:54 AM, Domingo Alvarez Duarte wrote: > Hello ! > > After seem several emails from a user asking about how to use sqlite3

[sqlite] How initialize a database file from unix shell without landing in SQLite command prompt?

2015-03-14 Thread Mikael
I have a file DBDEFINITION.TXT that I want to use to initialize [execute on] the database DB.SQLITE. How do I do something like $ sqlite3 -exec DBDEFINITION.TXT DB.SQLITE $ ? All methods I tried end me up in the SQLite prompt, and that is what I don't want. Like, doing sqlite3 -init

[sqlite] How initialize a database file from unix shell without landing in SQLite command prompt?

2015-03-14 Thread R.Smith
On 2015-03-14 10:51 AM, Mikael wrote: > I have a file DBDEFINITION.TXT that I want to use to initialize [execute > on] the database DB.SQLITE. > > How do I do something like > > $ sqlite3 -exec DBDEFINITION.TXT DB.SQLITE > $ A piped file is always the answer - for anything really. If a piped

[sqlite] How initialize a database file from unix shell without landing in SQLite command prompt?

2015-03-14 Thread Neville Dastur
Just pipe the text file to sqlite3 # sqlite3 DB.SQLITE : >I have a file DBDEFINITION.TXT that I want to use to initialize [execute >on] the database DB.SQLITE. >How do I do something like >$ sqlite3 -exec DBDEFINITION.TXT DB.SQLITE >$ >? >All methods I tried end me up in the SQLite prompt, and

Re: [sqlite] Command line shell not flushing stderr when interactive

2014-01-22 Thread Peter Aronson
n to redirect STDIN to Emacs shell window.     */     char *env_var = getenv("TERM");     if (env_var) {   if (!strcmp (env_var, "emacs"))     stdin_is_interactive = 1;     }   } #endif Peter From: Christopher Wellons <well...@nullprogram.com> >To: sqlite-users@sqlite.o

Re: [sqlite] Command line shell not flushing stderr when interactive

2014-01-19 Thread Simon Slavin
On 19 Jan 2014, at 7:32pm, Luuk wrote: > It is acceptable—and normal—for standard output and standard error to be > directed to the same destination, such as the text terminal. Messages appear > in the same order as the program writes them, unless buffering is involved. >

Re: [sqlite] Command line shell not flushing stderr when interactive

2014-01-19 Thread Luuk
On 19-01-2014 19:59, Christopher Wellons wrote: When the shell is set to interactive (i.e. "-interactive"), the output (stdout) is flushed with every prompt (shell.c:422) but stderr is not. Stderr is suppose to be unbuffered so that flushing is not required. Or is that different for

Re: [sqlite] Command line shell not flushing stderr when interactive

2014-01-19 Thread Christopher Wellons
>> When the shell is set to interactive (i.e. "-interactive"), the output >> (stdout) is flushed with every prompt (shell.c:422) but stderr is not. > Stderr is suppose to be unbuffered so that flushing is not required. Or is > that different for windows? According to the stderr Linux man page

Re: [sqlite] Command line shell not flushing stderr when interactive

2014-01-19 Thread Richard Hipp
t figure out how to link with > libreadline on Windows, though, so I couldn't test this. > > With the following change to the amalgamation release I got the behavior > I was looking for: timely error messages from the SQLite command line > shell. I understand this is probably not the Rig

[sqlite] Command line shell not flushing stderr when interactive

2014-01-19 Thread Christopher Wellons
igure out how to link with libreadline on Windows, though, so I couldn't test this. With the following change to the amalgamation release I got the behavior I was looking for: timely error messages from the SQLite command line shell. I understand this is probably not the Right Way to do this, but it's just a

Re: [sqlite] Command-line utility

2013-07-11 Thread RSmith
http://www.sqlite.org/download.html scroll to "Precompiled Binaries for Windows" It runs just fine on 32 bit windows. Adam Hi, thanks, and yes I have these, but am specifically interested in the latest development trunk, which I don't think is included on this page in compiled form (unless

Re: [sqlite] Command-line utility

2013-07-11 Thread Adam DeVita
http://www.sqlite.org/download.html scroll to "Precompiled Binaries for Windows" It runs just fine on 32 bit windows. Adam On Thu, Jul 11, 2013 at 12:20 PM, RSmith wrote: > Could someone send me a build with the current trunk of the command-line > utility for Windows 32Bit

[sqlite] Command-line utility

2013-07-11 Thread RSmith
Could someone send me a build with the current trunk of the command-line utility for Windows 32Bit with the standard option set for testing purposes please, or point me to where I can download it if a standard build already exists. Thanks! ___

Re: [sqlite] Command history not working in sqlite3 tool for MAC OS

2012-05-11 Thread Neo Anderson
Yes, I installed the latest version myself. > Date: Fri, 11 May 2012 07:46:16 +0100 > From: amit.k.chaudh...@gmail.com > To: sqlite-users@sqlite.org > Subject: Re: [sqlite] Command history not working in sqlite3 tool for MAC OS > > My Mac is running system provided sqlite3 (3.

Re: [sqlite] command line to get number of tables in sqlite

2011-12-21 Thread Mohit Sindhwani
On 22/12/2011 7:25 AM, Matt Young wrote: select count() from sqlite_master; No?? ...where type='table'; Cheers, Mohit. 22/12/2011 | 12:51 PM. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] command line to get number of tables in sqlite

2011-12-21 Thread Matt Young
select count() from sqlite_master; No?? On Wed, Dec 21, 2011 at 10:32 AM, smallboat wrote: > Hello, > > I have a sqlite file. I would like to open it and know how many tables in > it. > > What is the command line to open a sqlite file and get to know how many > tables in

Re: [sqlite] command line to get number of tables in sqlite

2011-12-21 Thread Roger Andersson
Somthing like sqlite3 sqlite.file sqlite> select count(*) from sqlite_master where type = 'table'; /Roger On 12/21/11 19:32, smallboat wrote: Hello, I have a sqlite file. I would like to open it and know how many tables in it. What is the command line to open a sqlite file and get to know

Re: [sqlite] command line to get number of tables in sqlite

2011-12-21 Thread Tim Streater
On 21 Dec 2011 at 18:32, smallboat wrote: > I have a sqlite file. I would like to open it and know how many tables in it. > > What is the command line to open a sqlite file and get to know how many tables > in it? Thanks. See: http://www.sqlite.org/sqlite.html and:

[sqlite] command line to get number of tables in sqlite

2011-12-21 Thread smallboat
Hello, I have a sqlite file. I would like to open it and know how many tables in it. What is the command line to open a sqlite file and get to know how many tables in it? Thanks. Regards, Joe ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Command line option equivalent for .read

2011-12-10 Thread David Walker
Walker Data Management & Warehousing 0118 321 5930 dav...@datamgmt.com http://www.datamgmt.com > Date: Thu, 8 Dec 2011 17:26:55 + > From: Simon Davies <simon.james.dav...@gmail.com> > To: General Discussion of SQLite Database <sqlite-users@sqlite.org> > Subject: Re:

Re: [sqlite] Command line option equivalent for .read

2011-12-08 Thread Simon Davies
On 8 December 2011 17:05, David Walker wrote: > Hi, > > Having played around with a shell script that calls SQLite I have noticed > that I can something like > >        .separator STRING      at the SQLite prompt >        .mode line > > or I can do > >        sqlite3

[sqlite] Command line option equivalent for .read

2011-12-08 Thread David Walker
Hi, Having played around with a shell script that calls SQLite I have noticed that I can something like .separator STRING at the SQLite prompt .mode line or I can do sqlite3 -separator STRING at the command line sqlite3 - line This is both useful and

Re: [sqlite] sqlite command shell - read/process file then exit?

2011-11-22 Thread Kees Nuyt
On Mon, 21 Nov 2011 14:01:47 +, Simon Davies wrote: >On 21 November 2011 13:41, SupportLists wrote: >> Hi, >> >> I am trying to use sqlite3 command shell with -init filename. >> >> The file has: >> >> CREATE TABLE griddata (id_suit

Re: [sqlite] sqlite command shell - read/process file then exit?

2011-11-21 Thread Simon Davies
On 21 November 2011 13:41, SupportLists wrote: > Hi, > > I am trying to use sqlite3 command shell with -init filename. > > The file has: > > CREATE TABLE griddata (id_suit VARCHAR(14) PRIMARY KEY,xpos DECIMAL(7),ypos > DECIMAL(7),cellvalue DECIMAL(14,5) DEFAULT -); >

[sqlite] sqlite command shell - read/process file then exit?

2011-11-21 Thread SupportLists
Hi, I am trying to use sqlite3 command shell with -init filename. The file has: CREATE TABLE griddata (id_suit VARCHAR(14) PRIMARY KEY,xpos DECIMAL(7),ypos DECIMAL(7),cellvalue DECIMAL(14,5) DEFAULT -); .separator "," .import /home/cquiros/temp/layers/layers/New/lgp001.csv griddata ALTER

Re: [sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Ivan Shmakov
> Pete Helgren writes: > I may end up going this direction, at the moment I am not having much > luck with the conditional copy in Busybox. Your suggestion: > cp -n newdatabase.db /data/newdatabase.db > Isn't supported in the version of Busybox that I am running. Also > the script

Re: [sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Simon Slavin
On 31 Aug 2011, at 3:53am, Pete Helgren wrote: > I may end up going this direction, at the moment I am not having much luck > with the conditional copy in Busybox. Your suggestion: > > cp -n newdatabase.db /data/newdatabase.db > > Isn't supported in the version of Busybox that I am running.

Re: [sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Jay A. Kreibich
On Tue, Aug 30, 2011 at 08:29:06PM -0600, Pete Helgren scratched on the wall: > The only issue I had was finding an example of how I could do all of > what you describe below in bash script. For example, if I put this > in a script: > > sqlite3 newdatabase.db > > and save that as createdb.sh

Re: [sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Pete Helgren
I may end up going this direction, at the moment I am not having much luck with the conditional copy in Busybox. Your suggestion: cp -n newdatabase.db /data/newdatabase.db Isn't supported in the version of Busybox that I am running. Also the script example I tried: if [ -f

Re: [sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Pete Helgren
The only issue I had was finding an example of how I could do all of what you describe below in bash script. For example, if I put this in a script: sqlite3 newdatabase.db and save that as createdb.sh and execute it then the script never completes because SQLite is at the sqlite> prompt,

Re: [sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Jay A. Kreibich
On Tue, Aug 30, 2011 at 09:54:21PM -0400, Igor Tandetnik scratched on the wall: > Pete Helgren wrote: > > I have a need to create a database if it doesn't already exist. The > > obvious solution is to just use: > > > > sqlite3 newdatabase.db > > > > Except that it not only

Re: [sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Simon Slavin
Forgot to mention: copying an existing database file also lets you set up the file the way you want without having to issue separate commands. For instance, you could create blank tables. Or set a specific page size. Or include some sort of DRM or security check in the 'blank' file. Simon.

Re: [sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Simon Slavin
source code but I think that's a poor solution. > Even found an example using a createdb command, although I could never see > where that was an SQLite command > > So, you suggest I script it like so: > > if [ -f /data/newdatabase.db]; > then > echo "Nothing to

Re: [sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Igor Tandetnik
Pete Helgren wrote: > I have a need to create a database if it doesn't already exist. The > obvious solution is to just use: > > sqlite3 newdatabase.db > > Except that it not only creates the db but also opens that db for > commands. I am running this from a script so I want

Re: [sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Pete Helgren
found an example using a createdb command, although I could never see where that was an SQLite command So, you suggest I script it like so: if [ -f /data/newdatabase.db]; then echo "Nothing to do, database exists" else cp newdatabase.db /data/newdatabase.db fi I am not much of a Li

Re: [sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Simon Slavin
On 31 Aug 2011, at 2:36am, Pete Helgren wrote: > I have a need to create a database if it doesn't already exist. The obvious > solution is to just use: > > sqlite3 newdatabase.db > > Except that it not only creates the db but also opens that db for commands. Make yourself an empty database

[sqlite] Creating a database with a script or SQLite command

2011-08-30 Thread Pete Helgren
I have a need to create a database if it doesn't already exist. The obvious solution is to just use: sqlite3 newdatabase.db Except that it not only creates the db but also opens that db for commands. I am running this from a script so I want to just want to run the command from a script so

Re: [sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread e-mail mgbg25171
David, Simon...that's good to know...Thank you very much indeed! On 21 June 2011 13:19, Simon Slavin wrote: > > On 21 Jun 2011, at 12:59pm, e-mail mgbg25171 wrote: > > > I was looking at prepare/step/finalise as a means of avoiding the > callback > > inherent in

Re: [sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread Simon Slavin
On 21 Jun 2011, at 12:59pm, e-mail mgbg25171 wrote: > I was looking at prepare/step/finalise as a means of avoiding the callback > inherent in sqlite3_exec(). You do not need to use the callback if you don't want it to do anything. Just pass a NULL there. Simon.

Re: [sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread David Bicking
Since none of the statements is a SELECT, as far as I know the callback would never be called. You can pass a zero as the callback address. get_table will also handle all the statements in one pass, but will return an empty able, so you might as well use exec. David On 06/21/2011 07:59 AM,

Re: [sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread e-mail mgbg25171
Thank you Igor On 21 June 2011 12:52, Igor Tandetnik <itandet...@mvps.org> wrote: > e-mail mgbg25171 <mgbg25...@blueyonder.co.uk> wrote: > > Howto...multi-sqlite command string through sqlite3_prepare_v2() to > create SINGLE statement > > You can't do that. >

Re: [sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread e-mail mgbg25171
Thank you for the clarification re... sqlite3_prepareXXX() only processing 1 statement at a time as opposed to sqlite3_exec() which... can handle "combined multi statements" in one shot. I was looking at prepare/step/finalise as a means of avoiding the callback inherent in sqlite3_exec(). In the

Re: [sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread Igor Tandetnik
e-mail mgbg25171 <mgbg25...@blueyonder.co.uk> wrote: > Howto...multi-sqlite command string through sqlite3_prepare_v2() to create > SINGLE statement You can't do that. > sql = "BEGIN"; //you need to add newline here > sql += "create table episodes (id inte

Re: [sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread David Bicking
On 06/21/2011 07:22 AM, e-mail mgbg25171 wrote: > The commented out lines work. > I'm wondering... > a) is it possible to do what's not commented out > b) what's the syntax re the "sql =..." and "sql +=..." lines > Any help much appreciated! > > > sql = "BEGIN"; //you need to add newline here >

Re: [sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread e-mail mgbg25171
seperately. > > > > > > Michael D. Black > > Senior Scientist > > NG Information Systems > > Advanced Analytics Directorate > > > > > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on &g

Re: [sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread Black, Michael (IS)
entist NG Information Systems Advanced Analytics Directorate From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] on behalf of e-mail mgbg25171 [mgbg25...@blueyonder.co.uk] Sent: Tuesday, June 21, 2011 6:22 AM To: sqlite-users@sqlite.org Subject:

[sqlite] Howto...multi-sqlite command string through sqlite3_prepare_v2() to create SINGLE statement

2011-06-21 Thread e-mail mgbg25171
The commented out lines work. I'm wondering... a) is it possible to do what's not commented out b) what's the syntax re the "sql =..." and "sql +=..." lines Any help much appreciated! [code] //sql = "create table episodes (id integer primary key, season int, name text);"; rc =

Re: [sqlite] Command line client and Tcl interface behaves differently?

2010-11-20 Thread Fredrik Karlsson
Hi, Sorry, never mind this post. I haven't found the problem actually yet, but a "bare minimum" example fed directly to the interpreter through the command line works correctly: % package require sqlite3 3.7.2 % set inf [open 1_schema.sql r] file6 % set sql [read $inf] [... the contents of the

Re: [sqlite] Command line client and Tcl interface behaves differently?

2010-11-20 Thread Fredrik Karlsson
On Sat, Nov 20, 2010 at 2:43 PM, Richard Hipp wrote: > On Sat, Nov 20, 2010 at 8:25 AM, Fredrik Karlsson wrote: > >> Dear list, >> >> I am having a silly problem, and need your expertise. I just want to >> initiate a SQLite database using a schema file in Tcl,

Re: [sqlite] Command line client and Tcl interface behaves differently?

2010-11-20 Thread Richard Hipp
On Sat, Nov 20, 2010 at 8:25 AM, Fredrik Karlsson wrote: > Dear list, > > I am having a silly problem, and need your expertise. I just want to > initiate a SQLite database using a schema file in Tcl, but I just get > an empty database whatever I do. I asked this question on

[sqlite] Command line client and Tcl interface behaves differently?

2010-11-20 Thread Fredrik Karlsson
Dear list, I am having a silly problem, and need your expertise. I just want to initiate a SQLite database using a schema file in Tcl, but I just get an empty database whatever I do. I asked this question on the Tcl list, and got a reply which I interpret to mean that this is not a problem in my

Re: [sqlite] SQLite Command Line Shell.

2010-08-12 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/11/2010 10:28 PM, Kirk Clemons wrote: > I would like to be able to tell SQLite that if line 2 is bad just skip to > line 3 and so on until the database has been parsed all the through > maximizing the amount of data I retain. It would require

[sqlite] SQLite Command Line Shell.

2010-08-12 Thread Kirk Clemons
I am trying to alter the dump function of the command line shell. I am not completely familiar with C Programming so I am sort of in the dark here. As I understand it's workings now the .dump command performs a 'select *' on each row in row id order. If it encounters an error it skips to the end

Re: [sqlite] Command line tool always return the first column in a select

2010-08-04 Thread Benoit Aubuchon
ate > Northrop Grumman Information Systems > > > > > From: sqlite-users-boun...@sqlite.org on behalf of Benoit Aubuchon > Sent: Tue 8/3/2010 4:55 PM > To: sqlite-users@sqlite.org > Subject: EXTERNAL:[sqlite] Command line tool always r

Re: [sqlite] Command line tool always return the first column in a select

2010-08-04 Thread Black, Michael (IS)
Senior Scientist Advanced Analytics Directorate Northrop Grumman Information Systems From: sqlite-users-boun...@sqlite.org on behalf of Benoit Aubuchon Sent: Tue 8/3/2010 4:55 PM To: sqlite-users@sqlite.org Subject: EXTERNAL:[sqlite] Command line tool always return the

[sqlite] Command line tool always return the first column in a select

2010-08-04 Thread Benoit Aubuchon
Everytime I select something from a table I always get the first selected field only. Here's what I mean: # sqlite3 mytable.db SQLite version 3.6.22 Enter ".help" for instructions Enter SQL statements terminated with a ";" *sqlite> .show* echo: off explain: off headers: off mode:

[sqlite] Byte Order Mark in sqlite command line

2010-05-16 Thread ttessier
Hi, I just wanted to throw this out there. I was using sqlite command line in windows 7 today using a UTF-8 encoded file with A BOM. I was getting an issue where there was an sql error on line1 and a few records were getting inserted. This was a multi line file and each record insert

Re: [sqlite] command line does not accept arrow keys

2009-11-21 Thread Qianqian Fang
hi Jay Jay A. Kreibich wrote: > Yes. Readline support is not on by default. > > You need to compile it with -DHAVE_READLINE and add -lreadline > to the linker: > > $ cc -DHAVE_READLINE -o sqlite3 sqlite3.c shell.c -lreadline recompiling sqlite3 from source code with your command solved

Re: [sqlite] command line does not accept arrow keys

2009-11-20 Thread Jay A. Kreibich
On Fri, Nov 20, 2009 at 10:29:20PM -0500, Qianqian Fang scratched on the wall: > Is this possibly caused by how sqlite binary was compiled? Yes. Readline support is not on by default. You need to compile it with -DHAVE_READLINE and add -lreadline to the linker: $ cc -DHAVE_READLINE -o

Re: [sqlite] command line does not accept arrow keys

2009-11-20 Thread Qianqian Fang
I don't know, is there a way I can tell? the binary was downloaded from sqlite website, version is 3.6.2. The binary stores in a remote server, running Debian 3, I used ssh in a Terminator/gnome-terminal bash shell. I also installed sqlite on my local machine, running Ubuntu Karmic,

  1   2   >