Re: [sqlite] Math functions

2007-04-04 Thread anis chaaba

yes you can implement math functions with user defined functions by the
sqlite3_create_function. sqlite.org is your freind :)

2007/4/4, Nathan Biggs <[EMAIL PROTECTED]>:


Does anyone know if there is a floor function in sqlite, or of a way to
implement it.



Re: [sqlite] Transferring the oracle databse to sqlite database

2007-03-28 Thread anis chaaba

a way to export your database is to generate the sql script database to a
file, and from sqlite type '.read path_to_file/file'
if it doesn't work try to change the sql script exported so it can be
understanded by sqlite for example delete stored procedure and change
triggers if any way you have triggers or stored procedures.

2007/3/28, Amarjeet Kumar (RBIN/ECM4) <[EMAIL PROTECTED]>:


Hi,

I wanted to use the sqlite database. Currently I am using the oracle
database.

Is there any way to import the oracle database to sqlite database?
If so plz. tell me.

Thanks in advance.

With warm regards,
Amar






Re: [sqlite] Sqlite for Embedded Devices

2007-03-01 Thread anis chaaba

I'm using sqlite on embedded device and I didn't have issues till now. good
performance and scalability.

2007/3/1, Jakub Ladman <[EMAIL PROTECTED]>:


Dne čtvrtek 01 březen 2007 13:11 Pavan napsal(a):
> Hi,
>
> Could anyone share their observations/comments on having used sqlite as
DB
> for embedded linux environment.

I have just started.
Now i have sqlite compiled for embedded linux based on kernel 2.4.18 and
uclibc library on Renesas SuperH cpu SH7760, it seems to be working good,
but
i am thorough beginner in SQL technology generally.
Maybe later ...

Jakub

>
> Thanks,
> Pavan.


-
To unsubscribe, send email to [EMAIL PROTECTED]

-




Re: [sqlite] Crosscompiled sqlite was: developer mailing list

2007-02-27 Thread anis chaaba

you must change the configure file to use the tool chain to cross compile
your lib.
you must do modifications like gcc becomes gcc-arm-linux for example.
but what kind of target do you have?
do you have a tool chain

2007/2/27, Jakub Ladman <[EMAIL PROTECTED]>:


Dne úterý 27 únor 2007 16:31 anis chaaba napsal(a):
> you need the libsqlite.so.0... or the libsqlite3.so crosscompiled
:-( there is no .so file :-(

Jakub
> if you need the commande line copy sqlite3 or sqlite to your target
>
> 2007/2/27, Jakub Ladman <[EMAIL PROTECTED]>:
> > Hi everybody
> > Which files do i need at target (small embedded linux system)?
> >
> > after make i have these files
> >
> > alter.ohash.o opcodes.o  pragma.o   utf.o
> > analyze.o  insert.o   os.o   prepare.o  util.o
> > attach.o   keywordhash.h  os_os2.o   printf.o   vacuum.o
> > auth.o legacy.o   os_unix.o  random.o   vdbe.o
> > btree.olemon  os_win.o   select.o   vdbeapi.o
> > build.olempar.c   pager.osqlite3vdbeaux.o
> > callback.o libsqlite3.a   parse.csqlite3.h  vdbefifo.o
> > complete.o loadext.o  parse.htable.ovdbemem.o
> > date.o main.o parse.h.temp   tclsqlite.ovtab.o
> > delete.o   mkkeywordhash  parse.otokenize.o where.o
> > expr.o opcodes.c  parse.out  trigger.o
> > func.o opcodes.h  parse.yupdate.o
> > /mnt/nfs/home/jakub/shsqlite $
> >
> >
> > Which files are necessary for running, and which for linking to my own
C
> > programs?
> >
> > And what should i do with this?
> >
> > SQLite version 3.3.13
> > Enter ".help" for instructions
> > sqlite> create table tbl1(one varchar(10), two smallint);
> > SQL error: database is locked
> > sqlite>
> >
> >
> > Thank you
> > Jakub Ladman
> >
> >
> >
> >
> >
-
> > To unsubscribe, send email to [EMAIL PROTECTED]
> >
> >
-
> >


-
To unsubscribe, send email to [EMAIL PROTECTED]

-




Re: [sqlite] SQL error: database is locked

2007-02-27 Thread anis chaaba

there's another process using the data base or executing a transaction

2007/2/27, Jakub Ladman <[EMAIL PROTECTED]>:


Dear Friends
Please let me know what should i do with this?

SQLite version 3.3.13
Enter ".help" for instructions
sqlite> create table tbl1(one varchar(10), two smallint);
SQL error: database is locked
sqlite>

(sqlite is launched by root)

Jakub Ladman


-
To unsubscribe, send email to [EMAIL PROTECTED]

-




Re: [sqlite] Crosscompiled sqlite was: developer mailing list

2007-02-27 Thread anis chaaba

you need the libsqlite.so.0... or the libsqlite3.so crosscompiled
if you need the commande line copy sqlite3 or sqlite to your target

2007/2/27, Jakub Ladman <[EMAIL PROTECTED]>:


Hi everybody
Which files do i need at target (small embedded linux system)?

after make i have these files

alter.ohash.o opcodes.o  pragma.o   utf.o
analyze.o  insert.o   os.o   prepare.o  util.o
attach.o   keywordhash.h  os_os2.o   printf.o   vacuum.o
auth.o legacy.o   os_unix.o  random.o   vdbe.o
btree.olemon  os_win.o   select.o   vdbeapi.o
build.olempar.c   pager.osqlite3vdbeaux.o
callback.o libsqlite3.a   parse.csqlite3.h  vdbefifo.o
complete.o loadext.o  parse.htable.ovdbemem.o
date.o main.o parse.h.temp   tclsqlite.ovtab.o
delete.o   mkkeywordhash  parse.otokenize.o where.o
expr.o opcodes.c  parse.out  trigger.o
func.o opcodes.h  parse.yupdate.o
/mnt/nfs/home/jakub/shsqlite $


Which files are necessary for running, and which for linking to my own C
programs?

And what should i do with this?

SQLite version 3.3.13
Enter ".help" for instructions
sqlite> create table tbl1(one varchar(10), two smallint);
SQL error: database is locked
sqlite>


Thank you
Jakub Ladman




-
To unsubscribe, send email to [EMAIL PROTECTED]

-




Re: [sqlite] Re: trigger with conditions

2007-02-26 Thread anis chaaba

Thx :)

2007/2/26, Igor Tandetnik <[EMAIL PROTECTED]>:


anis chaaba <[EMAIL PROTECTED]> wrote:
> Can you tell how can i trigger with conditions such as:
> create trigger foo
> begin
> if (NEW.VALUE = 'something')
> insert into tables values..
> endif
> END;

http://sqlite.org/lang_createtrigger.html

create trigger foo after update on someTable
when new.value = 'something'
begin
   ...
end;

Igor Tandetnik


-
To unsubscribe, send email to [EMAIL PROTECTED]

-




[sqlite] trigger with conditions

2007-02-26 Thread anis chaaba

Hello people,
Can you tell how can i trigger with conditions such as:
create trigger foo
begin
if (NEW.VALUE = 'something')
insert into tables values..
endif
END;
thanks in advance

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] Select and deletion

2007-02-07 Thread anis chaaba

with which language are you trying to do this?
to execute the delete statement you can use transactions to ensure
atomicity.
regards,


Re: [sqlite] database is locked

2007-02-05 Thread anis chaaba

I have multiple thread reading the database and a thread inserting in or
updating the database.
when i try to simulate this case by executing sqlite3 from shell by
beginning a transaction from a shell and retrieving data from other shell
eveything works fine.
But when it's the cas from my C program it raises the error message database
is locked.
How can i avoid this issue?
thanks a lot

2007/2/5, Dennis Cote <[EMAIL PROTECTED]>:


anis chaaba wrote:
> Hello
> Please can you tell me how can i avoid having error message "database is
> locked'?
> thanks
>
You will have to provide more details about exactly what  you are doing
and how you are doing it for anybody to be able to assist you.

SQLite does support multiple process accessing the database. This page
explains the nature of your error in more detail
http://www.sqlite.org/cvstrac/wiki?p=DatabaseIsLocked

HTH
Dennis Cote


-
To unsubscribe, send email to [EMAIL PROTECTED]

-




[sqlite] database is locked

2007-02-05 Thread anis chaaba

Hello
Please can you tell me how can i avoid having error message "database is
locked'?
thanks


Re: [sqlite] Re: Shared Lock Transactions

2007-02-05 Thread anis chaaba

How do I enable shared locking?

2007/1/25, Ken <[EMAIL PROTECTED]>:


From os_unix.h:... After reading this, locking makes more sense!
   Although the Lock may physically be an exclusive lock, the
implementation is actually a logcially  "SHARED" lock.



/* The following describes the implementation of the various locks and
   ** lock transitions in terms of the POSIX advisory shared and exclusive
   ** lock primitives (called read-locks and write-locks below, to avoid
   ** confusion with SQLite lock names). The algorithms are complicated
   ** slightly in order to be compatible with windows systems
simultaneously
   ** accessing the same database file, in case that is ever required.
   **
   ** Symbols defined in os.h indentify the 'pending byte' and the
'reserved
   ** byte', each single bytes at well known offsets, and the 'shared byte
   ** range', a range of 510 bytes at a well known offset.
   **
   ** To obtain a SHARED lock, a read-lock is obtained on the 'pending
   ** byte'.  If this is successful, a random byte from the 'shared byte
   ** range' is read-locked and the lock on the 'pending byte' released.
   **
   ** A process may only obtain a RESERVED lock after it has a SHARED
lock.
   ** A RESERVED lock is implemented by grabbing a write-lock on the
   ** 'reserved byte'.
**
   ** A process may only obtain a PENDING lock after it has obtained a
   ** SHARED lock. A PENDING lock is implemented by obtaining a write-lock
   ** on the 'pending byte'. This ensures that no new SHARED locks can be
   ** obtained, but existing SHARED locks are allowed to persist. A
process
   ** does not have to obtain a RESERVED lock on the way to a PENDING
lock.
   ** This property is used by the algorithm for rolling back a journal
file
   ** after a crash.
   **
   ** An EXCLUSIVE lock, obtained after a PENDING lock is held, is
   ** implemented by obtaining a write-lock on the entire 'shared byte
   ** range'. Since all other locks require a read-lock on one of the
bytes
   ** within this range, this ensures that no other locks are held on the
   ** database.
   **
   ** The reason a single byte cannot be used instead of the 'shared byte
   ** range' is that some versions of windows do not support read-locks.
By
   ** locking a random byte from a range, concurrent SHARED locks may
exist
   ** even if the locking primitive used is always a write-lock.
   */


"A. Pagaltzis" <[EMAIL PROTECTED]> wrote: * Jay Sprenkle  [2007-01-22
15:20]:
> My understanding was that a "shared lock" is a metaphor, and
> IMHO, a fairly stupid one. If you lock a room, nobody else can
> get in, it's not a mechanism for sharing, it's a mechanism for
> preventing sharing.

Reasoning by analogy rarely leads to anything but a fallacy.

A shared lock prevents exclusive locks from being granted and an
exclusive lock prevents shared locks from being granted, so I'm
not sure what sort of sharing/preventing business you're talking
about anyway.

Regards,
--
Aristotle Pagaltzis //


-
To unsubscribe, send email to [EMAIL PROTECTED]

-






[sqlite] database is locked

2007-02-05 Thread anis chaaba

Hello,
I have processes that access to my database, one writing on it and the other
just reading. when this case take place an error message occure saying that
database is locked.
I saw in sqlite3 docs that sqlite3 enable this type of access but i don't
know how can I activate this option.
Is that by compiling sqlite3 with a special option or by specifying this
option in my c acess code?
thanks in advance for help


