Re: [sqlite] Best GUI?

2009-02-27 Thread Michael Comperchio
Jim Dodgen wrote:
> Binary!  ... I only use 0's
>
> On Fri, Feb 27, 2009 at 5:19 AM, Michael Comperchio  
> wrote:
>   
>> Mike Eggleston wrote:
>> 
>>> On Thu, 26 Feb 2009, Nuno Magalh?es might have said:
>>>
>>>
>>>   
 This is a bit of a religious question, but which are the mest/most
 popular *nix GUIs out there? I'm using a firefox plugin but not
 entirely happy with it. What do you use and why?

 
>>> I prefer vi and sh.
>>>
>>> Mike
>>> ___
>>> sqlite-users mailing list
>>> sqlite-users@sqlite.org
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>>
>>>
>>>   
>> Real men code in binary. Like CodeBlocks & good old 'sql' myself.
>>
>> Michael
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>> 
>
>
>
>   
I used to, but, for some reason, I kept fraggin' the XT's hard drive.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Best GUI?

2009-02-27 Thread Alex Mandel
Nuno Magalhães wrote:
>> Do you want this for data entry, or developing and managing the database
>> via SQL. I have yet to see a really good front end for data entry
>> although Dabo shows promise as a tool to make good data entry tools.
> 
> Thanks, i'll look into it. I want it as a means to create the inicial
> schema and change it if necessary. Setting up constraints, data types,
> that sort of thing... For random queries i'd probably use the cli and
> for data entry i'll use php.
> 
> Nuno Magalhães
> LU#484677
> ___

Oh that's a different ballpark. I actually use Dia to draw my database
and then use dia2code to generate sql that can be run.
I've seen other variations of the same idea, UML diagram to SQL to code
is the basic idea. Of course most of them have no idea about the data
types for sqlite so you still end up typing out most of it.

Not really sure what you need a GUI for at that stage unless you want it
to baby step you with check boxes about your options. If that's what
you're looking for the firefox plugin is the closest thing I've seen to
that.

FYI- did you consider asking the plugin developer to add tools you think
are useful?

Alex

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


Re: [sqlite] Best GUI?

2009-02-27 Thread Nuno Magalhães
> Do you want this for data entry, or developing and managing the database
> via SQL. I have yet to see a really good front end for data entry
> although Dabo shows promise as a tool to make good data entry tools.

Thanks, i'll look into it. I want it as a means to create the inicial
schema and change it if necessary. Setting up constraints, data types,
that sort of thing... For random queries i'd probably use the cli and
for data entry i'll use php.

Nuno Magalhães
LU#484677
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Best GUI?

2009-02-27 Thread Alex Mandel
Nuno Magalhães wrote:
>> Here lots of  SQLite management tools
>>
>> http://www.sqlite.org/cvstrac/wiki?p=ManagementTools
> 
> Keyword being "lots". I've been to that site, which was what prompted
> me to write in the first place. I'm looking for either web-based or
> *nix. I know there are lots, i just want to know which one(s) you
> recomend and why. I've been using a firefox plugin called SQLite
> Manager but am not happy with it, i'd like more options, something
> similar to Oracle's SQLDeveloper (pref without the Java™) or even
> Access.
> 
> Btw, vi and sh do not qualify as GUI, i have my own tools for that, thanks.
> 
> Nuno Magalhães
> LU#484677

Do you want this for data entry, or developing and managing the database
via SQL. I have yet to see a really good front end for data entry
although Dabo shows promise as a tool to make good data entry tools.

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


Re: [sqlite] Best GUI?

2009-02-27 Thread Jim Dodgen
Binary!  ... I only use 0's

On Fri, Feb 27, 2009 at 5:19 AM, Michael Comperchio  wrote:
> Mike Eggleston wrote:
>> On Thu, 26 Feb 2009, Nuno Magalh?es might have said:
>>
>>
>>> This is a bit of a religious question, but which are the mest/most
>>> popular *nix GUIs out there? I'm using a firefox plugin but not
>>> entirely happy with it. What do you use and why?
>>>
>>
>> I prefer vi and sh.
>>
>> Mike
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>>
> Real men code in binary. Like CodeBlocks & good old 'sql' myself.
>
> Michael
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Jim Dodgen
j...@dodgen.us
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Odd very SLOW query in SQLITE - Optimizer is not working!?

2009-02-27 Thread Igor Tandetnik
"Jonathon"  wrote
in message
news:5dd932e10902271602m59107b2fnb8c9838d12b87...@mail.gmail.com
> Here is my query:
>
> SELECT * FROM tableR r
> INNER JOIN tableU u ON u.id = r.u_id
> LEFT JOIN tableP p ON u.p_id = p.id
> ORDER BY p.p_name;
>
> tableR has about 5 million records.
> tableU has 100k records.
> table P has 1k records.
>
> It's very weird.  If I change the last join to an INNER JOIN,
> everything works great.

EXPLAIN QUERY PLAN is your friend. With inner join, SQLite scans tableP 
in order (using the index on name), and for each record looks up a 
corresponding record in tableU and finally in tableR. The execution time 
is roughly O(1K).

With LEFT JOIN SQLite can't start with the scan on tableP. It 
arbitrarily chooses to start with tableR instead, and for each record 
looks up tableU then tableP, and finally sorts the result. So it takes 
O(5M) time - three orders of magnitude slower.

You'd probably see somewhat better speed if you simply interchange 
tableR and tableU:

SELECT * FROM tableU u
INNER JOIN tableR r ON u.id = r.u_id
LEFT JOIN tableP p ON u.p_id = p.id
ORDER BY p.p_name;

This way SQLite would linearly scan only 100K records. I don't think you 
can do any better than that with LEFT JOIN in place - the query has no 
choice but to look at every record in tableU.

Igor Tandetnik 



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


[sqlite] Odd very SLOW query in SQLITE - Optimizer is not working!?

2009-02-27 Thread Jonathon
Hello All,

I have a simple query that seems to be going very very very slow.   I am not
sure why sqlite is behaving this way, which is why I decided to burden you
guys with my question.  My guess is that the query optimizer might not be
able to decipher what exactly I want to do, and thus computes some
inefficient query.

