[sqlite] Case Insensitive Comparison for Double Byte Characters

2008-10-20 Thread Alexander Yap
Hi All,
I am new here and would like to learn on how to do Case Insensitive
comparison of Double Byte Characters?

Thanks in advance.

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


Re: [sqlite] Getting text data w/ embedded nulls from shell

2008-10-20 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Evan Burkitt wrote:
> Maybe a way of making the sqlite3 shell treat these fields as BLOBS,

  select cast(column as blob)

You have the full source to the shell and can change the text printing
routine to do whatever you want (hex output, html style escaping,
backslash/C style etc).

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkj9S/EACgkQmOOfHg372QSgawCbBReEQLYMdTHuF5iBG8x+PsLJ
V6cAoK2wMqmotHaqibRY8kAKlCgDzhh7
=g+l0
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Getting text data w/ embedded nulls from shell

2008-10-20 Thread Evan Burkitt
I have some tables which are maintained programmatically, and which have a text 
field in which I store a block of text made up of a series of null-separated 
strings. I am able to read and write these fields through the program without 
problem; reading via sqlite3_column_text() and sqlite3_column_bytes() APIs, 
writing via sqlite3_bind_text(). I cannot figure out a way to extract these 
fields from the sqlite3 shell, though, even via .dump.

Is there any clever command line or pragma trickery that can cause the shell to 
write all the characters in a text field to the screen or even stdout? Maybe a 
way of making the sqlite3 shell treat these fields as BLOBS, or hooking a 
filter into the shell some way?

Thanks for any insight or assistance.

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


Re: [sqlite] CURRENT_DATE Behavior

2008-10-20 Thread jonwood


D. Richard Hipp wrote:
> 
> CREATE TABLE whatever(
>  
>  timestamp DATE DEFAULT (datetime('now','localtime')),
>  ...
> );
> 

Really? I can do that? Great!

Thanks!
-- 
View this message in context: 
http://www.nabble.com/CURRENT_DATE-Behavior-tp20075044p20082173.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] CURRENT_DATE Behavior

2008-10-20 Thread D. Richard Hipp

On Oct 20, 2008, at 1:46 PM, jonwood wrote:

>
> Greetings,
>
> Okay, I understand that the designer of SQLite felt it was important  
> that
> fields with a default value of CURRENT_DATE should be initialized to  
> the
> current date in a DIFFERENT time zone. Setting aside for now that  
> I've read
> all the reasons for this and am very much against the decision, I  
> have the
> following question.
>
> Is there ANY way to override this behavior? Or must I simply  
> initialize all
> such fields explicity if I would like to set it to the current date  
> in my
> particular time zone?

CREATE TABLE whatever(
 
 timestamp DATE DEFAULT (datetime('now','localtime')),
 ...
);


>
>
> Thanks.
> -- 
> View this message in context: 
> http://www.nabble.com/CURRENT_DATE-Behavior-tp20075044p20075044.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

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] Transaction across different DB handles returns SQLITE_INTERNAL

2008-10-20 Thread John Belli
On Mon, 20 Oct 2008 18:01:03 + (UTC), MikeW
<[EMAIL PROTECTED]> wrote:


>Still, I would like to be able to run the Transaction over these two calls ...
>What's the best way, given I have two separate handles ?
>Make them separate Transactions and do a ROLLBACK on the first if the
>second exec fails, possibly ?

Tht might work. You could also look into ATTACH DATABASE syntax (the
proper way to maintain atomicity between databases)
http://www.sqlite.org/lang_attach.html

Attach the 2nd database before beginning the transaction.

JAB
-- 
John A. Belli
Software Engineer
Refrigerated Transport Electronics, Inc.
http://www.rtelectronics.com

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


Re: [sqlite] Transaction across different DB handles returns SQLITE_INTERNAL

2008-10-20 Thread Igor Tandetnik
MikeW <[EMAIL PROTECTED]> wrote:
> I presume I'm not allowed to do this:
>
> // apply updates on first db - start Transaction
> ret = sqlite3_exec(
>first_db,
>"BEGIN; UPDATE " FIRST_DB_TABLE
>" SET " FIRST_DB_COLUMN "=1 "
>" WHERE " FIRST_DB_COLUMN " NOT NULL;",
> NULL, NULL, NULL));
> // returns SQLITE_OK
>
> // delete updates from second db - commit Transaction
> ret = sqlite3_exec(
>second_db,
>"UPDATE " SECOND_DB_TABLE
>" SET " SECOND_DB_COLUMN "= NULL "
>" WHERE " SECOND_DB_COLUMN " NOT NULL; END;",
> NULL, NULL, NULL));
> // returns SQLITE_INTERNAL

