Re: [sqlite] Date Selection

2008-06-12 Thread Federico Granata
On Thu, Jun 12, 2008 at 5:50 AM, Harold Wood [EMAIL PROTECTED] wrote:

 Hello Igor
 the create table statement:

 CREATE TABLE Items
  (
  ID INT NOT NULL PRIMARY KEY ASC,
  SubCatId  INT NOT NULL,
  Description VARCHAR(60) NOT NULL,
  LastUnitPrice NUMERIC(6,2) DEFAULT 0.0,
  AvgUnitPrice NUMERIC(6,2) DEFAULT 0.0,
  MinUnitPrice NUMERIC(6,2) DEFAULT 0.0,
  LastPurchaseDate DATETIME,
  LastQtyPurchase  NUMERIC(6,2) DEFAULT 0.0,
  PurchaseUnit VARCHAR(20),
  NumTimesPurchased INT DEFAULT 0,
  NeedIt  BIT DEFAULT 0,
  FOREIGN KEY (SubCatId) REFERENCES Subcategory(ID)
  );

where is DateCol ?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Date Selection

2008-06-12 Thread Igor Tandetnik
Harold Wood [EMAIL PROTECTED]
wrote in message news:[EMAIL PROTECTED]
 the create table statement:

 LastPurchaseDate DATETIME,

You seem to be under impression there's a dedicated DATETIME type in 
SQLite. This is not the case: it's just the nature of SQLite's manifest 
typing (http://sqlite.org/datatype3.html) that allows one to specify any 
odd identifier as a column type.

You have a choice of storing dates and times as strings (e.g. 
'2008-06-10'), as integer number of seconds since Unix epoch, or as 
floating point Julian day number. You manipulate these representations 
using built-in date/time functions:

http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions

Igor Tandetnik



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Math Functions

2008-06-12 Thread Alexey Pechnikov
В сообщении от Friday 06 June 2008 03:51:38 P Kishor написал(а):
 http://sqlite.org/contrib/download/extension-functions.c?get=22

$ wget http://sqlite.org/contrib/download/extension-functions.c?get=22
$ mv extension-functions.c?get=22 extension-functions.c
$ gcc -fPIC -shared extension-functions.c -o libsqlitefunctions.so
$ sqlite3 :memory:
SQLite version 3.5.9
Enter .help for instructions
sqlite SELECT load_extension('./libsqlitefunctions.so');
SQL error: ./libsqlitefunctions.so: undefined symbol: log

What can I do?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3.lib for ARMV4T processor

2008-06-12 Thread sqlite

Dear All,

  We are using SQLite for our application development which would be
deployed in a pocket pc of type DTX 10 processor ARMV4T.Also we have
generated the lib file specific for ARM processor using the LIB.exe with the
parameters DEF:sqlite3.def MACHINE:ARM and the sqlite3.lib and sqlite3.dll
files are generated. When we compiled the application with the sqlite
functions like sqlite3_open() the application gets compiled and the exe also
gets generated with out any errors. But when we run the application in the
DTX10 device it throws an error Application is not a valid WINCE
application but when we remove the function call sqlite3_open() from the
application and run it in the device it is running without any errors. Have
we generated the sqlite3.lib and sqlite3.dll files correctly? because we
have mentioned the machine name as ARM and using the sqlite3.lib file for
ARMV4T processor, is it correct? if not how to generate the sqlite3.lib file
for the processor ARMV4T, kindly help us in this regard. Or if possible
provide us the sqlite3.lib file meant for ARMV4T processor.

Thanks
Kartthikeyan
-- 
View this message in context: 
http://www.nabble.com/sqlite3.lib-for-ARMV4T-processor-tp17798977p17798977.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Math Functions

2008-06-12 Thread Liam Healy
In the file you have downloaded, there is the following statement:

Note: You cannot use these functions from the sqlite3 program, you
must write your own program using the sqlite3 API, and call
sqlite3_enable_load_extension.  See Security Considerations in
http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions.

When I try your load from the command line, I get a similar
(but not the same) error.
 sqlite SELECT load_extension('./libsqlitefunctions.so');
 SQL error: ./libsqlitefunctions.so: undefined symbol: sqrt
and I certainly have a sqrt function and use these extensions
without problems.  So I guess it's a symptom of the security feature
in sqlite that prohibits loading extensions.

On the chance that log is not defined for your environment.
I recommend you change the line
#define HAVE_LOG10 1
to
#define HAVE_LOG10 0
and try again.

Liam

On Thu, Jun 12, 2008 at 8:26 AM, Alexey Pechnikov [EMAIL PROTECTED] wrote:
 В сообщении от Friday 06 June 2008 03:51:38 P Kishor написал(а):
 http://sqlite.org/contrib/download/extension-functions.c?get=22

 $ wget http://sqlite.org/contrib/download/extension-functions.c?get=22
 $ mv extension-functions.c?get=22 extension-functions.c
 $ gcc -fPIC -shared extension-functions.c -o libsqlitefunctions.so
 $ sqlite3 :memory:
 SQLite version 3.5.9
 Enter .help for instructions
 sqlite SELECT load_extension('./libsqlitefunctions.so');
 SQL error: ./libsqlitefunctions.so: undefined symbol: log

 What can I do?
 ___
 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] sqlite3.lib for ARMV4T processor