Here is my query:

SELECT * FROM tableR r
INNER JOIN tableU u ON u.id = r.u_id
LEFT JOIN tableP p ON u.p_id = p.id
ORDER BY p.p_name;

CREATE TABLE tableR (
   id   INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
   u_id   INTEGER NOT NULL
);

CREATE TABLE tableU (
   id  INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
   p_id  INTEGER NOT NULL
);

CREATE TABLE tableP (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
p_name INTEGER NOT NULL
);

CREATE INDEX p_name_index ON tableP (p_name);
CREATE INDEX p_id_index ON tableU (p_id);
CREATE INDEX u_id_index ON tableR (u_id);

tableR has about 5 million records.
tableU has 100k records.
table P has 1k records.

It's very weird.  If I change the last join to an INNER JOIN, everything
works great.  Any information on how I could improve this query would
greatly help.   I know it can't be THIS slow..

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


Re: [sqlite] view and attach database problem

2009-02-27 Thread Kees Nuyt
On Sat, 28 Feb 2009 00:20:48 +0300, Alexey Pechnikov
 wrote:

>Hello!
>
>On Friday 27 February 2009 21:50:30 Kees Nuyt wrote:
>> A view or trigger in one database is not allowed to
>> reference tables (or other views) in other databases. The
>> reason is, the schema of the main database (in this case
>> your :memory: database) would be invalid once the main
>> database is opened without the attached database, or after
>> detaching it.
>
> So I can create table to saving view definitions and
> create these as "temp view" to all of attached
> databases 

Yes, you could store the text of the SELECT statements
ready for preparing in a table, with ? placeholders for
the value bindings. Or delegate the cross-database SELECTs
to application code and not use VIEWs at all.

> or disable the check of views. I think the define such
> as SQLITE_DISABLE_VIEW_ON_ATTACHED_DATABASE may be
> useful in code.

You could implement that feature in your own branch/fork
of SQLite, but I think it will never make it to the
mainstream source version, because would be a bad thing
to be able to create inconsistent schemas.
-- 
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Working with very large data sets from a single process/batch perspective

2009-02-27 Thread python
This is a continuation of the "SQLite vs. Oracle (parallelized)"
thread with a request to learn how others are using SQLite with
very large data sets. The context of this post is processing
large data sets from a single process perspective, eg. this
question is being asked from a batch data processing vs.
multi-user perspective.
1. In browsing the archives, it seems that one technique is to
split or partition large data sets into separate SQLite databases
that can be loaded and indexed independently of one another
(possibly via separate processes on the same box or on separate
boxes). It appears that some people have written their own
front-ends to manage how records are inserted and/or read from a
collection of SQLite databases.
2. Another technique appears to be to run SQLite on boxes with
lots of memory and then configure SQLite to make optimal use of
available memory.
Are there other techniques that one should consider and/or what
techniques should one avoid?
Thank you,
Malcolm
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite vs. Oracle (parallelized)

2009-02-27 Thread python
Alexey,

Thank you for your reply and for sharing your success with SQLite. I'm
excited by your results (60x faster). On an informal basis, we've been
going back and re-benchmarking some of our old, 'traditional'
(Oracle/Informatica) ETL/DW projects and we now believe the majority of
these systems could be simplified and made faster by using alternative
techniques based on in-memory data processing (definitely) and/or SQLite
(we still need to test). 

Your approach of splitting large data sets sounds similar to what other
SQLite users with large data sets seem to be doing. At a high level,
this sounds like how one would partition data using Oracle? I'm going to
start a new thread on this topic.

> With your hardware I think 100Gb dataset is not limit.

Good news. I'm looking forward to verifying this over the next month or
so.

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


Re: [sqlite] view and attach database problem

2009-02-27 Thread Alexey Pechnikov
Hello!

On Friday 27 February 2009 21:50:30 Kees Nuyt wrote:
> A view or trigger in one database is not allowed to
> reference tables (or other views) in other databases. The
> reason is, the schema of the main database (in this case
> your :memory: database) would be invalid once the main
> database is opened without the attached database, or after
> detaching it.

So I can create table to saving view definitions and create these as "temp 
view" to all of attached databases or disable the check of views. I think the 
define such as SQLITE_DISABLE_VIEW_ON_ATTACHED_DATABASE may be useful in code.

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


Re: [sqlite] SQLite vs. Oracle (parallelized)

2009-02-27 Thread Alexey Pechnikov
Hello!

On Friday 27 February 2009 23:35:50 pyt...@bdurham.com wrote:
> I'm interested in exploring whether or not SQLite can be used as an ETL
> tool with large data sets (~80+ Gb). In this context, SQLite would be
> run on 64-bit Intel servers with lots of RAM (16-64 Gb). The data would
> be stored/processed on server local SCSI drives vs. located on a SAN.
> File access would be via a single process per SQLite database. The
> interface language would most likely be Python.

We are using some years SQLite dataset ~10 Gb on 32-bit Linux host (SATA HDD 
and 1 Gb RAM). PostgreSQL version of the dataset was more than 20 Gb and did 
work 60x slowly! It's not possible to upgrade hardware by some reasons and we 
did replace PostgreSQL database to SQLite because there are 50 users in system 
and performance was bad. AOL Server + tcl + SQLite is good for us. For each 
http query is used self database connection to SQLite database (for PostgreSQL 
we did use connection pools) and it's work fine when read operations are 
dominating. For dataset populating are used a batch writes by some demons and 
single write operations performed by users web interface. Dataset is splitted 
by months as single database for monthly data and these chunks can be attached 
when needed.

With your hardware I think 100Gb dataset is not limit.

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


Re: [sqlite] Is sqlite_master special? (Or, why SQLITE_MISUSE when preparing?)