Do the two DB connection handles (first_db and second_db) refer to the 
same file? However, in this case I would expect SQLITE_BUSY, not 
SQLITE_INTERNAL. There must be some other problem, in the code you don't 
show.

> Still, I would like to be able to run the Transaction over these two
> calls

You can't. A transaction is a property of a connection. You can't have a 
single transaction spanning multiple connections.

You can, however, have the same connection refer to more than one 
database file. See ATTACH statement. This way, you can update several 
files within a single transaction.

> ... What's the best way, given I have two separate handles ?
> Make them separate Transactions and do a ROLLBACK on the first if the
> second exec fails, possibly ?

That's unreliable. E.g., you run the first transaction but keep it open 
(so you can roll it back). You run the second transaction - it succeeds. 
But before you have a chance to commit the first one, there's a power 
failure. When your program is restarted, the first transaction will be 
rolled back, and you will end up with an inconsistent state.

Igor Tandetnik 



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


Re: [sqlite] How to get the specific row?

2008-10-20 Thread Igor Tandetnik
yokk y <[EMAIL PROTECTED]> wrote:
>   -
>  ID   NAME
>   ==
>   (1)1 AA
>   (2)3 CC
>   (3)4 DD
>   (4)6 FF
>   (5)7 GG
>   --
>   I want to find the Nth record, for example?when N=3 , I want to get
> this record  : "4   DD" , N=5 : "7   GG" .

select * from TBLNAME
order by ID
limit 1 offset :N - 1;

> The N value is
> given, and how can do it fast?

By "fast", I assume you mean "in time faster than O(N)". Basically, to
do this you would have to renumber the rows every time one row is
deleted (e.g. by using a trigger). Then you can simply do

select * from TBLNAME where ID=:N;

which will run in O(log T) where T is the total number of rows in the
table. But of course, now every deletion takes O(T). If you need to
select often enough and delete rarely enough, that may be a worthwhile
tradeoff.

Igor Tandetnik 



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


Re: [sqlite] How to get the specific row?

2008-10-20 Thread Igor Tandetnik
yokk y <[EMAIL PROTECTED]> wrote:
>   -
>  ID   NAME
>   ==
>   (1)1 AA
>   (2)3 CC
>   (3)4 DD
>   (4)6 FF
>   (5)7 GG
>   --
>   I want to find the Nth record, for example?when N=3 , I want to get
> this record  : "4   DD" , N=5 : "7   GG" .

select * from TBLNAME
order by ID
limit 1 offset :N - 1;

> The N value is
> given, and how can do it fast?

By "fast", I assume you mean "in time faster than O(N)". Basically, to 
do this you would have to renumber the rows every time one row is 
deleted (e.g. by using a trigger). Then you can simply do

select * from TBLNAME where ID=:N;

which will run in O(log T) where T is the total number of rows in the 
table. But of course, now every deletion takes O(T). If you need to 
select often enough and delete rarely enough, that may be a worthwhile 
tradeoff.

Igor Tandetnik 



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


[sqlite] Malformed database image

2008-10-20 Thread Doug
I've got a database file that somehow got corrupted.  This is a dev system
so I'm not overly concerned, but if the SQLite team would like to take a
look you can.  I'm using 3.5.6 on Windows.I'm using PRAGMA
SYNCHRONOUS=1, so I'm not quite sure how this happened.

 

Sqlite3_analyzer crashes immediately when run against the file, sqlite3
returns "database disk image is malformed" when I do a SELECT COUNT(*) FROM
Directory, and it crashes after returning a bunch of rows if I use a SELECT
with a WHERE (that probably uses an index).

 

If this is too old to worry about, or too random an error to worry about, no
problem.  I need to get on the 3.6 series anyway.

 

Doug

 

Call stack (not for sqlite3, but from my app):

 