Re: [sqlite] how to cross compile sqlite 3

2007-02-01 Thread anis chaaba

thanks
i've user sqlite 3.3.11.tar.gz and i made some modifications on configure
and make file and it works



2007/2/1, C.Peachment <[EMAIL PROTECTED]>:


On Thu, 1 Feb 2007 10:41:25 +0100, anis chaaba wrote:

>I'm cross compiling sqlite3 for arm and there's errors in the
>configure and the makefile generated.
>Do anyone of you  cross compiled sqlite3?
>thanks in advance


Using the preprocessed source code in sqlite-source-3_3_12.zip
lets you avoid the problems of configure checking the host computer
attributes when it should specify the target computer attributes.

I have compiled this source for both linux-arm and windows-pc
without issues.

Chris Peachment





-
To unsubscribe, send email to [EMAIL PROTECTED]

-




[sqlite] how to cross compile sqlite 3

2007-02-01 Thread anis chaaba

Hello everybody
I'm cross compiling sqlite3 for arm and there's errors in the
configure and the makefile generated.
Do anyone of you  cross compiled sqlite3?
thanks in advance

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] [Fwd: rummage bin of C API questions]

2007-01-25 Thread anis chaaba

2007/1/25, anis chaaba <[EMAIL PROTECTED]>:hello
1-I'm trying to remember and i think that all routines that execute queries
need to free the error message variable like sqlite_exec or others.
2- No transactions fail while you're writing clean code
3- While u'r allocationg and freeing all your pointers and opening/closing
connections you won't have problems
4-for the fourth question an example would be appreciated
If you having problems with code please send us error messages and code
samples


2007/1/25, Lucas (a.k.a T-Bird or bsdfan3) <[EMAIL PROTECTED]>:






Please bear with me here,
as this list may seem rather long.

1) Which of the C API routines allocate memory that my code must free?
2) Can COMMIT TRANSACTION and ROLLBACK TRANSACTION fail?
3) Which of the C API routines cannot fail?
4) C API routines with pointer return values return NULL if they cannot
allocate sufficient memory, right?


--T-Bird/bsdfan3/Lucas




-
To unsubscribe, send email to [EMAIL PROTECTED]

-




Re: [sqlite] sqlite3 lib do not open old sqlite databases

2007-01-22 Thread anis chaaba

thanks man

2007/1/22, Trey Mack <[EMAIL PROTECTED]>:


From http://www.sqlite.org/formatchng.html
"Version 3.0.0 is a major upgrade for SQLite that incorporates support for
UTF-16, BLOBs, and a more compact encoding that results in database files
that are typically 25% to 50% smaller. The new file format is very
different
and is completely incompatible with the version 2 file format."

At the bottom of that page are some suggestions for upgrading your
database
to the current format.

- Trey

- Original Message -----
From: "anis chaaba" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Monday, January 22, 2007 11:15 AM
Subject: [sqlite] sqlite3 lib do not open old sqlite databases


> Hello everybody
> I'm moving from sqlite 2.8.17 to sqlite3.3.11 but when i'm trying to
open
> my
> databases created with sqlite 2.8.X i have this error message:
> file is encrypted or is not a database
> Is that normal or did i have a mistake somewhere?
> Thank you for your help in advance
>



-
To unsubscribe, send email to [EMAIL PROTECTED]

-




[sqlite] php sqlite compliance

2007-01-22 Thread anis chaaba

Can you please tell me what version of sqlite is supported by php5?
Thanks in advance


[sqlite] sqlite3 lib do not open old sqlite databases

2007-01-22 Thread anis chaaba

Hello everybody
I'm moving from sqlite 2.8.17 to sqlite3.3.11 but when i'm trying to open my
databases created with sqlite 2.8.X i have this error message:
file is encrypted or is not a database
Is that normal or did i have a mistake somewhere?
Thank you for your help in advance