2008-06-12 Thread Virgilio Fornazin
IF you are using SQLite with eVC, you must enabled function level linking,
because
ARM linkers had a bug before eVC SP4 that generated corrupt image files.

On Thu, Jun 12, 2008 at 9:39 AM, sqlite [EMAIL PROTECTED] wrote:


 Dear All,

  We are using SQLite for our application development which would be
 deployed in a pocket pc of type DTX 10 processor ARMV4T.Also we have
 generated the lib file specific for ARM processor using the LIB.exe with
 the
 parameters DEF:sqlite3.def MACHINE:ARM and the sqlite3.lib and sqlite3.dll
 files are generated. When we compiled the application with the sqlite
 functions like sqlite3_open() the application gets compiled and the exe
 also
 gets generated with out any errors. But when we run the application in the
 DTX10 device it throws an error Application is not a valid WINCE
 application but when we remove the function call sqlite3_open() from the
 application and run it in the device it is running without any errors. Have
 we generated the sqlite3.lib and sqlite3.dll files correctly? because we
 have mentioned the machine name as ARM and using the sqlite3.lib file for
 ARMV4T processor, is it correct? if not how to generate the sqlite3.lib
 file
 for the processor ARMV4T, kindly help us in this regard. Or if possible
 provide us the sqlite3.lib file meant for ARMV4T processor.

 Thanks
 Kartthikeyan
 --
 View this message in context:
 http://www.nabble.com/sqlite3.lib-for-ARMV4T-processor-tp17798977p17798977.html
 Sent from the SQLite mailing list archive at Nabble.com.

 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Math Functions

2008-06-12 Thread Alexey Pechnikov
 Note: You cannot use these functions from the sqlite3 program, you
 must write your own program using the sqlite3 API, and call
 sqlite3_enable_load_extension.  See Security Considerations in
 http://www.sqlite.org/cvstrac/wiki?p=LoadableExtensions.

I can load other extensions and use them.

 When I try your load from the command line, I get a similar
 (but not the same) error.
  sqlite SELECT load_extension('./libsqlitefunctions.so');
  SQL error: ./libsqlitefunctions.so: undefined symbol: sqrt
 and I certainly have a sqrt function and use these extensions
 without problems.  So I guess it's a symptom of the security feature
 in sqlite that prohibits loading extensions.

sqlite SELECT load_extension('./libsqlitefunctions.so');
SQL error: ./libsqlitefunctions.so: undefined symbol: log
sqlite select sqrt(1);
SQL error: no such function: sqrt

 On the chance that log is not defined for your environment.
 I recommend you change the line
 #define HAVE_LOG10 1
 to
 #define HAVE_LOG10 0
 and try again.

I try with no effect.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Upgrade from 3.4.2 to 3.5.9 breaks Tcl code

