Re: [sqlite] Triggers and TEMP tables: ticket #1689

2006-02-28 Thread K. Haley
[EMAIL PROTECTED] wrote:
> A user complains in ticket #1689 that SQLite does not
> allow triggers in one database to refer to tables in
> a different database or to TEMP tables.
...
> Should I remove the tests from SQLite that prevent
> triggers in one database from referring to tables in
> a different database?  Or should I leave things as
> they are and close ticket #1689 with a remark of
> "works as designed".
I don't really see any reason to do it.  When I use attach, I create a
function to open the main db and attach any extra db's as well as add
any temp triggers I may need.  I couldn't find anything in the ticket to
indicate that the user couldn't use this method.  After all, there's
nothing to prevent someone from dropping the trigger, altering the db,
the re-creating the trigger if a persistent version were allowed.




signature.asc
Description: OpenPGP digital signature


Re: [sqlite] [kde-announce] Kexi 1.0 beta 1 released

2006-02-28 Thread Luiz Americo Pereira Camara

Vishal Kashyap escreveu:

Why is this mail here.
Does this software support SQlite as backend ???
  
Yes. In fact is the default file format. See 
http://kexi-project.org/wiki/wikiview/index.php?KexiFAQ#3._File_Formats


Luiz


Re: [sqlite] Oracle's SQLite???

2006-02-28 Thread Firman Wandayandi
On 3/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> As ssen at http://www.linuxdevices.com/news/NS3880195342.html
>
>   The Acme Fox also supports PHP development, optionally
>   with Oracle's open source SQLite database.
>
>
> Amusing, but not true.

Heh, Oracle's SQLite? crap

--
Firman Wandayandi
Never Dreamt Before: http://firman.dotgeek.org/
Wishlist: http://www.amazon.com/gp/registry/1AAN8NZBHW2W9


Re: [sqlite] OT: Donations?

2006-02-28 Thread drh
"Denis Sbragion" <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> might be a bit off topic, but, is there any way to make donations to SQLite? I
> haven't been able to find informations on the SQLite web site.
> 

There is no mechanism set up to "donate" to SQLite as there
is with other open-source projects.  If you want to donate
something, please make a donation in honor of SQLite to a
charity of your choice.

--
D. Richard Hipp   <[EMAIL PROTECTED]>



[sqlite] Oracle's SQLite???

2006-02-28 Thread drh
As ssen at http://www.linuxdevices.com/news/NS3880195342.html

  The Acme Fox also supports PHP development, optionally
  with Oracle's open source SQLite database.
   

Amusing, but not true.
--
D. Richard Hipp   <[EMAIL PROTECTED]>



[sqlite] memory database, ATTACH, and threads

2006-02-28 Thread Kervin L. Pierre

Hello,

I am not sure if that is exactly the problem, but
it seems that sqlite3_prepare() deadlocks when called
to attach a in-memory database that is already attached.

The second ATTACH occurs on a separate thread with a
separate handle to a database that is already opened in
the process.

Is that known behavior?

If a thread is attached on a database handle, and the
database is opened on a separate handle, should the
memory database be attached to the second handle as well?

Best Regards,
Kervin


Re: [sqlite] [kde-announce] Kexi 1.0 beta 1 released

2006-02-28 Thread Vishal Kashyap
Why is this mail here.
Does this software support SQlite as backend ???