2009-02-27 Thread Lukhnos D. Liu
On Feb 28, 2009, at 4:27 AM, D. Richard Hipp wrote:
> This is usually an indication that you passed in a database connection
> pointer to sqlite3_prepare() that had previously been closed.  For
> example:
>  sqlite3_close(db);
>  sqlite3_prepare(db, zSql, -1, &pStmt, 0);
> SQLite does *not* return SQLITE_MISUSE when the schema expires.  When
> the schema expires, it returns SQLITE_SCHEMA - a very different
> error.  SQLite will only return SQLITE_MISUSE if you attempt to use
> the SQLite interface in some way that it was not designed to operate.
> SQLITE_MISUSE errors are often probabilistically detected; in other
> words detection of misuse is not guaranteed.

I had this in mind when I was hunting down the bug, but I couldn't see  
any of my code path close the connection prematurely, and so while  
I'll keep an eye on it (as there is always a possible, unexpected, or  
even OS-induced sitution), now I have ruled out two possibilities (not  
using v2, closing connection prematurely), and wonder if there are  
other possible pathes leading to a SQLITE_MISUSE.

The fact that it occurred very rarely also made me wonder if it had to  
do with iPhone's own sqlite or with the some memory management/file  
system particularities of iPhone OS. I doubt it though.

d.





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


Re: [sqlite] SQLite vs. Oracle (parallelized)

2009-02-27 Thread python
Allan,

Thanks for your reply. I'm new to SQLite, but have used a similar list
of databases (with an emphasis on server vs. client side databases)
professionally for years. My background is designing and building
enterprise BI, ETL, and data warehouse systems using databases like
Oracle, DB2, SQL Server and ETL tools like Informatica, Ab Initio, BO
Data Integrator, etc.

My goal is to be able to offer our customers cost effective, high
performance alternatives to traditional commercial ETL solutions. We
recently re-implemented a mid-sized Oracle/Informatica based ETL system
in Python using in memory data structures (dicts) and improved the
performance by a factor of 20x. We're now looking to expand this
approach to SQLite for environments where the volume of data is greater
than available memory.

> When you talk about performance comparisons your question really needs to be 
> squared up to what the database is used for. Are you on a server, 
> workstation, or embedded? How large in the database? How are the internal 
> algos of the database engine lined up? What is the memory footprint? How did 
> you configure what is configurable in the database?

I'm interested in exploring whether or not SQLite can be used as an ETL
tool with large data sets (~80+ Gb). In this context, SQLite would be
run on 64-bit Intel servers with lots of RAM (16-64 Gb). The data would
be stored/processed on server local SCSI drives vs. located on a SAN.
File access would be via a single process per SQLite database. The
interface language would most likely be Python.

> The reality is I BET and I would love to know myself Sqlite is just as fast 
> on inserts to the same hard drive as oracle.

I would love to see such a benchmark as well.

> Are you some kind of political Oracle covering biggot?

LOL. No. I try to be as database agnostic as possible.

> Or, do you want another chance to post something that states you are trying 
> to find the best data storage solution to deliver sincere value to your 
> client in terms of a database choice?

Subtle point here ... I'm not looking for a long term data storage
solution - I'm exploring the possibility of using SQLite as a way to
validate, transform, and pre-aggregate raw data that would in turn be
exported to raw text files and imported (in final form) to a customer's
data warehouse.

> Sometimes that choice is Sqlite, but in some cases it is Oracle instead.

Agreed.

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


Re: [sqlite] Is sqlite_master special? (Or, why SQLITE_MISUSE when preparing?)

2009-02-27 Thread D. Richard Hipp

On Feb 27, 2009, at 2:30 PM, Lukhnos D. Liu wrote:
>
> Some casual search in SQLite's source code revealed that it was about
> some safety check mechanism (sqlite->magic), but it still didn't tell
> me when and what constitues a misuse.
>

This is usually an indication that you passed in a database connection  
pointer to sqlite3_prepare() that had previously been closed.  For  
example:

  sqlite3_close(db);
  sqlite3_prepare(db, zSql, -1, &pStmt, 0);

SQLite does *not* return SQLITE_MISUSE when the schema expires.  When  
the schema expires, it returns SQLITE_SCHEMA - a very different  
error.  SQLite will only return SQLITE_MISUSE if you attempt to use  
the SQLite interface in some way that it was not designed to operate.   
SQLITE_MISUSE errors are often probabilistically detected; in other  
words detection of misuse is not guaranteed.

D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] Is sqlite_master special? (Or, why SQLITE_MISUSE when preparing?)

2009-02-27 Thread Lukhnos D. Liu
On Feb 28, 2009, at 3:50 AM, Igor Tandetnik wrote:
> All statements prepared with sqlite3_prepare[16] are invalidated
> whenever you change database schema in any way. Next time you use  
> such a
> statement, you get SQLITE_MISUSE error and you have to finalize and
> re-prepare it.
> Use the newer sqlite3_prepare[16]_v2 API: it stores the text of the
> statement internally, and automatically re-prepares it as necessary.

Yes, that what I used and still use (sqlite3_prepare_v2). And the  
statement prepared was a SELECT statement that queries the existence  
of a table. I remember reading sqlite3.h that says use v2 instead, and  
I did, that's why it's more puzzling...

d.

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


Re: [sqlite] Is sqlite_master special? (Or, why SQLITE_MISUSE when preparing?)

2009-02-27 Thread Igor Tandetnik
"Lukhnos D. Liu" 
wrote in message
news:24584eea-b339-408d-805b-9616cc7d9...@lithoglyph.com
> Here's the interesting part. When my app failed, the preparation
> always returned SQLITE_MISUSE. That was a very curious error. I
> searched the documents, and it wasn't entirely clear to me why one
> would get SQLITE_MISUSE when preparing a statement.
>
> The problem was solved by finalziing the prepared statement
> *immediately* after it was used.
>
> Still, the question is why?

All statements prepared with sqlite3_prepare[16] are invalidated 
whenever you change database schema in any way. Next time you use such a 
statement, you get SQLITE_MISUSE error and you have to finalize and 
re-prepare it.

Use the newer sqlite3_prepare[16]_v2 API: it stores the text of the 
statement internally, and automatically re-prepares it as necessary.

Igor Tandetnik



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


[sqlite] Is sqlite_master special? (Or, why SQLITE_MISUSE when preparing?)