2008-06-12 Thread Jeff Godfrey
Hm... I sent this message last night as a non-list member.  I 
received a notification that it would need to be approved by a moderator 
before being made public.  About 15 hours later, I received a Post was 
rejected... No reason given message.  Why's that?  So now I'm 
subscribed again.  Anyway...

==

Hi All,

I am upgrading a Tcl/SQLite based application from SQLite 3.4.2 to 
SQLite 3.5.9.  I'll mention that I'm also upgrading from Tcl 8.4.19 to 
Tcl 8.5.2 in case it's relevant, though both versions of Tcl behave the 
same when using SQLite 3.5.9.

Anyway, I have a number of procedures that operate like the following:

dbMem eval {select distinct(owner) from lockinfo order by owner} {
   do something with $owner
}

That works correctly in my original app using 3.4.2, but complains that 
there is no such variable owner when using 3.5.9.  Interestingly, I've 
found that the above code works under 3.5.2 when not inside a Tcl 
procedure.  Inside the procedure though, it breaks as described.  Also, 
a few other variations...

Inside a procedure, using 3.5.2, replacing distinct(owner) with just 
owner works correctly and replacing distinct(owner) with just * 
works correctly, though neither obviously does what I need.

Is this an intended change to SQLite Tcl bindings, a bug, or just 
something else I'm missing?

Thanks for any insight.

Jeff Godfrey



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Upgrade from 3.4.2 to 3.5.9 breaks Tcl code

2008-06-12 Thread D. Richard Hipp

On Jun 12, 2008, at 11:08 PM, Jeff Godfrey wrote:

 dbMem eval {select distinct(owner) from lockinfo order by owner} {
   do something with $owner
 }

 That works correctly in my original app using 3.4.2, but complains  
 that
 there is no such variable owner when using 3.5.9.

Solution 1:

   dbMem eval {SELECT DISTINCT owner FROM lockinfo ORDER BY owner} {
  puts $owner
   }

Solution 2:

   dbMem eval {SELECT DISTINCT(owner) AS owner FROM lockinfo ORDER BY  
owner} {
   puts $owner
   }

Solution 3:

   dbMem eval {SELECT DISTINCT(owner) FROM lockinfo ORDER BY owner} {
  puts ${(owner)}
   }



D. Richard Hipp
[EMAIL PROTECTED]



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] datetime bug

2008-06-12 Thread Dennis Cote
BareFeet wrote:
 
 I get the same result above when using the command line tool of the  
 built in SQLite version 3.4.0 or the latest binary version 3.5.9.
 
 FYI, this: select julianday('2008-06-12','utc');
 gives: 2454629.0833
 
 and this:  select datetime(2454629.0833, 'localtime');
 gives: 2008-06-11 24:00:00
 

Tom,

There does seem to be a roundoff error in the calculation while adding 
the local timezone offset.

SQLite version 3.5.9
Enter .help for instructions
sqlite select datetime(2454629.0833);
2008-06-11 14:00:00

The base value for the hour is 14, and you are in a timezone with a +10 
hour offset. It must be coming up with a sum that is slightly less than 
24 hours so that it doesn't increment the day. The value is rounded 
correctly when formatted for display. More fun with floating point 
representation. :-)

Dennis Cote



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Upgrade from 3.4.2 to 3.5.9 breaks Tcl code

2008-06-12 Thread Jeff Godfrey
D. Richard Hipp wrote:
 On Jun 12, 2008, at 11:08 PM, Jeff Godfrey wrote:
   
 dbMem eval {select distinct(owner) from lockinfo order by owner} {
   do something with $owner
 }

 That works correctly in my original app using 3.4.2, but complains  
 that
 there is no such variable owner when using 3.5.9.
 

 Solution 1:

dbMem eval {SELECT DISTINCT owner FROM lockinfo ORDER BY owner} {
   puts $owner
}

 Solution 2:

dbMem eval {SELECT DISTINCT(owner) AS owner FROM lockinfo ORDER BY  
 owner} {
puts $owner
}

 Solution 3:

dbMem eval {SELECT DISTINCT(owner) FROM lockinfo ORDER BY owner} {
   puts ${(owner)}
}
   
