Re: [sqlite] Clear screen in command line interface
John Stanton wrote: > Fred J. Stephens wrote: >> Would it be possible to incorporate a clear screen command, like "clear" >> in BASH? This would be handy to keep the view in the command line >> interface uncluttered. >> Maybe ".clear"? > You have the source and it uses curses so the addition should be fairly > simple. Now that I know about Ctrl-L, I can live with that. Fred ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] configure:2580: error: C compiler cannot create executables
Solved: Updating Xcode solved the problem! On 3/26/08 1:15 PM, "Mac Martine" <[EMAIL PROTECTED]> wrote: > > > Any ideas why I¹m getting this error when I try to install sqlite3 ? > > I run sudo ./configure --prefix=/usr/local¹ > > And I get: > > checking build system type... i386-apple-darwin9.2.2 > checking host system type... i386-apple-darwin9.2.2 > checking for gcc... gcc > checking for C compiler default output file name... > configure: error: C compiler cannot create executables > See `config.log' for more details. > > > Here¹ what I think is all the important stuff from th elog: > > ## --- ## > ## Core tests. ## > ## --- ## > > configure:2062: checking build system type > configure:2080: result: i386-apple-darwin9.2.2 > configure:2102: checking host system type > configure:2117: result: i386-apple-darwin9.2.2 > configure:2187: checking for gcc > configure:2203: found /usr/bin/gcc > configure:2214: result: gcc > configure:2452: checking for C compiler version > configure:2459: gcc --version >&5 > i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367) > Copyright (C) 2005 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > configure:2462: $? = 0 > configure:2469: gcc -v >&5 > Using built-in specs. > Target: i686-apple-darwin8 > Configured with: /private/var/tmp/gcc/gcc-5367.obj~1/src/configure > --disable-checking -enable-werror --prefix=/usr --mandir=/share/man > --enable-languages=c,objc,c++,obj-c++ > --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ > --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib > --build=powerpc-apple-darwin8 --with-arch=nocona --with-tune=generic > --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8 > Thread model: posix > gcc version 4.0.1 (Apple Computer, Inc. build 5367) > configure:2472: $? = 0 > configure:2479: gcc -V >&5 > gcc: argument to `-V' is missing > configure:2482: $? = 1 > configure:2505: checking for C compiler default output file name > configure:2532: gccconftest.c >&5 > /usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libSystem.dylib > unknown flags (type) of section 6 (__TEXT,__literal16) in load command 0 > collect2: ld returned 1 exit status > configure:2535: $? = 1 > configure:2573: result: > configure: failed program was: > | /* confdefs.h. */ > | #define PACKAGE_NAME "sqlite" > | #define PACKAGE_TARNAME "sqlite" > | #define PACKAGE_VERSION "3.5.7" > | #define PACKAGE_STRING "sqlite 3.5.7" > | #define PACKAGE_BUGREPORT "" > | /* end confdefs.h. */ > | > | int > | main () > | { > | > | ; > | return 0; > | } > configure:2580: error: C compiler cannot create executables > See `config.log' for more details. > > ## --- ## > ## confdefs.h. ## > ## --- ## > > #define PACKAGE_NAME "sqlite" > #define PACKAGE_TARNAME "sqlite" > #define PACKAGE_VERSION "3.5.7" > #define PACKAGE_STRING "sqlite 3.5.7" > #define PACKAGE_BUGREPORT "" > > configure: exit 77 > > > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Clear screen in command line interface
Fred J. Stephens wrote: > Would it be possible to incorporate a clear screen command, like "clear" > in BASH? This would be handy to keep the view in the command line > interface uncluttered. > Maybe ".clear"? You have the source and it uses curses so the addition should be fairly simple. > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] BCD representation of floats
We actually added this type of capability to Sqlite (actually fixed point display format numbers), but it may be unnecessary in your case. Instead of representing integers as BCD how about using the 64 bit Sqlite integers? You may have sufficient precision. The COBOL-style COMP3 integers are pretty much obsolete these days. Liam Healy wrote: > I am porting a numerical application from Oracle to SQLite. For the > most part, I have been successful, but there are slight disagreements > in the floating point number results. I have traced this back and > found a problem. According to > http://articles.techrepublic.com.com/5100-22_11-5224536.html, Oracle > by default stores floats as binary-coded decimal (BCD), and not > IEEE754 binary. SQLite on the other hand does > http://www.sqlite.org/datatype3.html: "REAL. The value is a floating > point value, stored as an 8-byte IEEE floating point number." For the > results of the application, it makes no difference how the numbers are > stored -- the differences in the 15th significant figure are > irrelevant. However, I would like to insure that there no > disagreements in the way the two applications operate (other than the > storage of floating point numbers), and for that I temporarily need > exact agreement on input numbers. I cannot change the Oracle > application, so I'm wondering if there's a wrapper or something I can > put around sqlite calls (or better, a mode that I can put sqlite in) > that will reproduce exactly the BCD format of Oracle. > > Thanks for any guidance. > > Liam > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Clear screen in command line interface
Derrell Lipman wrote: > In konsole (and xterm, I'm pretty sure), you can just hit CTRL-L to > clear the screen whenever you're at an sqlite> prompt. Excellent! Thats what I needed. Thank you. Fred ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Clear screen in command line interface
On 3/26/08, Derrell Lipman <[EMAIL PROTECTED]> wrote: > On Wed, Mar 26, 2008 at 4:14 PM, Fred J. Stephens <[EMAIL PROTECTED]> wrote: > > Mike McGonagle wrote: > > > Hum, on the Mac (10.4.9), the terminal window can be cleared from > within the > > > terminal program itself. I would imagine that other terminal programs > also > > > provide this. Does this functionality really need to be in SQLite? > > > Mike > > You're right I guess. In Konsole under KDE at least, there is a "Clear > > Terminal" command. > > With SQLite though it leaves you with a blank screen and no prompt. > > Hitting enter brings back the prompt, but at the BOTTOM of the screen. > > Better than nothing I guess. I just thought it would probably be trivial > > to add this to SQLite's command line program. > > > In konsole (and xterm, I'm pretty sure), you can just hit CTRL-L to > clear the screen whenever you're at an sqlite> prompt. > indeed, in Mac OS X Terminal v 2.0.1 as well. Thanks for a great tip. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Clear screen in command line interface
On Wed, Mar 26, 2008 at 4:14 PM, Fred J. Stephens <[EMAIL PROTECTED]> wrote: > Mike McGonagle wrote: > > Hum, on the Mac (10.4.9), the terminal window can be cleared from within > the > > terminal program itself. I would imagine that other terminal programs also > > provide this. Does this functionality really need to be in SQLite? > > Mike > You're right I guess. In Konsole under KDE at least, there is a "Clear > Terminal" command. > With SQLite though it leaves you with a blank screen and no prompt. > Hitting enter brings back the prompt, but at the BOTTOM of the screen. > Better than nothing I guess. I just thought it would probably be trivial > to add this to SQLite's command line program. In konsole (and xterm, I'm pretty sure), you can just hit CTRL-L to clear the screen whenever you're at an sqlite> prompt. Derrell ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] resetting a column back to its default value
Hello Puneet, I guess I can select and reinsert all columns except for the column with the default value. I guess it would be nice (efficient) to update a single column to its default value via the update command. Thanks, -Alex On Tue, Mar 25, 2008 at 1:40 PM, P Kishor <[EMAIL PROTECTED]> wrote: > On 3/25/08, Alex Katebi <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I was woundering how I can update a column in my table back to its > default > > value. > > > > For example: > > > > create table t1 (value integer default 55, name text); > > insert into t1(name) values('hello'); > > update t1 set value=default; /* for illustration only */ > > you do realize that the above update will try to update the value of > the column 'value' to the value of a mysterious column called > 'default'. Still, going on... > > > > > How can I achive the desired behavior short of doing "update t1 set > > value=55" > > > > insert into t1(name) values('hello'); > > automatically sets the value of the column called 'value' to 55, so > your question is answered by exactly what you are doing. > > > > Thanks, > > -Alex > > > -- > Puneet Kishor > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] resetting a column back to its default value
Hello Puneet, On Tue, Mar 25, 2008 at 1:40 PM, P Kishor <[EMAIL PROTECTED]> wrote: > On 3/25/08, Alex Katebi <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I was woundering how I can update a column in my table back to its > default > > value. > > > > For example: > > > > create table t1 (value integer default 55, name text); > > insert into t1(name) values('hello'); > > update t1 set value=default; /* for illustration only */ > > you do realize that the above update will try to update the value of > the column 'value' to the value of a mysterious column called > 'default'. Still, going on... > > > > > How can I achive the desired behavior short of doing "update t1 set > > value=55" > > > > insert into t1(name) values('hello'); > > automatically sets the value of the column called 'value' to 55, so > your question is answered by exactly what you are doing. > > > > Thanks, > > -Alex > > > -- > Puneet Kishor > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] [PHP] Compiling with latest SQLite?
On Wed, 26 Mar 2008 23:32:44 +0100, you wrote: >Hello > >I noticed that the PDO::SQLite driver that comes with PHP 5.2.5 is >3.3.17, while the non-OOP version is 2.8.17. > >Does someone know how to recompile PHP with the latest SQLite source? You don't have to, the alternative is: extension=php_pdo_sqlite_external.dll plus the current sqlite3.dll That works for me. php_pdo_sqlite_external.dll can be in the php/ext directory, as usual. You may have to copy sqlite3.dll to the apache/bin directory. >Thank you. HTH -- ( Kees Nuyt ) c[_] ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] [PHP] Compiling with latest SQLite?
Hello I noticed that the PDO::SQLite driver that comes with PHP 5.2.5 is 3.3.17, while the non-OOP version is 2.8.17. Does someone know how to recompile PHP with the latest SQLite source? Thank you. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Clear screen in command line interface
Imho the shell should rather implement the ! command to ask the bash (or other shell) to execute a command in its preferred format. This way any executable could be launched from sqlites command prompt. A clear screen would be available as !clear or !cls. Michael -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Fred J. Stephens Gesendet: Mittwoch, 26. März 2008 21:15 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Clear screen in command line interface Mike McGonagle wrote: > Hum, on the Mac (10.4.9), the terminal window can be cleared from > within the terminal program itself. I would imagine that other > terminal programs also provide this. Does this functionality really need to be in SQLite? > Mike You're right I guess. In Konsole under KDE at least, there is a "Clear Terminal" command. With SQLite though it leaves you with a blank screen and no prompt. Hitting enter brings back the prompt, but at the BOTTOM of the screen. Better than nothing I guess. I just thought it would probably be trivial to add this to SQLite's command line program. Fred > On Wed, Mar 26, 2008 at 1:59 PM, Fred J. Stephens <[EMAIL PROTECTED]> wrote: > >> Would it be possible to incorporate a clear screen command, like "clear" >> in BASH? This would be handy to keep the view in the command line >> interface uncluttered. >> Maybe ".clear"? >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> > > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] configure:2580: error: C compiler cannot create executables
Any ideas why I¹m getting this error when I try to install sqlite3 ? I run sudo ./configure --prefix=/usr/local¹ And I get: checking build system type... i386-apple-darwin9.2.2 checking host system type... i386-apple-darwin9.2.2 checking for gcc... gcc checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. Here¹ what I think is all the important stuff from th elog: ## --- ## ## Core tests. ## ## --- ## configure:2062: checking build system type configure:2080: result: i386-apple-darwin9.2.2 configure:2102: checking host system type configure:2117: result: i386-apple-darwin9.2.2 configure:2187: checking for gcc configure:2203: found /usr/bin/gcc configure:2214: result: gcc configure:2452: checking for C compiler version configure:2459: gcc --version >&5 i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:2462: $? = 0 configure:2469: gcc -v >&5 Using built-in specs. Target: i686-apple-darwin8 Configured with: /private/var/tmp/gcc/gcc-5367.obj~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=powerpc-apple-darwin8 --with-arch=nocona --with-tune=generic --program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8 Thread model: posix gcc version 4.0.1 (Apple Computer, Inc. build 5367) configure:2472: $? = 0 configure:2479: gcc -V >&5 gcc: argument to `-V' is missing configure:2482: $? = 1 configure:2505: checking for C compiler default output file name configure:2532: gccconftest.c >&5 /usr/bin/ld: /usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libSystem.dylib unknown flags (type) of section 6 (__TEXT,__literal16) in load command 0 collect2: ld returned 1 exit status configure:2535: $? = 1 configure:2573: result: configure: failed program was: | /* confdefs.h. */ | #define PACKAGE_NAME "sqlite" | #define PACKAGE_TARNAME "sqlite" | #define PACKAGE_VERSION "3.5.7" | #define PACKAGE_STRING "sqlite 3.5.7" | #define PACKAGE_BUGREPORT "" | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:2580: error: C compiler cannot create executables See `config.log' for more details. ## --- ## ## confdefs.h. ## ## --- ## #define PACKAGE_NAME "sqlite" #define PACKAGE_TARNAME "sqlite" #define PACKAGE_VERSION "3.5.7" #define PACKAGE_STRING "sqlite 3.5.7" #define PACKAGE_BUGREPORT "" configure: exit 77 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Clear screen in command line interface
Mike McGonagle wrote: > Hum, on the Mac (10.4.9), the terminal window can be cleared from within the > terminal program itself. I would imagine that other terminal programs also > provide this. Does this functionality really need to be in SQLite? > Mike You're right I guess. In Konsole under KDE at least, there is a "Clear Terminal" command. With SQLite though it leaves you with a blank screen and no prompt. Hitting enter brings back the prompt, but at the BOTTOM of the screen. Better than nothing I guess. I just thought it would probably be trivial to add this to SQLite's command line program. Fred > On Wed, Mar 26, 2008 at 1:59 PM, Fred J. Stephens <[EMAIL PROTECTED]> wrote: > >> Would it be possible to incorporate a clear screen command, like "clear" >> in BASH? This would be handy to keep the view in the command line >> interface uncluttered. >> Maybe ".clear"? >> ___ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> > > > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Clear screen in command line interface
Hum, on the Mac (10.4.9), the terminal window can be cleared from within the terminal program itself. I would imagine that other terminal programs also provide this. Does this functionality really need to be in SQLite? Mike On Wed, Mar 26, 2008 at 1:59 PM, Fred J. Stephens <[EMAIL PROTECTED]> wrote: > Would it be possible to incorporate a clear screen command, like "clear" > in BASH? This would be handy to keep the view in the command line > interface uncluttered. > Maybe ".clear"? > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Peace may sound simple—one beautiful word— but it requires everything we have, every quality, every strength, every dream, every high ideal. —Yehudi Menuhin (1916–1999), musician ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Clear screen in command line interface
Would it be possible to incorporate a clear screen command, like "clear" in BASH? This would be handy to keep the view in the command line interface uncluttered. Maybe ".clear"? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] sqlite3 open error with apache filter module
Hi guys: Iam using sqlite3 library in apache filter module(I call the sqlite3funciton in input filter and output filter). Now there is a problem:when the apache is working in debug mode, the sqlite3 can create dbfile; but when apache is working in normal mode, the sqlite3 returnSQLITE3_CANTOPEN error; do you have any ideas to resolve this problem? Thanks Jack __ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/ ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] BCD representation of floats
Liam, I know a great deal about oracle internals, Oracle stores "numbers" as you indicate in a bcd format. But It can be up to 22 bytes long. But usage in oracle proc/proc++/sql/plsql is really dependent upon your native conversion to host datatype. The number storage formats betweend Sqlite and Oracle are totally different. I don't think there is much your going to be able to do since the storage is different, most likely the precision is also going to be different and hence the outputs. Maybe you could implement a deviation check in your sqlite code. If the number produced fromsqlite matches oracle within a range +/- some number. Then it is considered equal. Also as your article implies you could modify the oracle data type to be a binary_float or binary_double which would store the value in a "native" ieee format instead of the NUMBER (which is more accurate). Another thought: Role your own NUMBER data type !!! Create a function inside sqlite that would basically implement an oracle Number representation. This should then produce exact match to oracle (in theory). You could use a text field or blob field to store the number datatype. Then apply your conversion function to it! HTH, Ken Liam Healy <[EMAIL PROTECTED]> wrote: I am porting a numerical application from Oracle to SQLite. For the most part, I have been successful, but there are slight disagreements in the floating point number results. I have traced this back and found a problem. According to http://articles.techrepublic.com.com/5100-22_11-5224536.html, Oracle by default stores floats as binary-coded decimal (BCD), and not IEEE754 binary. SQLite on the other hand does http://www.sqlite.org/datatype3.html: "REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number." For the results of the application, it makes no difference how the numbers are stored -- the differences in the 15th significant figure are irrelevant. However, I would like to insure that there no disagreements in the way the two applications operate (other than the storage of floating point numbers), and for that I temporarily need exact agreement on input numbers. I cannot change the Oracle application, so I'm wondering if there's a wrapper or something I can put around sqlite calls (or better, a mode that I can put sqlite in) that will reproduce exactly the BCD format of Oracle. Thanks for any guidance. Liam ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQL error: SQL logic error or missing database
yes i have write permissions ! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ken Sent: Wednesday, March 26, 2008 7:55 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL error: SQL logic error or missing database do you have write permissions on mdiadb and the directory??? BanuPrakash G <[EMAIL PROTECTED]> wrote: Database or disk is full is the Error message i get from the sqlite :root> ./sqlite3 mediadb.sql SQLite version 3.5.7 Enter ".help" for instructions sqlite> CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100)); SQL error: database or disk is full sqlite> BFOS:root> df Filesystem 1k-blocks Used Available Use% Mounted on /dev/root 495016190848278616 41% / /dev/hda1 494984141452327984 30% /mnt :root> -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of BanuPrakash G Sent: Wednesday, March 26, 2008 12:19 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL error: SQL logic error or missing database Even create a database i.e. ./sqlite mydb.db3 when i attemt to execute any command i.e. create tables,insert etc i see the ERROR Message SQL error: SQL logic error or missing database. I think because of some library dependency this issue is being observed ...any pointers ?? Thanks /BP -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prabowo Murti Sent: Tuesday, March 25, 2008 9:18 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL error: SQL logic error or missing database BanuPrakash G wrote: > Hi, > > I have used the latest verision of sqlite i.e. sqlite-3.5.7 > Amalgamation release for PPC Arch. > > I was able to cross compile it successfull and when i use the db to > create tables I see on the SQLITE shell the ERROR message as "SQL > error: SQL logic error or missing database". > > i.e. > > ./sqlite3 > SQLite version 3.5.7 > Enter ".help" for instructions > sqlite> CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100)); > SQL error: SQL logic error or missing database > > > > Can anybody point me out where exactly I am wrong ? > > > Thanks > /BP > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > Hi You have to create a database first. Create a table before a database is like build a window without house :) I am using sqlite3 on Ubuntu. $ sqlite3 mydb.db3 I am new in sqlite. Cmiiw. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] BCD representation of floats
I am porting a numerical application from Oracle to SQLite. For the most part, I have been successful, but there are slight disagreements in the floating point number results. I have traced this back and found a problem. According to http://articles.techrepublic.com.com/5100-22_11-5224536.html, Oracle by default stores floats as binary-coded decimal (BCD), and not IEEE754 binary. SQLite on the other hand does http://www.sqlite.org/datatype3.html: "REAL. The value is a floating point value, stored as an 8-byte IEEE floating point number." For the results of the application, it makes no difference how the numbers are stored -- the differences in the 15th significant figure are irrelevant. However, I would like to insure that there no disagreements in the way the two applications operate (other than the storage of floating point numbers), and for that I temporarily need exact agreement on input numbers. I cannot change the Oracle application, so I'm wondering if there's a wrapper or something I can put around sqlite calls (or better, a mode that I can put sqlite in) that will reproduce exactly the BCD format of Oracle. Thanks for any guidance. Liam ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] insert of string with line breaks
I've got an AIR app that does simple inserts into a SQLite db. The insert looks like so: var insStmt:SQLStatement = new SQLStatement(); insStmt.sqlConnection = dbconnection; sql = "insert into hours(description,projectidfk,clientidfk,hours,date) values(:description,:projectidfk,:clientidfk,:hours,:date)"; insStmt.parameters[":description"] = descriptionfield.text; insStmt.parameters[":projectidfk"] = projectfield.selectedItem.id; insStmt.parameters[":clientidfk"] = projectfield.selectedItem.clientid; insStmt.parameters[":hours"] = hoursworkedfield.value; insStmt.parameters[":date"] = dateworkedfield.selectedDate; trace('desc is '+descriptionfield.text); insStmt.text = sql; insStmt.addEventListener(SQLEvent.RESULT, refreshHandler); Notice I'm using bound parameters for all my values. The description field is a text box. When I enter text with line breaks in it, the db only gets line one of description. Any ideas why? A string is a string even if it has line breaks in it - afaik. -- === Raymond Camden, Owner of Camden Media, Inc. Email: [EMAIL PROTECTED] Blog : www.coldfusionjedi.com AOL IM : cfjedimaster "My ally is the Force, and a powerful ally it is." - Yoda ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQL error: SQL logic error or missing database
Hi, My system do have Memory : 2000 MB is it fine for sqlitie to start on with ? Is their any disk size limitation for sqlite i.e.Incase do sqlite require a min of any n MB disk to make transactions ? BFOS:root> ./sqlite3 bhanu.db SQLite version 3.5.7 Enter ".help" for instructions sqlite> .databases seq name file --- --- -- 0main /root/bhanu.db sqlite> CREATE TABLE t1(a INTEGER); SQL error: database or disk is full sqlite> Thanks /BP -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of BanuPrakash G Sent: Wednesday, March 26, 2008 12:19 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL error: SQL logic error or missing database Even create a database i.e. ./sqlite mydb.db3 when i attemt to execute any command i.e. create tables,insert etc i see the ERROR Message SQL error: SQL logic error or missing database. I think because of some library dependency this issue is being observed ...any pointers ?? Thanks /BP -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prabowo Murti Sent: Tuesday, March 25, 2008 9:18 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL error: SQL logic error or missing database BanuPrakash G wrote: > Hi, > > I have used the latest verision of sqlite i.e. sqlite-3.5.7 > Amalgamation release for PPC Arch. > > I was able to cross compile it successfull and when i use the db to > create tables I see on the SQLITE shell the ERROR message as "SQL > error: SQL logic error or missing database". > > i.e. > > ./sqlite3 > SQLite version 3.5.7 > Enter ".help" for instructions > sqlite> CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100)); > SQL error: SQL logic error or missing database > > > > Can anybody point me out where exactly I am wrong ? > > > Thanks > /BP > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > Hi You have to create a database first. Create a table before a database is like build a window without house :) I am using sqlite3 on Ubuntu. $ sqlite3 mydb.db3 I am new in sqlite. Cmiiw. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQL error: SQL logic error or missing database
BanuPrakash G wrote: > Database or disk is full is the Error message i get from the sqlite > > :root> ./sqlite3 mediadb.sql > SQLite version 3.5.7 > Enter ".help" for instructions > sqlite> CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100)); > SQL error: database or disk is full > > sqlite> BFOS:root> df > Filesystem 1k-blocks Used Available Use% Mounted on > /dev/root 495016190848278616 41% / > /dev/hda1 494984141452327984 30% /mnt > :root> > Do you have write permission in the directory where where your sqlite3 program is? SQLite needs write permission to create the database file and to open the journal file for any change to the database. HTH Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQL error: SQL logic error or missing database
do you have write permissions on mdiadb and the directory??? BanuPrakash G <[EMAIL PROTECTED]> wrote: Database or disk is full is the Error message i get from the sqlite :root> ./sqlite3 mediadb.sql SQLite version 3.5.7 Enter ".help" for instructions sqlite> CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100)); SQL error: database or disk is full sqlite> BFOS:root> df Filesystem 1k-blocks Used Available Use% Mounted on /dev/root 495016190848278616 41% / /dev/hda1 494984141452327984 30% /mnt :root> -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of BanuPrakash G Sent: Wednesday, March 26, 2008 12:19 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL error: SQL logic error or missing database Even create a database i.e. ./sqlite mydb.db3 when i attemt to execute any command i.e. create tables,insert etc i see the ERROR Message SQL error: SQL logic error or missing database. I think because of some library dependency this issue is being observed ...any pointers ?? Thanks /BP -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prabowo Murti Sent: Tuesday, March 25, 2008 9:18 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL error: SQL logic error or missing database BanuPrakash G wrote: > Hi, > > I have used the latest verision of sqlite i.e. sqlite-3.5.7 > Amalgamation release for PPC Arch. > > I was able to cross compile it successfull and when i use the db to > create tables I see on the SQLITE shell the ERROR message as "SQL > error: SQL logic error or missing database". > > i.e. > > ./sqlite3 > SQLite version 3.5.7 > Enter ".help" for instructions > sqlite> CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100)); > SQL error: SQL logic error or missing database > > > > Can anybody point me out where exactly I am wrong ? > > > Thanks > /BP > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > Hi You have to create a database first. Create a table before a database is like build a window without house :) I am using sqlite3 on Ubuntu. $ sqlite3 mydb.db3 I am new in sqlite. Cmiiw. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Multithreads access the same database resultingin database is locked error
There can be only one thread that has an exclusive write lock on the database. Most likely this is a bug in your application. Heres what I do for my multi threaded app: 1. All transactions use "begin immediate" (that way I don't do a bunch of work only to find the db locked later). 2. The begin immediate is wrapped in a while loop, do { begin immediate } while (sqlite busy || sqlite locked). 3. Commit the transaction. 4. Select statements else where can also get sqlite_busy. This happens due to the exclusive lock above! Its just the way sqlite works. So, select statements the first step command can get a sqlite busy. S prepare refetch: step if sqlite busy sleep a while goto refetch do { work step } while (sqlite_row) HTH Xuanvinh Vu <[EMAIL PROTECTED]> wrote: I didnt realize that it could cause livelocks. Thank you for bringing that to my attention. It still doesnt explain why the database stays locked. I could just ignore the error and wait to update the database the next time the thread runs again. What I want to know is why once I got the exception that the database is locked it stays locked and I cant update the databases with other threads. _ Watch Cause Effect, a show about real people making a real difference. Learn more. http://im.live.com/Messenger/IM/MTV/?source=text_watchcause ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] sqlite3_mprintf and Prepare
Igor Tandetnik Wrote: >The first case is slower, since it has to make an extra sqlite3_mprintf >call (that achieves precisely nothing). Thanks a lot Igor.Its am clear now. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] sqlite3_mprintf and Prepare
"Mahalakshmi.m" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I want to know why we have to use sqlite3_mprintf before > sqlite3_prepare() We don't; wherever did you get this idea from? > Case 1: > Query = sqlite3_mprintf ("DELETE FROM MUSIC WHERE URL = ?;"); > sqlite3_prepare(db, Query ,-1,&stmt,0); > sqlite3_free(Query); > > case 2: > We can also use directly - sqlite3_prepare(db, "DELETE FROM MUSIC > WHERE URL = ?;",-1,&stmt,0); > > Will there be any performance difference between case 1 and > case2. The first case is slower, since it has to make an extra sqlite3_mprintf call (that achieves precisely nothing). > Sometimes I am using sprintf instead of sqlite3_mprintf.will both > have the same functionality. sprintf requires you to provide an output buffer (but not its length, risking a buffer overrun). sqlite3_mprintf allocates its buffer (of an appropriate size) on the heap (which you have to free afterwards). Also, sqlite3_mprintf supports an extra format specifier - %m if I remember correctly - which takes a string and turns it into correctly escaped SQL string literal. This helps protect against SQL injection attacks (but using a parameterized prepared statement is still better). > sprintf(buff,"DELETE FROM MUSIC WHERE URL = ?;"); > sqlite3_prepare(db, buff,-1,&stmt,0); You don't need sprintf here either. Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] finding rows within a certain time interval of another row
"P Kishor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Given a table t (name, date) > > I want to find all rows within, say, 6 months of a specific row, say > name = 'foo'. So, I am doing > > SELECT name > FROM t > WHERE >(SELECT julianday(date) FROM t WHERE name = 'foo') - > julianday(date) < 180 OR > julianday(date) - (SELECT julianday(date) FROM t WHERE name = > 'foo') < 180 select t1.name from t t1, t t2 where t2.name='foo' and julianday(t1.date) - julianday(t2.date) between -180 and 180; Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQL error: SQL logic error or missing database
Database or disk is full is the Error message i get from the sqlite :root> ./sqlite3 mediadb.sql SQLite version 3.5.7 Enter ".help" for instructions sqlite> CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100)); SQL error: database or disk is full sqlite> BFOS:root> df Filesystem 1k-blocks Used Available Use% Mounted on /dev/root 495016190848278616 41% / /dev/hda1 494984141452327984 30% /mnt :root> -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of BanuPrakash G Sent: Wednesday, March 26, 2008 12:19 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL error: SQL logic error or missing database Even create a database i.e. ./sqlite mydb.db3 when i attemt to execute any command i.e. create tables,insert etc i see the ERROR Message SQL error: SQL logic error or missing database. I think because of some library dependency this issue is being observed ...any pointers ?? Thanks /BP -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Prabowo Murti Sent: Tuesday, March 25, 2008 9:18 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQL error: SQL logic error or missing database BanuPrakash G wrote: > Hi, > > I have used the latest verision of sqlite i.e. sqlite-3.5.7 > Amalgamation release for PPC Arch. > > I was able to cross compile it successfull and when i use the db to > create tables I see on the SQLITE shell the ERROR message as "SQL > error: SQL logic error or missing database". > > i.e. > > ./sqlite3 > SQLite version 3.5.7 > Enter ".help" for instructions > sqlite> CREATE TABLE t1(a INTEGER, b INTEGER, c VARCHAR(100)); > SQL error: SQL logic error or missing database > > > > Can anybody point me out where exactly I am wrong ? > > > Thanks > /BP > > > > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > Hi You have to create a database first. Create a table before a database is like build a window without house :) I am using sqlite3 on Ubuntu. $ sqlite3 mydb.db3 I am new in sqlite. Cmiiw. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] sqlite3_mprintf and Prepare
Hi, I want to know why we have to use sqlite3_mprintf before sqlite3_prepare() Case 1: Query = sqlite3_mprintf ("DELETE FROM MUSIC WHERE URL = ?;"); sqlite3_prepare(db, Query ,-1,&stmt,0); sqlite3_free(Query); case 2: We can also use directly - sqlite3_prepare(db, "DELETE FROM MUSIC WHERE URL = ?;",-1,&stmt,0); Will there be any performance difference between case 1 and case2.Kindly help me to solve.Right now I am directly passing the Sqlite staments inside sqlite3_prepare().Do I need to use sqlite3_mprintf or not needed. Sometimes I am using sprintf instead of sqlite3_mprintf.will both have the same functionality.After calling sqlite3_mprintf()we are freeing using sqlite3_free but not sprintf(). sprintf(buff,"DELETE FROM MUSIC WHERE URL = ?;"); sqlite3_prepare(db, buff,-1,&stmt,0); Thanks & Regards, Mahalakshmi ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users