On 2/28/06, Jarosław Staniek <[EMAIL PROTECTED]> wrote:
>
> For original announcement with links see
> http://kexi-project.org/wiki/wikiview/index.php?1.0Beta1Announcement
>
> ---
>  Kexi Team Ships Beta Version of the First Major 1.0 Release to Free
>  Integrated Database Environment
>
> January 31, 2006 (The INTERNET). The Kexi Team today announced the
> immediate availability of Kexi 1.0 Beta 1, codenamed "Black Mamba", the
> newest release of the integrated environment for managing data.
>
>
>  Changes
>
> (since 0.9 version)
>
>  * Improved data-aware forms.
>  * Form Designer's Data Source Pane for assigning data source to
>forms and widgets. Object tree view for easier navigating within
>widgets hierarchy.
>  * Import from CSV files and pasting tabular data from clipboard.
>Export data to CSV files and copying tabular data to clipboard.
>Automatic detection of delimiters and column types.
>  * Improved server connection dialog. Stored connection data.
>  * Support for images in forms (stored as BLOBs).
>  * New form widget: multiline editor.
>  * Improved MS Access (MDB) file import (optional plugin).
>  * Improved import of server databases to a file-based projects.
>Entire Kexi projects (not only tables) can be imported too.
>  * Scripting plugin (Python and Ruby) to extend functionality,
>including example script for HTML export.
>  * Simple printouts, print settings and print preview for table and
>query data.
>  * Handbook added (incomplete).
>  * More than two hundreds of overall improvements and bug fixes.
>
> See also Detailed information on changes
>  and Screenshots
> .
>
>
>  Download
>
> Kexi binary packages provided by some Linux/UNIX vendors are available
> within KOffice release
> .
> Testing Facilities with klik  are also available.
>
> MS Windows installation package from OpenOffice Polska
>  is available
> .
>
> Full Kexi source code ready to compile can be obtained with instructions
> here
> .
>
>
>  More information
>
> This version is released within KOffice KOffice 1.5 Beta 1
> .
>
> *How to compile Kexi*. To learn how to compile Kexi, see this document
> .
>
> *Support.* Kexi users are invited to report bugs and wishes. This can be
> done by using the KDE Bug Tracking System .
>
> *Unsupported features.* Updated list of unsupported features and known
> problems is also available
> .
>
>
>  News
>
> *Mailing lists* for users and developers are now available
> .
>
> *Jobs*. /"Ask not what Kexi can do for you, ask what you can do for
> Kexi"/. Kexi Team is looking for developers, and package maintainers
> (vide supported Linux distributions). Translators, testers, users and
> development documentation writers, and any other forms of support are
> also welcome. Contact  the
> Team for more information.
>
> *Multiplatform Availability.* Kexi on Linux (e.g. Debian) is available
> for many architectures ,
> including 64-bit Intel/AMD and Apple PowerPC.
>
> *Features in progress.* Scripting using Python and Ruby languages; Auto
> Field widgets in forms.
>
>
>  Sponsorship
>
> Kexi is developed by Kexi Team - an international group of independent
> developers, with assistance and workforce coming from the OpenOffice
> Polska  company.
>
>
>  About Kexi
>
> Kexi is an integrated environment for managing data. It can be used for
> creating database schemas; inserting data; performing queries, and
> processing data. Forms can be created to provide a custom interface to
> your data. All database objects - tables, queries and forms - are stored
> in the database, making it easy to share databases.
>
> As Kexi is a real member of the K Desktop Environment
>  and KOffice  projects, it
> integrates fluently into both on Linux/Unix. It is designed to be fully
> usable also without running KDE Desktop on Linux/Unix, MS Windows and
> Mac OS X platforms.
>
> Kexi is considered as a long awaited Open Source competitor for MS
> Access, Filemaker and Oracle Forms. Its development is motivated by the
> lack of Rapid Application Development (RAD) tools for database systems
> that are s

[sqlite] sqlite3_step() never returns an error code

2006-02-28 Thread Ryan M. Lederman
I'm using SQLite under Windows CE, and I cannot for the life of me get an
error code from sqlite3_step(), even when the SQL statement I compiled with
sqlite3_prepare() is clearly not valid (wrong # of columns, column type
mismatch, etc.)
 
It *never* returns anything other than SQLITE_DONE or SQLITE_ROW.  What am I
doing wrong?
 
// Ryan M. Lederman
// Windows Development Lead,
// Kayako Infotech Ltd.
 


Re: [sqlite] sqlite3_last_insert_rowid in transactions

2006-02-28 Thread Clay Dowling

[EMAIL PROTECTED] said:
> "Clay Dowling" <[EMAIL PROTECTED]> wrote:
>>
>> Can I get a reliable rowid from [sqlite3_last_insert_rowid()]
>> while I'm in the middle of a transaction
>>
>
> Yes.  Why would you think otherwise?

Because I work all day with SQL Server.  I have to issue a query to get
that data, and it's a query on data that doesn't actually exist yet in SQL
Server, so it tends to return 0 (this from memory; I haven't tried it in a
while).  It makes me cautious about assuming things.

Clay Dowling
-- 
Simple Content Management
http://www.ceamus.com



Re: [sqlite] sqlite3_last_insert_rowid in transactions

2006-02-28 Thread drh
"Clay Dowling" <[EMAIL PROTECTED]> wrote:
> 
> Can I get a reliable rowid from [sqlite3_last_insert_rowid()]
> while I'm in the middle of a transaction
> 

Yes.  Why would you think otherwise?

--
D. Richard Hipp   <[EMAIL PROTECTED]>



[sqlite] sqlite3_last_insert_rowid in transactions

2006-02-28 Thread Clay Dowling
I'm using SQLite in a performance-intensive data conversion process and
it's come about that it would be very useful to get the insert_rowid of
the last record inserted while I'm still in the middle of a transaction of
servert hundred inserts(the primary key will become a foreign key to a
child table).