sqlite3.dll!sqlite3GetVarint(const unsigned char * p=0x052c4227, unsigned
__int64 * v=0x043b13f8)  Line 14895 + 0x3 bytes

sqlite3.dll!sqlite3BtreeParseCellPtr(MemPage * pPage=0x052b43c8, unsigned
char * pCell=0x052c4227, CellInfo * pInfo=0x043b13f0)  Line 28049 + 0x13
bytes

sqlite3.dll!sqlite3BtreeParseCell(MemPage * pPage=0x052b43c8, int
iCell=0x0044, CellInfo * pInfo=0x043b13f0)  Line 28103 + 0x48 bytes


sqlite3.dll!getCellInfo(BtCursor * pCur=0x043b13c8)  Line 30347 + 0x1a bytes

sqlite3.dll!sqlite3BtreeDataSize(BtCursor * pCur=0x043b13c8, unsigned int *
pSize=0x03f3e114)  Line 30405 + 0x9 bytes

sqlite3.dll!sqlite3VdbeExec(Vdbe * p=0x044695c8)  Line 40831 + 0x13 bytes

sqlite3.dll!sqlite3Step(Vdbe * p=0x044695c8)  Line 38215 + 0x9 bytes

sqlite3.dll!sqlite3_step(sqlite3_stmt * pStmt=0x044695c8)  Line 38279 + 0x9
bytes

CoreLib.dll!SQLCmdSQLite::ExecSQLDirect(const wchar_t *
origIncomingSQL=0x013eb7f0, bool bWrapInTransaction=true)  Line 1128 + 0x9
bytes 

 

 

 

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


Re: [sqlite] CURRENT_DATE Behavior

2008-10-20 Thread Kees Nuyt
On Mon, 20 Oct 2008 10:46:41 -0700 (PDT), jonwood
<[EMAIL PROTECTED]> wrote in General Discussion of SQLite
Database :

>
>Greetings,
>
>Okay, I understand that the designer of SQLite felt it was important that
>fields with a default value of CURRENT_DATE should be initialized to the
>current date in a DIFFERENT time zone. Setting aside for now that I've read
>all the reasons for this and am very much against the decision, I have the
>following question.
>
>Is there ANY way to override this behavior? Or must I simply initialize all
>such fields explicity if I would like to set it to the current date in my
>particular time zone?

Instead of using DEFAULT you can create an ON INSERT trigger that sets
any column to any value you wish.
Or you could modify the SQLite source to suit your taste.

>Thanks.
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] UPDATE statement with several tables

2008-10-20 Thread Kees Nuyt
On Mon, 20 Oct 2008 12:38:29 +0200, jm cuaz <[EMAIL PROTECTED]> wrote
in General Discussion of SQLite Database :

>Hello,
>
>We try to port an application specialised in financial calculus written 
>in VBA + MS Access toward Tcl + Sqlite.
>
>In this application, 90% of the calculus is directly processed at the 
>SQL level via INSERT/UPDATE statements executed against the db, and 
>subsets are calculated with INNER JOINS between the tables inside each 
>statement.
>In consequence, our statements are easily dealing with 3/4 tables (not 
>rarely more) at once.
>
>But in this purpose, we encounter a severe issue in the fact that in 
>Sqlite, UPDATE statements, in the contrary of INSERT statements, 
>doesn't  compute several tables at once.
>
>On this mailing list, Igor Tandetnik (thank's Igor) showed us a 
>workaround via subqueries inserted in the FROM and WHERE clauses of 
>UPDATE statements.
>
>But, while not impossible, it is difficult to do so when the number of 
>tables involved is greater than 3.
>
>Ticket 3222 had still made a request in this direction.
>
>Does anybody kows if there is any plan for enhancing Sqlite's UPDATE 
>statement  in this  direction ?
> 
>Thank's
>
>Jean-Marie

There might be a workaround: 
Create an updateble view and UPDATE that view.
An updateble view is a view plus an INSTEAD OF trigger.

http://www.sqlite.org/lang_createtrigger.html#instead_of_trigger
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SqLite Report Generator For Windows

2008-10-20 Thread Kees Nuyt
On Mon, 20 Oct 2008 12:26:33 +0530, "Rajesh Nair"
<[EMAIL PROTECTED]> wrote in General Discussion of SQLite
Database :

>Is there any free SqLite3 *Report Generator For MS-Windows.* I searched the
>web with Google but no result. All are commercial and/or with .NET, I want
>it use with VC++ 6.0. Even a COM object can solve my problem. Have any one
>developed such an utility that can be shared with all of us. Please reply.
>With Report Generator I mean *a report template designer, and a report
>viewer.* A report template designer will be enough for me to cope with my
>current problem. Any one please reply. I have also read a mail long before
>in sqlite group regarding this. There is one I found in CodeProject.COM and
>the link is given below.
>www.codeproject.com/KB/printing/ReportGenerator.aspx
>It is good but not the one what I needed. Also a C# project is also provided
>in CodeProject that uses the above project but I cannot use it since it is
>C#. I want it in VC++. If some one have such a thing please share it.

SQLiteExplorer (by Mike Cariotoglou) has an optional report
designer/generator. 

See: http://www.singular.gr/sqlite/ (close to the bottom of the page)

It should be possible to use any report generator that can connect to
ODBC (even MS Access) together with one of the SQLite ODBC drivers.

See also (you probably already found):
http://www.sqlite.org/cvstrac/wiki?p=SqliteReporting
http://www.sqlite.org/cvstrac/wiki?p=ManagementTools

Good luck.
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] How to speed up read-only databases?