Thanks for the quick solution.  I've adjusted my code accordingly.  So, 
do you consider this a buglet or more just the closing of a gap that 
shouldn't have existed in the first place?  It's interesting that the 
original code works outside of a proc in 3.5.9, but not inside...

Again - thanks.

Jeff
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Upgrade from 3.4.2 to 3.5.9 breaks Tcl code

2008-06-12 Thread D. Richard Hipp

On Jun 13, 2008, at 12:22 AM, Jeff Godfrey wrote:

 Thanks for the quick solution.  I've adjusted my code accordingly.   
 So,
 do you consider this a buglet or more just the closing of a gap that
 shouldn't have existed in the first place?  It's interesting that the
 original code works outside of a proc in 3.5.9, but not inside...



The TCL interface assigns values to variables where the name of the  
variable is the column name in the result set.  But SQLite makes no  
promises about what a column name is going to be unless you use an  
AS clause on each column.  The column naming algorithm for results  
without an AS clause has changed in the past and will probably change  
again in the future.  So make no assumptions.  Always use an AS clause.

D. Richard Hipp
[EMAIL PROTECTED]



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLite 3 library for Power PC Macs?

2008-06-12 Thread Carl Gundel
Isn't there a SQLite 3 compiled library for Power PC Macs running OS X?  We 
do have a G5 Mac here running OS X 10.4 and it has a dylib named 
libsqlite3.0.dylib but it's only about 60K in size.  I'm guessing that this 
is just a front end for SQLite binaries which have been integrated into the 
OS.  Transplanting this library to another machine doesn't work (no 
surprise).

I haven't written any C code in about 20 years, so I am not really competent 
to compile this library myself.  I placed a bid on rentacoder to see if I 
could get someone to compile this library from sources but so far no takers.

It surprises me that the library isn't available for download at sqlite.org.

-Carl Gundel
Easy Windows programming - http://www.libertybasic.com
Easy web programming - http://www.runbasic.com 

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Upgrade from 3.4.2 to 3.5.9 breaks Tcl code

2008-06-12 Thread Jeff Godfrey
D. Richard Hipp wrote:
 On Jun 13, 2008, at 12:22 AM, Jeff Godfrey wrote:
   
 Thanks for the quick solution.  I've adjusted my code accordingly.   
 So,
 do you consider this a buglet or more just the closing of a gap that
 shouldn't have existed in the first place?
 The column naming algorithm for results  
 without an AS clause has changed in the past and will probably change  
 again in the future.  So make no assumptions.  Always use an AS clause.
   
Noted for future reference, and code (re)adjusted...  ;^)

Thanks,

Jeff
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Date Selection

2008-06-12 Thread Harold Wood
thanks.

--- On Thu, 6/12/08, Igor Tandetnik lt;[EMAIL PROTECTED]gt; wrote:

From: Igor Tandetnik lt;[EMAIL PROTECTED]gt;
Subject: Re: [sqlite] Date Selection
To: sqlite-users@sqlite.org
Date: Thursday, June 12, 2008, 7:51 AM

Harold Wood lt;[EMAIL PROTECTED]gt;
wrote in message news:[EMAIL PROTECTED]
gt; the create table statement:
gt;
gt; LastPurchaseDate DATETIME,

You seem to be under impression there's a dedicated DATETIME type in 
SQLite. This is not the case: it's just the nature of SQLite's manifest

typing (http://sqlite.org/datatype3.html) that allows one to specify any 
odd identifier as a column type.

You have a choice of storing dates and times as strings (e.g. 
'2008-06-10'), as integer number of seconds since Unix epoch, or as 
floating point Julian day number. You manipulate these representations 
using built-in date/time functions:

http://www.sqlite.org/cvstrac/wiki?p=DateAndTimeFunctions

Igor Tandetnik



___
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] Sqliite Command for appending the data to file

2008-06-12 Thread Joanne Pham
Hi all,
I need to dump the data to file in csv format and I have done the following:
sqlite .output dataFile
sqlite .mode csv
sqlite select * from myTable;
sqlite.quit
The data is dump to the file correctly but I want to able to 
    1) append another table to this dataFile 
    2) Print the tablename and table's column name to this dataFile as well