2009-02-27 Thread Lukhnos D. Liu
Hi all,

Lately I ran into an interesting problem. The problem is solved, but  
I'm really curious about the inner works of the sqlite_master table.

I have an iPhone application. In the previous version, there was a  
very slight chance (about 1%) that a query would fail. The user might  
be wondering what happened because their data didn't show up as  
expected. Close and re-open the app solved the problem, but that was  
not a fix. And the fact it was very difficult to reproduce made me  
wonder there must have been something deep beneath the surface.

It turned out that when the table in question was to be shown, I did  
an extra check if the table existed by querying the sqlite_master  
table. I did it by first preparing a statement then stepping on it.

Here's the interesting part. When my app failed, the preparation  
always returned SQLITE_MISUSE. That was a very curious error. I  
searched the documents, and it wasn't entirely clear to me why one  
would get SQLITE_MISUSE when preparing a statement.

Some casual search in SQLite's source code revealed that it was about  
some safety check mechanism (sqlite->magic), but it still didn't tell  
me when and what constitues a misuse.

The problem was solved by finalziing the prepared statement  
*immediately* after it was used.

Still, the question is why?

Before the fix, what I did is I wrapped the SQLite statement as an  
Objective-C object. After I used the statement, I put the object into  
an "autorelease pool". This is a nice design in Apple's Cocoa  
framework that lets you drop used objects into the pool, and when the  
execution goes back to the event loop, the event loop releases  
(decreases the ref count) of every object in the pool. This is a nice  
way to do refcount-based memory management because you don't need to  
remember to call release in every exit point of a scope.

The catch seems to be (at least from my observation): Because when an  
autorelease pool is "drained", the order the objects are released  
(refcount--) is not deterministic. I might have a bunch of prepared  
SQLite statements released in a batch. Interestingly, statements that  
involve other tables seem to do fine with the indeterminsitic prepare/ 
finalize order. But for the statements prepared on sqlite_master, it  
seems *probable* that if the prepared statement is not finalized  
before any other new statements are prepared, it constitutes a  
SQLITE_MISUSE.

Also, if I got a SQLITE_MISUSE, all subsequent prepare calls got  
SQLITE_MISUSE in return. When means my app couldn't function further  
(although the situation was rare and mild/robust enough, no data was  
harmed, and the app wouldn't crash).

A user reported that if there was a background process running (for  
example iPod.app, the music player), there seemed to be a higher  
probability such failure would happen. My app did have some  
multithreading code, but I ruled it out in the early stage by ensuring  
that statements were prepared/used in the main thread. Or is there  
something special in Apple's version of SQLite (shared SQLite global  
data for all apps, for example? That was my very random conjecture).

Lukhnos D. Liu





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


Re: [sqlite] Best GUI?

2009-02-27 Thread Soft In The Box
Hi,

Similar to SQL developer => wxSQLite+

Free: GPL v3
for Linux (compiled provided for mandriva 2009) but sources are provided.

Nuno Magalhães a écrit :
>> Here lots of  SQLite management tools
>>
>> http://www.sqlite.org/cvstrac/wiki?p=ManagementTools
>> 
>
> Keyword being "lots". I've been to that site, which was what prompted
> me to write in the first place. I'm looking for either web-based or
> *nix. I know there are lots, i just want to know which one(s) you
> recomend and why. I've been using a firefox plugin called SQLite
> Manager but am not happy with it, i'd like more options, something
> similar to Oracle's SQLDeveloper (pref without the Java™) or even
> Access.
>
> Btw, vi and sh do not qualify as GUI, i have my own tools for that, thanks.
>
> Nuno Magalhães
> LU#484677
> ___
> 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] Best GUI?

2009-02-27 Thread Nuno Magalhães
> Here lots of  SQLite management tools
>
> http://www.sqlite.org/cvstrac/wiki?p=ManagementTools

Keyword being "lots". I've been to that site, which was what prompted
me to write in the first place. I'm looking for either web-based or
*nix. I know there are lots, i just want to know which one(s) you
recomend and why. I've been using a firefox plugin called SQLite
Manager but am not happy with it, i'd like more options, something
similar to Oracle's SQLDeveloper (pref without the Java™) or even
Access.

Btw, vi and sh do not qualify as GUI, i have my own tools for that, thanks.

Nuno Magalhães
LU#484677
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] view and attach database problem

2009-02-27 Thread Kees Nuyt
On Fri, 27 Feb 2009 16:25:28 +0300, Alexey Pechnikov
 wrote:

>Hello!
>
>I did try
>
>$ sqlite3 :memory:
>SQLite version 3.6.11
>Enter ".help" for instructions
>Enter SQL statements terminated with a ";"
>sqlite> attach database 'merch.db' as work;
>sqlite> create view test as select * from work.users;
>SQL error: view test cannot reference objects in database work

A view or trigger in one database is not allowed to
reference tables (or other views) in other databases. The
reason is, the schema of the main database (in this case
your :memory: database) would be invalid once the main
database is opened without the attached database, or after
detaching it.

This should work though:
sqlite> create view work.test as select * from work.users;

Also, you can SELECT  JOIN across databases, but you
can't store that as a view in any of the databases.

Remember, a view isn't much more than a stored select
statement, so it's not as bad as it seems.

>But it's work some time ago! 
>How can I create view for attached databases now?

You can't, but you can create it in the attached database.

>Create table is bad becouse attached database may be huge.

You can select directly:
select * from work.users;

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


Re: [sqlite] Best GUI?

2009-02-27 Thread Soft In The Box
Hi,

Here lots of  SQLite management tools

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

Best regards

Fred

Nuno Magalhães a écrit :
> Greetings,
>
> This is a bit of a religious question, but which are the mest/most
> popular *nix GUIs out there? I'm using a firefox plugin but not
> entirely happy with it. What do you use and why?
>
> TIA,
> Nuno Magalhães
> LU#484677
> ___
> 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] "parameters are not allowed in views"

2009-02-27 Thread Alexey Pechnikov
Hello!