Can I get a reliable rowid from this call while I'm in the middle of a
transaction, without interrupting the transaction?  The large transactions
are too important to sacrifice just to get this information, but it would
make the programming a lot easier to have this data.

Clay
-- 
Simple Content Management
http://www.ceamus.com



RE: [sqlite] Triggers and TEMP tables: ticket #1689

2006-02-28 Thread Cariotoglou Mike
I am not sure how this would work. in order for a trigger to "See"
another database, somebody (obviously not the trigger) must ATTACH the
database first. is there an automatic ATTACH capability that I am not
aware of ? if not, specifying triggers than span databases is looking
for trouble IMHO. as for allowing it, well, guns are allowed also, so
you can shoot yourself in the foot, if you really want to. 

> -Original Message-
> From: Brad [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, February 28, 2006 3:28 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Triggers and TEMP tables: ticket #1689
> 
> > Should I remove the tests from SQLite that prevent triggers in one 
> > database from referring to tables in a different database?
> 
> Well, I have a couple of triggers in my SQL Server database 
> that refer to tables in another database, though they are on 
> the same server. 
> Obviously, I can see some utility in that.  I will admit, 
> however, that if I had to implement the system that uses that 
> scheme in SQLite, then I'd probably have the tables in the 
> same database file, rather than different ones.
> 
> 
> 
> 



Re: [sqlite] Problems with character '

2006-02-28 Thread Jay Sprenkle
On 2/28/06, Teg <[EMAIL PROTECTED]> wrote:
> Hello Niels,
>
> That problem goes away if you switch to using the
>
> sqlite3_prepare
>
> sqlite3_bind_...()
>
> Syntax for insertions. Then all escaping becomes unnecessary. Using
> this syntax has removed an entire escaping layer I'd implemented.

It also prevents SQL injection attacks :)


Re: [sqlite] How to differentiate between Zero and NULL in an integer field

2006-02-28 Thread Jay Sprenkle
On 2/28/06, Luiz Americo Pereira Camara <[EMAIL PROTECTED]> wrote:
> The sqlite documentation states that when the stored value of an Integer
> field is NULL and is used sqlite3_column_int to retrieve the data, the
> returned value is 0.
> Currently to know if the value is zero or NULL i check the value of
> sqlite3_column_text (that returns NULL in that case). The drawback of
> this solution is that i retrieve two times the same record. Is there a
> more straight forward way of doing this?

NULL = "Nobody entered anything in this column"
  0 = somebody entered zero in this column.
Which may be very different things.
If you need to differentiate then you can use this:
select my_column from my_table where my_column is not null
If you want to default to zero, then set the default on the column to be zero.
Hope that helps.


Re: [sqlite] How to differentiate between Zero and NULL in an integer field

2006-02-28 Thread Luiz Americo Pereira Camara

Ran escreveu:

I think that sqlite3_column_type suppose to tell you if it is NULL.
http://www.sqlite.org/capi3ref.html#sqlite3_column_type
It returns SQLITE_NULL in that case.

However I don't see how you can avoid calling two functions in a scenario
you suspect a NULL (so if sqlite3_column_int returns a zero, you should call
sqlite3_column_type to check if it is NULL).

  


Thanks. This is what i was looking for.

Luiz


On 2/28/06, Luiz Americo Pereira Camara <[EMAIL PROTECTED]> wrote:
  

The sqlite documentation states that when the stored value of an Integer
field is NULL and is used sqlite3_column_int to retrieve the data, the
returned value is 0.
Currently to know if the value is zero or NULL i check the value of
sqlite3_column_text (that returns NULL in that case). The drawback of
this solution is that i retrieve two times the same record. Is there a
more straight forward way of doing this?

Thanks In Advance,
Luiz





  




Re: [sqlite] Problems with character '

2006-02-28 Thread Teg
Hello Niels,

That problem goes away if you switch to using the

sqlite3_prepare

sqlite3_bind_...()

Syntax for insertions. Then all escaping becomes unnecessary. Using
this syntax has removed an entire escaping layer I'd implemented.

C


Tuesday, February 28, 2006, 5:25:48 AM, you wrote:

NB> Hi Guys

NB> I'm having some problems dealing with the character '. Sqlite thinks
NB> fair enough that it should terminate the string, which I would like it
NB> to avoid. Are there any solutions to my problems.

NB> Thanks, Niels



-- 
Best regards,
 Tegmailto:[EMAIL PROTECTED]



Re: [sqlite] Problems with character '

2006-02-28 Thread Thierry Nauze


Le 28 févr. 06 à 14:25, Niels Boldt a écrit :


Hi Guys