I have read the.help but I couldn't find any command to help me to do these 
format at all.
Please help if you know the way to append the data to the file and print the 
tablename as well as table's columns name to the file.
Thanks in advance,
JP


___
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] datetime bug

2008-06-12 Thread Shane Harrelson
I was able to reproduce this by setting by TZ to GMT +10:00.  It's a
floating point rounding issue in the julian date functions.   We're
investigating how to best correct it, but I don't have a fix for you now.

On 6/12/08, BareFeet [EMAIL PROTECTED] wrote:

 Hi Shane,

  This:  select datetime(julianday('2008-06-12','utc'),
  'localtime');
 
  should give this:  2008-06-12 00:00:00
 
  but instead gives: 2008-06-11 24:00:00

  Can you provide some details of your test setup?  What version of
  SQLite?
  What platform (compiler, O/S, processor, 32bit vs 64bit, etc.)?

 I'm using Mac OS X 10.5.3 on an iMac Intel dual 2.4GHz. I'm in
 Australia, near Sydney (GMT +10:00 I think).

 I get the same result above when using the command line tool of the
 built in SQLite version 3.4.0 or the latest binary version 3.5.9.

 FYI, this: select julianday('2008-06-12','utc');
 gives: 2454629.0833

 and this:  select datetime(2454629.0833, 'localtime');
 gives: 2008-06-11 24:00:00

 Thanks,
 Tom
 BareFeet

 --
 SQLite GUI tools compared at:
 http://www.tandb.com.au/sqlite/compare/?ml

 ___
 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] datetime bug

2008-06-12 Thread P Kishor
On 6/12/08, Shane Harrelson [EMAIL PROTECTED] wrote:
 I was able to reproduce this by setting by TZ to GMT +10:00.  It's a
  floating point rounding issue in the julian date functions.   We're
  investigating how to best correct it, but I don't have a fix for you now.

I can reproduce this bug on Mac OS X 10.5.3 with SQLite 3.5.9 without
having to tinker with TZ.




  On 6/12/08, BareFeet [EMAIL PROTECTED] wrote:
  
   Hi Shane,
  
This:  select datetime(julianday('2008-06-12','utc'),
'localtime');
   
should give this:  2008-06-12 00:00:00
   
but instead gives: 2008-06-11 24:00:00
  
Can you provide some details of your test setup?  What version of
SQLite?
What platform (compiler, O/S, processor, 32bit vs 64bit, etc.)?
  
   I'm using Mac OS X 10.5.3 on an iMac Intel dual 2.4GHz. I'm in
   Australia, near Sydney (GMT +10:00 I think).
  
   I get the same result above when using the command line tool of the
   built in SQLite version 3.4.0 or the latest binary version 3.5.9.
  
   FYI, this: select julianday('2008-06-12','utc');
   gives: 2454629.0833
  
   and this:  select datetime(2454629.0833, 'localtime');
   gives: 2008-06-11 24:00:00
  
   Thanks,
   Tom
   BareFeet
  
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Collation blobs

2008-06-12 Thread Alex Katebi
   The custom sqlite3_create_collation( ) is a perfect solution for
implementing an Internet Protocol Routing Table.
But I am not sure if SQLite will call a custom collation function if column
values are blobs. In other word, are blobs considered for collation?

   One can format a blob with route mask length in the first byte followed
by the destination address bytes.

Thanks,
-Alex
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Collation blobs

2008-06-12 Thread D. Richard Hipp

On Jun 12, 2008, at 6:35 PM, Alex Katebi wrote:

   The custom sqlite3_create_collation( ) is a perfect solution for
 implementing an Internet Protocol Routing Table.
 But I am not sure if SQLite will call a custom collation function if  
 column
 values are blobs. In other word, are blobs considered for collation?


Blob always sort in memcmp() order.  The sorting rules for SQLite are  
(and always have been):

  1.  NULLs sort first
  2.  Numbers sort next in numerical order (floating point values  
and integers interleave as appropriate).
  3.  Text sorts next in the order determined by the collating  