On Friday 27 February 2009 18:08:19 you wrote:
> [string map {\; "" \[ "" \] "" $user_id]
>
> you can get rid of most threats, right?

We can do
set param {test' sql with some injection}
puts $param
set param [db onecolumn {select quote($param)}]
puts $param

and get result
test' sql with some injection
'test'' sql with some injection'

Well, it's good. And now query 
db eval "create view view_events as select * from events where value!=$param"
is valid.

But how about construction such as
db eval {create view view_events as select * from events where value!=#param}
were #param wiil be automatically replaced by result of {select 
quote($param)}?

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


[sqlite] Unsigned int 64 in WHERE

2009-02-27 Thread Vivien Malerba
Hi!

I have a table with a timestamp column which I use to insert sqlite_uint64
values using sqlite3_bind_int64()
(values are retreived using sqlite3_column_int64() with a cast to
sqlite_uint64). This works fine with the C API.

The problem is that when I try to use the sqlite3 command line, if I use:
SELECT data FROM mytable WHERE ts=18446744072622041475;
I get no result at all (the 18446744072622041475 value is too big to fit
into a signed 64 bit integer, but it fits in an unsigned 64 bits integer),
so I have to use
SELECT data FROM mytable WHERE ts=-1087510141;

In other terms, I have to use the signed 64 bits integer in my WHERE clause
(2^64-1087510141 = 1844674407262204147).

Is there any other way of storing an unsigned 64 bits integer in the
database than storing it as a signed value and casting its binary value to
unsigned, for example if there was a sqlite3_bind_Uint64() and a
sqlite3_column_Uint64()?

Thanks a lot,

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


Re: [sqlite] "parameters are not allowed in views"

2009-02-27 Thread Alexey Pechnikov
Hello!

On Friday 27 February 2009 17:32:36 Arjen Markus wrote:
> This is the Tcl binding, right?
> You could replace the variable by its value using [string map]:
>
> db eval [string map [list USER_ID $user_id ...] $sql_statement]
>
> or more directly:
>
> db eval \
>  "CREATE TABLE view_report_01 AS ...
>  WHERE u.id = $user_id
>  ..."
>

With SQL injection security problems as result. It's not a good decision.


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


[sqlite] "parameters are not allowed in views"

2009-02-27 Thread Alexey Pechnikov
Hello!

Is there way to careate view such as

db eval {
CREATE TABLE view_report_01 AS
?SELECT s.name ?AS service_name,
? t_l_r.cost AS cost
?FROM work.users ? AS u,
? work.user_contracts ?AS u_c,
? work.user_services ?AS u_s,
? work.services ? AS s,
? telephony.telephony_log_rating AS t_l_r,
? telephony.telephony_log ?AS t_l
?WHERE u.id = $user_id
?AND u.id = u_c.user_id
?AND u_c.id = u_s.owner_id
?AND u_s.service_id = s.id
?AND u_s.id = t_l_r.user_service_id
?AND t_l_r.log_id = t_l.rowid
?AND ($date_from = '' OR julianday(date2iso($date_from)) < t_l.date_start)
?AND ($date_to = '' OR (julianday(date2iso($date_to)) + 1) > t_l.date_start)
}

I have params $user_id, $date_from, $date_to. There are a lot of queries to 
this view and is needed to place params in the view.

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


Re: [sqlite] view and attach database problem

2009-02-27 Thread Alexey Pechnikov
Hello!

On Friday 27 February 2009 16:25:28 Alexey Pechnikov wrote:
> But it's work some time ago! How can I create view for attached databases
> now? Create table is bad becouse attached database may be huge.

I did patch attach.c as

/*  sqlite3ErrorMsg(pFix->pParse,
 "%s %T cannot reference objects in database %s",
 pFix->zType, pFix->pName, pItem->zDatabase);
  return 1;*/
  return 0;

but may be is exists "true" way?

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


Re: [sqlite] SQLite vs. Oracle (parallelized)

2009-02-27 Thread Igor Tandetnik
"Chris Wedgwood"  wrote in message
news:20090226172406.ga685...@puku.stupidest.org
> On Thu, Feb 26, 2009 at 09:53:18AM -0600, Jay A. Kreibich wrote:
>
>>   I've always wondered about this... someone please correct me if I'm
>>   wrong, but my understanding is that there wasn't any difference
>>   between a left and right join except for the argument order.  It
>>   seems like implementing right joins should be pretty easy by just
>>   having the parser reverse the arguments when it builds the parse
>>   tree.  I realize that might screw with the optimizer a bit, but is
>>   there anything obvious I'm missing?
>
> When you use a right and a left join together you can't do that.
> Sometimes you can restructure the queries to make use or two left
> joins or a sub-query, but it's often cumbersome and not always the
> same thing.
>
> If in general there is a way to turn something like
>
>  select c1,c2,c3 from m left join l on l.mid=m.id right join r on
> l.rid=r.id
>
> into something conceptually the same that only uses left joins then
> perhaps the optimizer could do this for us.

An equivalent query using only left joins would look something like 
this:

select c1,c2,c3
from r left join (m left join l on l.mid=m.id) ml on ml.rid=r.id;

The problem, I believe, is not in parsing right joins or replacing them 
with equivalent left joins, but in optimizing the resulting statement. 
SQLite's optimizer is fairly simple: I suspect if it sees something like 
the above, it'll throw its hands up in the air and resort to full table 
scans all around.

For this reason, right joins likely have to be natively supported by the 
optimizer - you can't just fake them by transforming the parse tree.

Igor Tandetnik 



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


Re: [sqlite] Best GUI?

2009-02-27 Thread Jay A. Kreibich
On Thu, Feb 26, 2009 at 03:04:05PM -0600, Mike Eggleston scratched on the wall:
> On Thu, 26 Feb 2009, Nuno Magalh?es might have said:
> 
> > This is a bit of a religious question, but which are the mest/most
> > popular *nix GUIs out there? I'm using a firefox plugin but not
> > entirely happy with it. What do you use and why?
> 
> I prefer vi and sh.

  +1, although I'm a ksh person myself.

   -j

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

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Quotas

2009-02-27 Thread João Eiras
Not doing any much. Just investigating. I'm actually more concerned
with the html5 things.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Quotas

2009-02-27 Thread D. Richard Hipp

On Feb 27, 2009, at 8:50 AM, João Eiras wrote:

> Well, i don't know enough of sqlite and I was told there was no such
> feature. But what you wrote might be enough.
> thank you.
>
> On Fri, Feb 27, 2009 at 2:31 PM, D. Richard Hipp   
> wrote:
>>
>> On Feb 27, 2009, at 8:17 AM, João Eiras wrote:
>>
>>> Howdy!
>>>
>>> As you probably know, rendering engines are bundling SQLite to  
>>> provide
>>> the HTML5 Database API to webpages and widgets.
>>> Then 3rd party webpages would access the database API to write data.
>>> There should be a way for the user agent to control quotas. I was  
>>> told
>>> on IRC that currently such feature is not supported.
>>

So, João, which rendering engine are you working on?  And how can we  
help?


>>
>> I am not sure what you mean by "quotas".  But see the following:
>>
>> http://www.sqlite.org/c3ref/limit.html
>> http://www.sqlite.org/pragma.html#pragma_max_page_count
>> http://www.sqlite.org/c3ref/set_authorizer.html
>>
>> Between the max_page_count pragma, the sqlite3_limit() interface, and
>> the sqlite3_set_authorizer() interface, can you not sufficiently lock
>> down SQLite so that it is safe for use from potentially hostile
>> scripts?  What do you think is missing?
>>
>>
>> D. Richard Hipp
>> d...@hwaci.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

D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] Quotas

2009-02-27 Thread João Eiras
Well, i don't know enough of sqlite and I was told there was no such
feature. But what you wrote might be enough.
thank you.

On Fri, Feb 27, 2009 at 2:31 PM, D. Richard Hipp  wrote:
>
> On Feb 27, 2009, at 8:17 AM, João Eiras wrote:
>
>> Howdy!
>>
>> As you probably know, rendering engines are bundling SQLite to provide
>> the HTML5 Database API to webpages and widgets.
>> Then 3rd party webpages would access the database API to write data.
>> There should be a way for the user agent to control quotas. I was told
>> on IRC that currently such feature is not supported.
>
>
> I am not sure what you mean by "quotas".  But see the following:
>
>     http://www.sqlite.org/c3ref/limit.html
>     http://www.sqlite.org/pragma.html#pragma_max_page_count
>     http://www.sqlite.org/c3ref/set_authorizer.html
>
> Between the max_page_count pragma, the sqlite3_limit() interface, and
> the sqlite3_set_authorizer() interface, can you not sufficiently lock
> down SQLite so that it is safe for use from potentially hostile
> scripts?  What do you think is missing?
>
>
> D. Richard Hipp
> d...@hwaci.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] Quotas