2008-10-20 Thread John Stanton
Christophe Leske wrote:
> John Stanton schrieb:
> 
>>The sqlite3.exe program is set up as a utility and maintenance tool, not 
>>a production environment and is designed to that end.  If you want 
>>maximum performance it is not the way to go; instead embed the Sqlite 
>>calls inside your application and optimize access.  If you are 
>>performing ad-hoc DB tasks then it or one of the many similar function 
>>Ssqlite tools are appropriate.  One is the Firefox plug in.
>>
>>You can imagine that having to compile the SQL for over and over instead 
>>of storing and re-using the compiled code adds considerably to overhead 
>>on frequently run jobs.
> 
> Yes, but I am using Adobe Director as a production environment. This is 
> a single threaded application, which also doesn´t allow for threaded 
> calls to a database. Plus, i got no access to the source code of the 
> so-called Xtra (=DLL) which emits the call to the DB.

You cab build your own command line interfsce embedding Sqlite.
> 
> All i got is an Xtra which spawns a new thread in which the command line 
> executable is run. I need the thread in order to keep my application 
> running smoothly which otherwise stalls.
> 
> Regading the pre-recording of statements: can this be achieved somehow 
> if the parameters of the call change all the time?

This is where sqlite_bind functions.
> 
> 

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


Re: [sqlite] FreeBSD port installation error in bsd.port.mk

2008-10-20 Thread Thomas Briggs
   It's been a while since I used FreeBSD, but I remember sometimes
needing to use gmake (vs. just plain make) to get ports up and going.

   -T


On Mon, Oct 20, 2008 at 12:02 PM, Adrian <[EMAIL PROTECTED]> wrote:
> Hello,
> I'm having trouble installing the SQLite3 port on FreeBSD, and I wanted to
> see if my issue is one that is generally known or if it is something
> particular on my end.  If I go into the ports/databases/sqlite3 directory
> and try "make", I get the following error:
> "/usr/ports/Mk/bsd.port.mk", line 3240: Need an operator
> The offending line, according to the line number, is that with the WRKSRC in
> this block of code:
> $$//'
> .else
> .for f in ${USE_DOS2UNIX}
> @${ECHO_MSG} "===>   Converting DOS text file to UNIX text file: ${f}"
> @${REINPLACE_CMD} -i '' -e 's/
> $$//' ${WRKSRC}/${f}
> .endfor
> .endif
>
> I apologize if this has nothing to do with SQLite3, since the error is in a
> file external to the port, but I wanted to see if it looked familiar to
> anyone as I haven't been able to find anything about it on my own.  Please
> let me know if there is any further information that I can provide that
> might help diagnose the issue.
>
> Thanks in advance,
> Adrian
> ___
> 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] Transaction across different DB handles return s SQLITE_INTERNAL

2008-10-20 Thread MikeW
I presume I'm not allowed to do this:

// apply updates on first db - start Transaction
ret = sqlite3_exec(
first_db,
"BEGIN; UPDATE " FIRST_DB_TABLE 
" SET " FIRST_DB_COLUMN "=1 "
" WHERE " FIRST_DB_COLUMN " NOT NULL;",
 NULL, NULL, NULL));