sequence
  4.  BLOBs sort last in memcmp() order.



D. Richard Hipp
[EMAIL PROTECTED]



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Collation blobs

2008-06-12 Thread Alex Katebi
I can still keep my routes in text presentation notation like 1.1.0.0/16 or
fe80::/16.
Thanks,
-Alex

On Thu, Jun 12, 2008 at 7:32 PM, D. Richard Hipp [EMAIL PROTECTED] wrote:


 On Jun 12, 2008, at 6:35 PM, Alex Katebi wrote:

The custom sqlite3_create_collation( ) is a perfect solution for
  implementing an Internet Protocol Routing Table.
  But I am not sure if SQLite will call a custom collation function if
  column
  values are blobs. In other word, are blobs considered for collation?
 

 Blob always sort in memcmp() order.  The sorting rules for SQLite are
 (and always have been):

  1.  NULLs sort first
  2.  Numbers sort next in numerical order (floating point values
 and integers interleave as appropriate).
  3.  Text sorts next in the order determined by the collating
 sequence
  4.  BLOBs sort last in memcmp() order.



 D. Richard Hipp
 [EMAIL PROTECTED]



 ___
 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] Math Functions

2008-06-12 Thread Jay A. Kreibich
On Thu, Jun 12, 2008 at 04:26:13PM +0400, Alexey Pechnikov scratched on the 
wall:
 В сообщении от Friday 06 June 2008 03:51:38 P Kishor написал(а):
  http://sqlite.org/contrib/download/extension-functions.c?get=22
 
 $ wget http://sqlite.org/contrib/download/extension-functions.c?get=22
 $ mv extension-functions.c?get=22 extension-functions.c
 $ gcc -fPIC -shared extension-functions.c -o libsqlitefunctions.so
 $ sqlite3 :memory:
 SQLite version 3.5.9
 Enter .help for instructions
 sqlite SELECT load_extension('./libsqlitefunctions.so');
 SQL error: ./libsqlitefunctions.so: undefined symbol: log
 
 What can I do?

  The extension-functions file doesn't actually implement any of the
  math functinos, it simply acts as a glue layer between SQLite and the
  system math library.  In this case, it looks like the run-time linker
  that loads the extension can't resolve the call for log() from the
  extension into the math library, resulting in an unresolved link.
  
  On many systems the math library is part of the standard set of libs
  that are imported by the linker for all applications.  There are a
  few systems, however, where the math library is not part of the
  standard lib set.  On those systems, you need to explicitly tell the
  linker you want the math library made avaliable.  You can do that
  by compiling the lib with -lm to import the math library.  The math
  lib won't be pulled into the .so, but it will be noted that if the
  run-time linker pulls in the extension, it will also need to pull in
  the math library before it attepts to resolve all the symbols.

  At least, in theory.

  What OS are you trying this on?

   -j

-- 
Jay A. Kreibich  J A Y  @  K R E I B I.C H 

'People who live in bamboo houses should not throw pandas.' Jesus said that.
   - The Ninja, www.AskANinja.com, Special Delivery 10: Pop!Tech 2006
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite 3 library for Power PC Macs?

2008-06-12 Thread Jay A. Kreibich
On Thu, Jun 12, 2008 at 10:54:09AM -0400, Carl Gundel scratched on the wall:
 Isn't there a SQLite 3 compiled library for Power PC Macs running OS X?  We 
 do have a G5 Mac here running OS X 10.4 and it has a dylib named 
 libsqlite3.0.dylib but it's only about 60K in size.  I'm guessing that this 
 is just a front end for SQLite binaries which have been integrated into the 
 OS.  Transplanting this library to another machine doesn't work (no 
 surprise).


  Mac OS X 10.4.11 for PPC includes the following files:

-rwxr-xr-x   1 root  wheel   36448  /usr/bin/sqlite3
-rwxr-xr-x   1 root  wheel  284508  /usr/lib/libsqlite3.0.dylib

  The first is the CLI front-end, while the second is the SQLite
  library.  The library is the core of the SQLite system, and the
  sqlite3 program depends on it.  Apple's CoreData framework also
  links directly against /usr/lib/libsqlite3.0.dylib, making it
  slightly dangerous to replace.

  As noted, the library is much larger than 60K.  Since this is the PPC
  version of 10.4, these files are single-architecture.  If your lib
  file is only 60K, something isn't right.

-j

-- 
Jay A. Kreibich  J A Y  @  K R E I B I.C H 

'People who live in bamboo houses should not throw pandas.' Jesus said that.
   - The Ninja, www.AskANinja.com, Special Delivery 10: Pop!Tech 2006
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3.lib for ARMV4T processor

2008-06-12 Thread sqlite

Dear Virgilio,

 Thanks for your Quick reply, we dont know how to enable the funtional level
linking using SQLite with eVC, so kindly tell us how to enable the same.

Thanks  Regards,
kartthikeyan


Virgilio Alexandre Fornazin-2 wrote:
 
 IF you are using SQLite with eVC, you must enabled function level linking,
 because
 ARM linkers had a bug before eVC SP4 that generated corrupt image files.
 
 On Thu, Jun 12, 2008 at 9:39 AM, sqlite [EMAIL PROTECTED]
 wrote:
 

 Dear All,

  We are using SQLite for our application development which would be
 deployed in a pocket pc of type DTX 10 processor ARMV4T.Also we have
 generated the lib file specific for ARM processor using the LIB.exe with
 the
 parameters DEF:sqlite3.def MACHINE:ARM and the sqlite3.lib and
 sqlite3.dll
 files are generated. When we compiled the application with the sqlite
 functions like sqlite3_open() the application gets compiled and the exe
 also
 gets generated with out any errors. But when we run the application in
 the
 DTX10 device it throws an error Application is not a valid WINCE
 application but when we remove the function call sqlite3_open() from the
 application and run it in the device it is running without any errors.
 Have
 we generated the sqlite3.lib and sqlite3.dll files correctly? because we
 have mentioned the machine name as ARM and using the sqlite3.lib file for
 ARMV4T processor, is it correct? if not how to generate the sqlite3.lib
 file
 for the processor ARMV4T, kindly help us in this regard. Or if possible
 provide us the sqlite3.lib file meant for ARMV4T processor.

 Thanks
 Kartthikeyan
 --
 View this message in context:
 http://www.nabble.com/sqlite3.lib-for-ARMV4T-processor-tp17798977p17798977.html
 Sent from the SQLite mailing list archive at Nabble.com.

 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 

-- 
View this message in context: 
http://www.nabble.com/sqlite3.lib-for-ARMV4T-processor-tp17798977p17815078.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3.lib for ARMV4T processor

2008-06-12 Thread sqlite

Dear Virgilio,

 We enabled the functional level linking using SQLIte, but we are getting
the unresolved exteral symbol sqlite3_open referenced in function error
which means the sqlite3.lib file we have generated is not valid? if so
kindly help us to generate the lib file for ARMV4T processor.

Thanks  Regards,
kartthikeyan.s


sqlite wrote:
 
 Dear Virgilio,
 
  Thanks for your Quick reply, we dont know how to enable the funtional
 level linking using SQLite with eVC, so kindly tell us how to enable the
 same.
 
 Thanks  Regards,
 kartthikeyan
 
 
 Virgilio Alexandre Fornazin-2 wrote:
 
 IF you are using SQLite with eVC, you must enabled function level
 linking,
 because
 ARM linkers had a bug before eVC SP4 that generated corrupt image files.
 
 On Thu, Jun 12, 2008 at 9:39 AM, sqlite [EMAIL PROTECTED]
 wrote:
 

 Dear All,

  We are using SQLite for our application development which would be
 deployed in a pocket pc of type DTX 10 processor ARMV4T.Also we have
 generated the lib file specific for ARM processor using the LIB.exe with
 the
 parameters DEF:sqlite3.def MACHINE:ARM and the sqlite3.lib and
 sqlite3.dll
 files are generated. When we compiled the application with the sqlite
 functions like sqlite3_open() the application gets compiled and the exe
 also
 gets generated with out any errors. But when we run the application in
 the
 DTX10 device it throws an error Application is not a valid WINCE
 application but when we remove the function call sqlite3_open() from
 the
 application and run it in the device it is running without any errors.
 Have
 we generated the sqlite3.lib and sqlite3.dll files correctly? because we
 have mentioned the machine name as ARM and using the sqlite3.lib file
 for
 ARMV4T processor, is it correct? if not how to generate the sqlite3.lib
 file
 for the processor ARMV4T, kindly help us in this regard. Or if possible
 provide us the sqlite3.lib file meant for ARMV4T processor.

 Thanks
 Kartthikeyan
 --
 View this message in context:
 http://www.nabble.com/sqlite3.lib-for-ARMV4T-processor-tp17798977p17798977.html
 Sent from the SQLite mailing list archive at Nabble.com.

 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/sqlite3.lib-for-ARMV4T-processor-tp17798977p17815345.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] sqlite3 command line usage