2009-02-27 Thread D. Richard Hipp

On Feb 27, 2009, at 8:17 AM, João Eiras wrote:

> Howdy!
>
> As you probably know, rendering engines are bundling SQLite to provide
> the HTML5 Database API to webpages and widgets.
> Then 3rd party webpages would access the database API to write data.
> There should be a way for the user agent to control quotas. I was told
> on IRC that currently such feature is not supported.


I am not sure what you mean by "quotas".  But see the following:

 http://www.sqlite.org/c3ref/limit.html
 http://www.sqlite.org/pragma.html#pragma_max_page_count
 http://www.sqlite.org/c3ref/set_authorizer.html

Between the max_page_count pragma, the sqlite3_limit() interface, and  
the sqlite3_set_authorizer() interface, can you not sufficiently lock  
down SQLite so that it is safe for use from potentially hostile  
scripts?  What do you think is missing?


D. Richard Hipp
d...@hwaci.com



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


Re: [sqlite] Writing SQL with special characters

2009-02-27 Thread Igor Tandetnik
"Greg Robertson" 
wrote in message
news:151e70a00902270415t55996dccs5035ee4209f97...@mail.gmail.com
> I have tried out both methods in the FireFox extension SQLite Manager
> and neither appears to work.

Define "doesn't work". Do you get an error? If the statement succeeds 
but the value appears to have just one line when you view the data in 
SQLite Manager, it's more likely that the data in the table is actually 
correct but the UI presents it incorrectly. To confirm, try this 
statement:

select hex(Field1) from Table1;

Watch for 0A octet in the hex representation.

> Perhaps it is just FireFox parsing the
> special character?

Perhaps. In any case, this should work:

UPDATE TableA SET Field1 = 'line 1' || x'0a' || 'line 2';

Igor Tandetnik



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


[sqlite] view and attach database problem

2009-02-27 Thread Alexey Pechnikov
Hello!

I did try

$ sqlite3 :memory:
SQLite version 3.6.11
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> attach database 'merch.db' as work;
sqlite> create view test as select * from work.users;
SQL error: view test cannot reference objects in database work

But it's work some time ago! How can I create view for attached databases now? 
Create table is bad becouse attached database may be huge.

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


Re: [sqlite] Best GUI?

2009-02-27 Thread Michael Comperchio
Mike Eggleston wrote:
> On Thu, 26 Feb 2009, Nuno Magalh?es might have said:
>
>   
>> This is a bit of a religious question, but which are the mest/most
>> popular *nix GUIs out there? I'm using a firefox plugin but not
>> entirely happy with it. What do you use and why?
>> 
>
> I prefer vi and sh.
>
> Mike
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   
Real men code in binary. Like CodeBlocks & good old 'sql' myself.

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


[sqlite] Quotas

2009-02-27 Thread João Eiras
Howdy!

As you probably know, rendering engines are bundling SQLite to provide
the HTML5 Database API to webpages and widgets.
Then 3rd party webpages would access the database API to write data.
There should be a way for the user agent to control quotas. I was told
on IRC that currently such feature is not supported.

The sqlite api would be something like:
sqlite3_set_quota_handling(sqlite3 *db, sqlite3_quota_handling*);
sqlite3_set_quota_listener(sqlite3 *db, sqlite3_quota_handling*
(*listener_fn)(void* args, sqlite3_quota_warning* sqllite3_args), void
*args)