I'm having some problems dealing with the character '. Sqlite thinks
fair enough that it should terminate the string, which I would like it
to avoid. Are there any solutions to my problems.

Thanks, Niels


Replace the   '  (one ' ) with  ''   (two ')

Regards,

--
Thierry NauzeSaint-Denis de la Réunion
Who don't speak English;o)





Re: [sqlite] Triggers and TEMP tables: ticket #1689

2006-02-28 Thread Brad

Should I remove the tests from SQLite that prevent
triggers in one database from referring to tables in
a different database?


Well, I have a couple of triggers in my SQL Server database that refer 
to tables in another database, though they are on the same server. 
Obviously, I can see some utility in that.  I will admit, however, that 
if I had to implement the system that uses that scheme in SQLite, then 
I'd probably have the tables in the same database file, rather than 
different ones.




Re: [sqlite] How to differentiate between Zero and NULL in an integer field

2006-02-28 Thread Ran
I think that sqlite3_column_type suppose to tell you if it is NULL.
http://www.sqlite.org/capi3ref.html#sqlite3_column_type
It returns SQLITE_NULL in that case.

However I don't see how you can avoid calling two functions in a scenario
you suspect a NULL (so if sqlite3_column_int returns a zero, you should call
sqlite3_column_type to check if it is NULL).

Ran

On 2/28/06, Luiz Americo Pereira Camara <[EMAIL PROTECTED]> wrote:
>
> The sqlite documentation states that when the stored value of an Integer
> field is NULL and is used sqlite3_column_int to retrieve the data, the
> returned value is 0.
> Currently to know if the value is zero or NULL i check the value of
> sqlite3_column_text (that returns NULL in that case). The drawback of
> this solution is that i retrieve two times the same record. Is there a
> more straight forward way of doing this?
>
> Thanks In Advance,
> Luiz
> 
>


Re: [sqlite] Re: Fields update notification

2006-02-28 Thread Eugen Stoianovici
On 2/28/06, Igor Tandetnik <[EMAIL PROTECTED]> wrote:
>
>
> CREATE TRIGGER
> http://sqlite.org/lang_createtrigger.html
>
> Igor Tandetnik
>


Great! Thanks.
(I should have mentionded that this was a beginners question)


[sqlite] Re: Fields update notification

2006-02-28 Thread Igor Tandetnik

Eugen Stoianovici
<[EMAIL PROTECTED]> wrote: 

Is there a way to track changes performed on a table?
What i need is a way of knowing when an insert/update has been issued
on a table so that i can read the new values.


CREATE TRIGGER
http://sqlite.org/lang_createtrigger.html

Igor Tandetnik


[sqlite] How to differentiate between Zero and NULL in an integer field

2006-02-28 Thread Luiz Americo Pereira Camara
The sqlite documentation states that when the stored value of an Integer 
field is NULL and is used sqlite3_column_int to retrieve the data, the 
returned value is 0.
Currently to know if the value is zero or NULL i check the value of 
sqlite3_column_text (that returns NULL in that case). The drawback of 
this solution is that i retrieve two times the same record. Is there a 
more straight forward way of doing this?


Thanks In Advance,
Luiz



[sqlite] [kde-announce] Kexi 1.0 beta 1 released

2006-02-28 Thread Jarosław Staniek

For original announcement with links see 
http://kexi-project.org/wiki/wikiview/index.php?1.0Beta1Announcement

---
 Kexi Team Ships Beta Version of the First Major 1.0 Release to Free
 Integrated Database Environment

January 31, 2006 (The INTERNET). The Kexi Team today announced the
immediate availability of Kexi 1.0 Beta 1, codenamed "Black Mamba", the
newest release of the integrated environment for managing data.


 Changes

(since 0.9 version)

 * Improved data-aware forms.
 * Form Designer's Data Source Pane for assigning data source to
   forms and widgets. Object tree view for easier navigating within
   widgets hierarchy.
 * Import from CSV files and pasting tabular data from clipboard.
   Export data to CSV files and copying tabular data to clipboard.
   Automatic detection of delimiters and column types.
 * Improved server connection dialog. Stored connection data.
 * Support for images in forms (stored as BLOBs).
 * New form widget: multiline editor.
 * Improved MS Access (MDB) file import (optional plugin).
 * Improved import of server databases to a file-based projects.
   Entire Kexi projects (not only tables) can be imported too.
 * Scripting plugin (Python and Ruby) to extend functionality,
   including example script for HTML export.
 * Simple printouts, print settings and print preview for table and
   query data.
 * Handbook added (incomplete).
 * More than two hundreds of overall improvements and bug fixes.

See also Detailed information on changes
 and Screenshots
.


 Download

Kexi binary packages provided by some Linux/UNIX vendors are available
within KOffice release
.
Testing Facilities with klik  are also available.

MS Windows installation package from OpenOffice Polska
 is available
.

Full Kexi source code ready to compile can be obtained with instructions
here
.


 More information

This version is released within KOffice KOffice 1.5 Beta 1
.

*How to compile Kexi*. To learn how to compile Kexi, see this document
.

*Support.* Kexi users are invited to report bugs and wishes. This can be
done by using the KDE Bug Tracking System .

*Unsupported features.* Updated list of unsupported features and known
problems is also available
.


 News

*Mailing lists* for users and developers are now available
.

*Jobs*. /"Ask not what Kexi can do for you, ask what you can do for
Kexi"/. Kexi Team is looking for developers, and package maintainers
(vide supported Linux distributions). Translators, testers, users and
development documentation writers, and any other forms of support are
also welcome. Contact  the
Team for more information.

*Multiplatform Availability.* Kexi on Linux (e.g. Debian) is available
for many architectures ,
including 64-bit Intel/AMD and Apple PowerPC.

*Features in progress.* Scripting using Python and Ruby languages; Auto
Field widgets in forms.


 Sponsorship

Kexi is developed by Kexi Team - an international group of independent
developers, with assistance and workforce coming from the OpenOffice
Polska  company.


 About Kexi

Kexi is an integrated environment for managing data. It can be used for
creating database schemas; inserting data; performing queries, and
processing data. Forms can be created to provide a custom interface to
your data. All database objects - tables, queries and forms - are stored
in the database, making it easy to share databases.

As Kexi is a real member of the K Desktop Environment
 and KOffice  projects, it
integrates fluently into both on Linux/Unix. It is designed to be fully
usable also without running KDE Desktop on Linux/Unix, MS Windows and
Mac OS X platforms.

Kexi is considered as a long awaited Open Source competitor for MS
Access, Filemaker and Oracle Forms. Its development is motivated by the
lack of Rapid Application Development (RAD) tools for database systems
that are sufficiently powerful, inexpensive, open standards driven and
portable across many OSes and hardware platforms.


-- 
regards / pozdrawiam,
  Jaroslaw Staniek / OpenOffice Polska

  Kexi Developer:  http://www.kexi-project.org | http://koffice.org/kexi
  Kexi Support:http://www.kexi-project.org/support.html
  Kexi For MS

[sqlite] Fields update notification

2006-02-28 Thread Eugen Stoianovici
Is there a way to track changes performed on a table?
What i need is a way of knowing when an insert/update has been issued on a
table so that i can read the new values.


RE: [sqlite] Problems with character '

2006-02-28 Thread Brandon, Nicholas (UK)

Hi Niels,

You've just found the first problem with using TEXT columns. What you need to 
do is put another ' in front of it i.e. ''. Depending on the language you are 
using, you may find it includes a function that "escapes" special characters 
like '. For example, PHP supply "sqlite_escape_string".

The alternative is to store the data as binary. To do this, I believe you need 
to do the prepare/bind/exec statements.

Hope that some help.

Regards
Nick

-Original Message-
From: Niels Boldt [mailto:[EMAIL PROTECTED]
Sent: 28 February 2006 10:26
To: sqlite-users@sqlite.org
Subject: [sqlite] Problems with character '


   *** WARNING ***

This mail has originated outside your organization,
either from an external partner or the Global Internet.

 Keep this in mind if you answer this message.


Hi Guys

I'm having some problems dealing with the character '. Sqlite thinks
fair enough that it should terminate the string, which I would like it
to avoid. Are there any solutions to my problems.

Thanks, Niels



This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.




Re: [sqlite] Problems with character '

2006-02-28 Thread Philipp Knüsel
> Hi Guys
> 
> I'm having some problems dealing with the character '. Sqlite thinks
> fair enough that it should terminate the string, which I would like it
> to avoid. Are there any solutions to my problems.
> 
> Thanks, Niels

Hello Niels

try:

sqlite> CREATE TABLE t (id INTEGER, bez TEXT);
sqlite> INSERT INTO t (id, bez) values (1,"'");
sqlite> INSERT INTO t (id, bez) values (2,);
sqlite> SELECT * FROM t;
1|'
2|'

Does this already solve your problem, or do you need
something in another context?

Philipp




[sqlite] Problems with character '

2006-02-28 Thread Niels Boldt
Hi Guys

I'm having some problems dealing with the character '. Sqlite thinks
fair enough that it should terminate the string, which I would like it
to avoid. Are there any solutions to my problems.

Thanks, Niels