2008-06-12 Thread John
Hi

I am trying to put multiple commands/statements in a command line args 
list to sqlite3 (Win XP command line/batch file).

This works (sq is alias for sqlite3.exe):
sq data\data1.db3 DROP TABLE IF EXISTS list; VACUUM; CREATE TABLE IF 
NOT EXISTS list (Assno,Custno);

These are all statements.

This does not work:
sq data\data1.db3 .mode column select 
assno,custno,asset,custnum,branch from list,a1 where asset == assno;

A . command followed by a statement.

Variations I have tried:
- quoting the full arg list as a single string
- using ; / \ \n \r \r\n as separators after column

Can this be made to work? and if so, how?

-- 
Regards
John McMahon
   [EMAIL PROTECTED]

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3.lib for ARMV4T processor

2008-06-12 Thread sqlite

Dear Virgilio,

 We enabled the functional level linking using SQLIte, but we are getting
the unresolved exteral symbol sqlite3_open referenced in function error
which means the sqlite3.lib file we have generated is not valid? if so
kindly help us to generate the lib file for ARMV4T processor.

Thanks  Regards,
kartthikeyan.s


Virgilio Alexandre Fornazin-2 wrote:
 
 IF you are using SQLite with eVC, you must enabled function level linking,
 because
 ARM linkers had a bug before eVC SP4 that generated corrupt image files.
 
 On Thu, Jun 12, 2008 at 9:39 AM, sqlite [EMAIL PROTECTED]
 wrote:
 

 Dear All,

  We are using SQLite for our application development which would be
 deployed in a pocket pc of type DTX 10 processor ARMV4T.Also we have
 generated the lib file specific for ARM processor using the LIB.exe with
 the
 parameters DEF:sqlite3.def MACHINE:ARM and the sqlite3.lib and
 sqlite3.dll
 files are generated. When we compiled the application with the sqlite
 functions like sqlite3_open() the application gets compiled and the exe
 also
 gets generated with out any errors. But when we run the application in
 the
 DTX10 device it throws an error Application is not a valid WINCE
 application but when we remove the function call sqlite3_open() from the
 application and run it in the device it is running without any errors.
 Have
 we generated the sqlite3.lib and sqlite3.dll files correctly? because we
 have mentioned the machine name as ARM and using the sqlite3.lib file for
 ARMV4T processor, is it correct? if not how to generate the sqlite3.lib
 file
 for the processor ARMV4T, kindly help us in this regard. Or if possible
 provide us the sqlite3.lib file meant for ARMV4T processor.

 Thanks
 Kartthikeyan
 --
 View this message in context:
 http://www.nabble.com/sqlite3.lib-for-ARMV4T-processor-tp17798977p17798977.html
 Sent from the SQLite mailing list archive at Nabble.com.

 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

 ___
 sqlite-users mailing list
 sqlite-users@sqlite.org
 http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
 
 

-- 
View this message in context: 
http://www.nabble.com/sqlite3.lib-for-ARMV4T-processor-tp17798977p17815435.html
Sent from the SQLite mailing list archive at Nabble.com.

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users