where:
 - sqlite3_quota_warning would be a struct with info about current
size of database, size of quota, new size of database after DML
exceeds quota
 - sqlite3_quota_handling would be a struct which specifies quota
handling, like limit in bytes, flag to tell if quota should increase
or not.

sqlite3_set_quota_handling would be called by the host codebase to set
quota policies.
sqlite3_set_quota_listener would be called by the host codebase to set
a quota exceeding listener.
 - is during some DML the quota is exceeded, SQLite halts everything
and calls the listener function to tell the host that quota will
exceed and ask if a new quota policy should be defined. If the host
returns a new quota policy which tells to expand to a new size then
things continue normally. If there is no quota exceed listener, or the
listener returns a policy of NOT increasing quota, then the SQLite
function which executes statements returns QUOTA_EXCEEDED_ERROR which
would be similar to an out-of-disk error, and the whole transaction
should be rolled back.

This API of course is just a raw definition I came up when writing this email.
There might be some cases I forgot, but this kind of handling enabled
the user to tell if he/she allows the database to increase.

So, what do you think ?

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


Re: [sqlite] SQLite

2009-02-27 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

venugopala Reddy wrote:
> I am working on SQLite with C#.net-2008 Mobile application.
> I tried to connect SQLite db through C# Mobile application, It gives error.
> Any one please suggest "What are the requirements to Using SQLite in C#
> Mobile application."

http://www.catb.org/~esr/faqs/smart-questions.html

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

iEYEARECAAYFAkmn3zoACgkQmOOfHg372QSl/gCgupo0XfQgV7DSg3o9duhFssT/
YtgAoL5r7Zm3PBiz65KABhnLrYUtJ3Va
=zHQf
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A bit OT: Good CVS client for Windows

2009-02-27 Thread Dave Dyer
At 01:28 PM 2/26/2009, J. R. Westmoreland wrote:
>Can someone please give me a suggestion for a good client for CVS that runs
>under Windows?

Use tortoise cvs. It's wonderful.
http://www.tortoisecvs.org/

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


Re: [sqlite] Best GUI?

2009-02-27 Thread Mike Eggleston
On Thu, 26 Feb 2009, Nuno Magalh?es might have said:

> This is a bit of a religious question, but which are the mest/most
> popular *nix GUIs out there? I'm using a firefox plugin but not
> entirely happy with it. What do you use and why?

I prefer vi and sh.

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


Re: [sqlite] SQLite vs. Oracle (parallelized)

2009-02-27 Thread Chris Wedgwood
On Thu, Feb 26, 2009 at 09:53:18AM -0600, Jay A. Kreibich wrote:

>   I've always wondered about this... someone please correct me if I'm
>   wrong, but my understanding is that there wasn't any difference
>   between a left and right join except for the argument order.  It
>   seems like implementing right joins should be pretty easy by just
>   having the parser reverse the arguments when it builds the parse
>   tree.  I realize that might screw with the optimizer a bit, but is
>   there anything obvious I'm missing?

When you use a right and a left join together you can't do that.
Sometimes you can restructure the queries to make use or two left
joins or a sub-query, but it's often cumbersome and not always the same
thing.

If in general there is a way to turn something like

  select c1,c2,c3 from m left join l on l.mid=m.id right join r on l.rid=r.id

into something conceptually the same that only uses left joins then
perhaps the optimizer could do this for us.

There might be corner cases though were such a transform isn't
possible.  When it's vague like this I defer to people like Igor who's
SQL abilities constantly amaze me.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] SQLite

2009-02-27 Thread venugopala Reddy
Hi,

I am working on SQLite with C#.net-2008 Mobile application.
I tried to connect SQLite db through C# Mobile application, It gives error.
Any one please suggest "What are the requirements to Using SQLite in C#
Mobile application."

I am waiting for u reply...

-- 
Regards & Have a nice Day
Venu Gopala Reddy.D
Software Engineer.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Maximum number of concurrent users

2009-02-27 Thread Allan Edwards
Why not just answer, unlimited to the POWA of your server?  hehe

On Thu, Feb 26, 2009 at 6:54 AM, D. Richard Hipp  wrote:
>
> On Feb 26, 2009, at 6:28 AM, Eversogood wrote:
>
>> Hi,
>>
>> What is the maximum number of concurrent users for SQLite?
>>
>
> There is no limit, though writes are serialized.
>
> Your question betrays that you are thinking of SQLite as if it were
> any other client/server database engine.  It is not.  SQLite is not a
> replacement for Oracle/MySQL/PostgreSQL.  SQLite is designed to
> replace fopen().  If you are looking for an Oracle replacement, SQLite
> is probably not for you.
>
> D. Richard Hipp
> d...@hwaci.com
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
W Allan Edwards
214-289-2959
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Writing SQL with special characters

2009-02-27 Thread Greg Robertson
I have tried out both methods in the FireFox extension SQLite Manager
and neither appears to work. Perhaps it is just FireFox parsing the
special character?

Greg

--

You can use the hex code of the non-printable character:

update tableA set field1 = "line1 x'0a' line2"

-Toby

>Are there any docs for how to write SQL for special characters like
>return and linefeed?
>
>On some systems (eg. http://www.wilsonmar.com/1eschars.htm) return is
>\n so an SQL might be something like:
>
>UPDATE TableA SET Field1 = "line 1\nline 2"
>
>which would produce:
>
>line 1
>line 2
>
>in Field1
>
>Is there somewhere I can find out how I can set special characters in SQLite?
>
>
>Thanks
>
>Greg
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] A bit OT: Good CVS client for Windows

2009-02-27 Thread Virgilio Fornazin
Eclipse perform better for me than other all (Tortoise, WinCVS, etc).
Cross platform, excelent branching / merging support, visual list of
modified files, etc.

On Fri, Feb 27, 2009 at 03:51, J Jayavasanthan wrote:

> You can also use GNU WinCVS, http://www.wincvs.org/download.html
> Regards,
> Jay
>
> On Fri, Feb 27, 2009 at 3:07 AM, Sherief N. Farouk  >wrote:
>
> >
> >
> > On Feb 26, 2009, at 16:28, "J. R. Westmoreland"  wrote:
> >
> > > Can someone please give me a suggestion for a good client for CVS
> > > that runs
> > > under Windows?
> > >
> > > I have my linux system but figured it would be nice to have a client
> > > in both
> > > places, a belt and suspenders kind of person I guess.
> > >
> > >
> > >
> > > Thanks,
> > >
> > > J. R.
> > >
> > >
> > >
> > > 
> > >
> > > J. R. Westmoreland
> > >
> > > E-mail: j...@jrw.org
> > >
> > >
> > >
> > > ___
> > > 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
> >
>
>
>
> --
> first me then home
> first home then country
> first country then world
> fools always read inverse
> ___
> 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] SQLite vs. Oracle (parallelized)

2009-02-27 Thread Alexey Pechnikov
Hello!

On Thursday 26 February 2009 18:53:18 Jay A. Kreibich wrote:
>   I agree.  The only major addition I'd like to see is full support for
>   referential integrity.  I know you can fake it, to a degree, with
>   triggers, but I'd still like to see it baked into the database engine
>   itself.

But why? I did use only triggers for referential integrity checks in 
PostgreSQL because trigger can return user-friendly description on national 
lang. As example from SQLIte-based project for russian users:

CREATE TRIGGER users_update_before before update on users begin
  select RAISE (ABORT,'Нельзя изменять идентификатор')
WHERE OLD.id != NEW.id;
  SELECT RAISE(ABORT, 'Указан несуществующий регион.')
WHERE NEW.region_id != '' AND (select ROWID from regions where 
id=NEW.region_id) IS NULL;
  SELECT RAISE(ABORT, 'Пользователь с указанным именем уже существует! 
Пожалуйста, придумайте для этого пользователя другое имя.')
WHERE  (SELECT ROWID FROM users WHERE nickname = NEW.nickname and 
rowid!=NEW.rowid) IS NOT NULL;
end;

Standart foreign key error message is not good for users. User does not 
understand message such as "Foreign key error: ... key ... table...".

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


Re: [sqlite] problem reading in SQL file with To_Date from Oracle

2009-02-27 Thread Alexey Pechnikov
Hello!

On Friday 27 February 2009 01:17:51 D. Richard Hipp wrote:
> > Then, I ran the .read command in sqlite3 to read in the sql  
> > statements.
> > sqlite doesn't support the TO_Date function.
>
> Please send me an example of the TOAD-generated INSERT statement that  
> includes a TO_Date function.

I did use this functions:

#Access now()
proc now {} {clock format [clock seconds] -format "%Y-%m-%d %H:%M:%S" -gmt 0};
#Read Oracle date format
proc oradate {date} {clock format [clock scan $date] -format "%Y-%m-%d %H:%M:
%S" -gmt 0};

May be possible to add this to SQLite corefuncs?

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


Re: [sqlite] Best GUI?

2009-02-27 Thread Alexey Pechnikov
Hello!

On Friday 27 February 2009 00:44:05 Alan Cohen wrote:
> This is a bit of a religious question, but which are the mest/most
> popular *nix GUIs out there? I'm using a firefox plugin but not
> entirely happy with it. What do you use and why?

I'm prefer tksqlite: 
http://reddog.s35.xrea.com/wiki/TkSQLite.html

And GUI from Spatialite project is useful for GIS developers:
http://www.gaia-gis.it/spatialite/

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


Re: [sqlite] manual with sample C programs

2009-02-27 Thread liubin liu

This's very good!

I just download the codes from here:
http://www.apress.com/book/downloadfile/2847


dcharno wrote:
> 
>> Could you tell me where can I find such documentation, or can you
>> recommend some books.
> 
> "The Definitive Guide to SQLite" by Michael Owens explains the SQLite 
> API in detail and provides a number of samples in C.
> ___
> 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/manual-with-sample-C-programs-tp22215461p22243521.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_column_value

2009-02-27 Thread Ondrej Filip

Good morning

I have problem with sqlite3_column_value function. I'm porting one project
using sqlite to version 3.3.6 but I'm not able to find when this function
were added to sqlite.

Thanks for reply
-- 
Ondrej Filip
e-mail: ondrej.fi...@zonio.net
mobile: 721 22 50 10
jabber: nezna...@jabber.cz
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] problem with SQLITE_FULL

2009-02-27 Thread Nuno Lucas
On Fri, Feb 27, 2009 at 8:06 AM, Wenton Thomas  wrote:
> I  used sqlite 3.5.9  in my application.
> I attempt to insert  1000 records. When i inserted 700 records, 
> sqlite3_step() return SQLITE_FULL.
> The free disk space is about 1,300M and  max id in the table is 700.
> I have no idea how to solve it.

Maybe what is full is the partition where the temporary files are created?


Regards,
~Nuno Lucas

> Could anyone help me?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] sqlite3_open expensive?

2009-02-27 Thread Nuno Lucas
On Mon, Feb 23, 2009 at 12:57 PM, Christoph Schreiber  wrote:
> hi!
> how expensive is sqlite3_open? i'm working on a small 
> (one-thread-per-connection) server. is it smart (in terms of cpu-time and 
> memory usage) to use sqlite3_open for every connection or is it better to 
> create a pool of pre-opened sqlite-connections?

SQLite needs to parse the database schema every time you open the
database, which can take some time if your schema is big (many tables
in single database).

Usually this is fast enough, but if you have no control on the schema
of the databases you will be opening maybe a safe bet is to cache
connection handlers.

Regards,
~Nuno Lucas

> regards, luky
>
> ps: sqlite3_enable_shared_cache is turned on.
>
>
>
> ___
> 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] problem with SQLITE_FULL

2009-02-27 Thread Wenton Thomas
I  used sqlite 3.5.9  in my application.
I attempt to insert  1000 records. When i inserted 700 records, sqlite3_step() 
return SQLITE_FULL.
The free disk space is about 1,300M and  max id in the table is 700.
I have no idea how to solve it.

Could anyone help me?



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