// returns SQLITE_OK

// delete updates from second db - commit Transaction
ret = sqlite3_exec(
second_db,
"UPDATE " SECOND_DB_TABLE 
" SET " SECOND_DB_COLUMN "= NULL "
" WHERE " SECOND_DB_COLUMN " NOT NULL; END;",
 NULL, NULL, NULL));
// returns SQLITE_INTERNAL

Still, I would like to be able to run the Transaction over these two calls ...
What's the best way, given I have two separate handles ?
Make them separate Transactions and do a ROLLBACK on the first if the
second exec fails, possibly ?

Thanks,
MikeW

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


[sqlite] CURRENT_DATE Behavior

2008-10-20 Thread jonwood

Greetings,

Okay, I understand that the designer of SQLite felt it was important that
fields with a default value of CURRENT_DATE should be initialized to the
current date in a DIFFERENT time zone. Setting aside for now that I've read
all the reasons for this and am very much against the decision, I have the
following question.

Is there ANY way to override this behavior? Or must I simply initialize all
such fields explicity if I would like to set it to the current date in my
particular time zone?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/CURRENT_DATE-Behavior-tp20075044p20075044.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] How to get the specific row?

2008-10-20 Thread Toby Bascom
-- get the Nth record from the top:
select *
from tblname
order by id asc
limit N-1,1
-- get the Nth record from the bottom:
select *
from tblname
order by id desc
limit N-1,1

Regards,
-Toby


>Hi all
>I create a table like this:
>sqlite3_exec(db, "CREATE TABLE TBLNAME (ID 
>INTEGER PRIMARY KEY , NAME TEXT)", 0, 0,);
>Then insert some records, the follow is the 
>contents of this table.
>-
>ID   NAME
>==
>(1)  1 AA
>(2)  2 BB
>(3)  3 CC
>(4)  4 DD
>(5)  5 EE
>(6)  6 FF
>(7)  7 GG
>--
>Then may delete some records,
>-
>ID   NAME
>==
>(1)1 AA
>(2)3 CC
>(3)4 DD
>(4)6 FF
>(5)7 GG
>--
>I want to find the Nth record, for example£¬
>when N=3 , I want to get this record  :
>"4   DD" ,
>N=5 :
>"7   GG" .
>The N value is given, and how can do it fast?
>Thanks Yoky
>___
>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] FreeBSD port installation error in bsd.port.mk

2008-10-20 Thread Markus Hoenicka
Hi,

this is most likely not an SQLite problem, but either a problem of the  
SQLite3 port, or a glitch in the port system itself. To get better  
advice, I'd recommend to contact the port maintainer and the  
freebsd-users mailing list.

regards,
Markus

Quoting Adrian <[EMAIL PROTECTED]>:

> Hello,
> I'm having trouble installing the SQLite3 port on FreeBSD, and I wanted to
> see if my issue is one that is generally known or if it is something
> particular on my end.  If I go into the ports/databases/sqlite3 directory
> and try "make", I get the following error:
> "/usr/ports/Mk/bsd.port.mk", line 3240: Need an operator
> The offending line, according to the line number, is that with the WRKSRC in
> this block of code:
> $$//'
> .else
> .for f in ${USE_DOS2UNIX}
> @${ECHO_MSG} "===>   Converting DOS text file to UNIX text file: ${f}"
> @${REINPLACE_CMD} -i '' -e 's/
> $$//' ${WRKSRC}/${f}
> .endfor
> .endif
>
> I apologize if this has nothing to do with SQLite3, since the error is in a
> file external to the port, but I wanted to see if it looked familiar to
> anyone as I haven't been able to find anything about it on my own.  Please
> let me know if there is any further information that I can provide that
> might help diagnose the issue.
>
> Thanks in advance,
> Adrian
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Markus Hoenicka
[EMAIL PROTECTED]
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de

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


Re: [sqlite] UPDATE statement with several tables

2008-10-20 Thread Dan

On Oct 20, 2008, at 5:38 PM, jm cuaz wrote:

> Hello,
>
> We try to port an application specialised in financial calculus  
> written
> in VBA + MS Access toward Tcl + Sqlite.
>
> In this application, 90% of the calculus is directly processed at the
> SQL level via INSERT/UPDATE statements executed against the db, and
> subsets are calculated with INNER JOINS between the tables inside each
> statement.
> In consequence, our statements are easily dealing with 3/4 tables (not
> rarely more) at once.
>
> But in this purpose, we encounter a severe issue in the fact that in
> Sqlite, UPDATE statements, in the contrary of INSERT statements,
> doesn't  compute several tables at once.
>
> On this mailing list, Igor Tandetnik (thank's Igor) showed us a
> workaround via subqueries inserted in the FROM and WHERE clauses of
> UPDATE statements.
>
> But, while not impossible, it is difficult to do so when the number of
> tables involved is greater than 3.
>
> Ticket 3222 had still made a request in this direction.
>
> Does anybody kows if there is any plan for enhancing Sqlite's UPDATE
> statement  in this  direction ?

As far as I know there is no such plan.

Dan.

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


Re: [sqlite] How to get the total row number of a table by Sqlite more efficient?

2008-10-20 Thread Igor Tandetnik
"yokk y" <[EMAIL PROTECTED]> wrote in
message
news:[EMAIL PROTECTED]
>I want to get the total rows of a table, here are my methods:
>
> Is there some more efficient methods or API interface with
> Sqlite?Because my program invoke this interface very frequency.

If it's really that important for you to have an accurate row count for 
a table, store this count in another table and use triggers to maintain 
it. SQLite doesn't internally maintain this count; the only way for 
SQLite to obtain it is to actually count rows one by one.

Igor Tandetnik



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


[sqlite] string values are messed up with ODBC and prepared statements

2008-10-20 Thread Günther Schmidt
Hi,

when I use inserts through prepared statements on windows with ODBC
all text field values are messed up. Everything else, ie. numbers,
timestamps are fine.

When I'm using inserts without prepared statements, also via ODBC, the
strings are fine, save for Umlauts.

Is anybody else here experiencing similar problems, or does anybody
know a fix?


Günther

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


Re: [sqlite] How to speed up read-only databases?

2008-10-20 Thread Christophe Leske
John Stanton schrieb:
> The sqlite3.exe program is set up as a utility and maintenance tool, not 
> a production environment and is designed to that end.  If you want 
> maximum performance it is not the way to go; instead embed the Sqlite 
> calls inside your application and optimize access.  If you are 
> performing ad-hoc DB tasks then it or one of the many similar function 
> Ssqlite tools are appropriate.  One is the Firefox plug in.
>
> You can imagine that having to compile the SQL for over and over instead 
> of storing and re-using the compiled code adds considerably to overhead 
> on frequently run jobs.
Yes, but I am using Adobe Director as a production environment. This is 
a single threaded application, which also doesn´t allow for threaded 
calls to a database. Plus, i got no access to the source code of the 
so-called Xtra (=DLL) which emits the call to the DB.

All i got is an Xtra which spawns a new thread in which the command line 
executable is run. I need the thread in order to keep my application 
running smoothly which otherwise stalls.

Regading the pre-recording of statements: can this be achieved somehow 
if the parameters of the call change all the time?


-- 
Christophe Leske

www.multimedial.de - [EMAIL PROTECTED]
http://www.linkedin.com/in/multimedial
Lessingstr. 5 - 40227 Duesseldorf - Germany
0211 261 32 12 - 0177 249 70 31


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


[sqlite] SqLite Report Generator For Windows

2008-10-20 Thread Rajesh Nair
Is there any free SqLite3 *Report Generator For MS-Windows.* I searched the
web with Google but no result. All are commercial and/or with .NET, I want
it use with VC++ 6.0. Even a COM object can solve my problem. Have any one
developed such an utility that can be shared with all of us. Please reply.
With Report Generator I mean *a report template designer, and a report
viewer.* A report template designer will be enough for me to cope with my
current problem. Any one please reply. I have also read a mail long before
in sqlite group regarding this. There is one I found in CodeProject.COM and
the link is given below.
www.codeproject.com/KB/printing/ReportGenerator.aspx
It is good but not the one what I needed. Also a C# project is also provided
in CodeProject that uses the above project but I cannot use it since it is
C#. I want it in VC++. If some one have such a thing please share it.



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