[sqlite] Password protection to sqlite3 db file

2015-09-02 Thread techi eth
Hi,

Is it possible to protect sqlite3 db file with password protection in Linux.

Techi


[sqlite] Sqlite3 handler uses

2014-05-29 Thread techi eth
What is the best practice to use sqlite3 handler in multithread
environment.[I am using on Linux]



· Open sqlite3 database file once & use the same sqlite3 handler in
all the thread for any operation on sqlite3 database file.

or

· Open & close all the time for each operation on sqlite3 database
file.

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


[sqlite] duplicate row in sqlite3 database

2014-05-08 Thread techi eth
Hi,

SQlite3 have any method where it can avoid adding duplicate row or throwing
error status code on duplication.,

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


Re: [sqlite] Sqlite3 & Concurrency

2014-04-23 Thread techi eth
Many Thanks for quick reply.

Could you please suggest me other journal mode for second case.My target
filesytem dosen't support mmap & WAL required mmap support.

Thanks

On Wed, Apr 23, 2014 at 3:05 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 23 Apr 2014, at 10:29am, techi eth <techi...@gmail.com> wrote:
>
> > 1)  Sqlite3 doesn’t have any concurrency issue when multiple process
> > reading one database file at same time. This doesn’t required any special
> > mode setting (Like WAL)
>
> Correct.
>
> > 2)  One process is reading & other process tries to write the same
> > database file then file should be open in WAL mode.
>
> WAL mode is fine for this.  So are other journal modes.  But if you like
> WAL mode then yes, there will be no problems with it.
>
> > 3)  Sqlite3 doesn’t support Multiple process writing on same time.
>
> Each connection to the database should set a timeout using one of
>
> <http://www.sqlite.org/c3ref/busy_timeout.html>
> <http://www.sqlite.org/pragma.html#pragma_busy_timeout>
>
> Set a value of a few seconds.  If you do this then if the second process
> finds that the database is busy it will wait a while then try again, and
> keep waiting until the database is no longer busy.
>
> If you do not set a timeout then the second process will just return an
> error message.
>
> Simon.
> ___
> 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] Sqlite3 & Concurrency

2014-04-23 Thread techi eth
Hi,



Please correct me on below points for Sqlite3 on Linux platform.



1)  Sqlite3 doesn’t have any concurrency issue when multiple process
reading one database file at same time. This doesn’t required any special
mode setting (Like WAL)

2)  One process is reading & other process tries to write the same
database file then file should be open in WAL mode.

3)  Sqlite3 doesn’t support Multiple process writing on same time.



File system is jffs2.


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


Re: [sqlite] Memory leak in online backup api

2014-03-10 Thread techi eth
Any hint will help me to identify root cause of leak.

Thanks


On Mon, Mar 10, 2014 at 2:58 PM, techi eth <techi...@gmail.com> wrote:

> Hi,
>
> I come across memory leak with sqlite3 online backup api (Leak detected by
> valgrind tool). I have used reference code from below link for test.
> (Online backup for running database)
>
> http://www.sqlite.org/backup.html
>
> Please find below memory leak snapshot for reference.
>
> ==6084== 78,688 (880 direct, 77,808 indirect) bytes in 1 blocks are
> definitely lost in loss record 52 of 52
> ==6084==at 0x4C2B6CD: malloc (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==6084==by 0x571C73E: ??? (in
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
> ==6084==by 0x56FA238: ??? (in
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
> ==6084==by 0x5701B17: ??? (in
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
> ==6084==by 0x5701B44: ??? (in
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
> ==6084==by 0x576FB91: ??? (in
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
> ==6084==by 0x4E36001: db_sqlite3_backup (db_sqlite3.c:2291)
> ==6084==by 0x4026A7:  Test_backup (db_sqlite3_test.c:994)
> ==6084==by 0x40283D: main (db_sqlite3_test.c:1170)
> ==6084==
> ==6084== LEAK SUMMARY:
> ==6084==definitely lost: 880 bytes in 1 blocks
>
> Thanks
>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Memory leak in online backup api

2014-03-10 Thread techi eth
Hi,

I come across memory leak with sqlite3 online backup api (Leak detected by
valgrind tool). I have used reference code from below link for test.
(Online backup for running database)

http://www.sqlite.org/backup.html

Please find below memory leak snapshot for reference.

==6084== 78,688 (880 direct, 77,808 indirect) bytes in 1 blocks are
definitely lost in loss record 52 of 52
==6084==at 0x4C2B6CD: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6084==by 0x571C73E: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==6084==by 0x56FA238: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==6084==by 0x5701B17: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==6084==by 0x5701B44: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==6084==by 0x576FB91: ??? (in
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6)
==6084==by 0x4E36001: db_sqlite3_backup (db_sqlite3.c:2291)
==6084==by 0x4026A7:  Test_backup (db_sqlite3_test.c:994)
==6084==by 0x40283D: main (db_sqlite3_test.c:1170)
==6084==
==6084== LEAK SUMMARY:
==6084==definitely lost: 880 bytes in 1 blocks

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


Re: [sqlite] SQlite3 Performnace

2014-02-14 Thread techi eth
Thanks.

I have database on single Disk.In that case i see it is better to create
separate database file.If i am not wrong i will get better edge over
concurrency in this case ?

What do you mean by SQlite3 Query with I/O bound ?



On Thu, Feb 13, 2014 at 9:22 AM, Hick Gunter <h...@scigames.at> wrote:

> .timer on (in the sqlite shell)
>
> Unless you are storing the databases on different disks AND your SQLite
> queries are IO bound I don't expect any performance gains.
>
> -Ursprüngliche Nachricht-
> Von: techi eth [mailto:techi...@gmail.com]
> Gesendet: Donnerstag, 13. Februar 2014 10:11
> An: General Discussion of SQLite Database
> Betreff: [sqlite] SQlite3 Performnace
>
> Hi,
>
>
>
> Is there any way I can check SQlite3 Database read/write timing for
> performance measurement.
>
>
> What are the changes in performance if I have single SQlite3 Database file
> (Contain 'N' table) or  'N' Database file each contain single table.
>
>
>
> Regards,
>
> Techi
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
> --
>  Gunter Hick
> Software Engineer
> Scientific Games International GmbH
> Klitschgasse 2 - 4, A - 1130 Vienna, Austria
> FN 157284 a, HG Wien
> Tel: +43 1 80100 0
> E-Mail: h...@scigames.at
>
> This e-mail is confidential and may well also be legally privileged. If
> you have received it in error, you are on notice as to its status and
> accordingly please notify us immediately by reply e-mail and then delete
> this message from your system. Please do not copy it or use it for any
> purposes, or disclose its contents to any person as to do so could be a
> breach of confidence. Thank you for your cooperation.
> ___
> 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] SQlite3 Performnace

2014-02-13 Thread techi eth
Hi,



Is there any way I can check SQlite3 Database read/write timing for
performance measurement.


What are the changes in performance if I have single SQlite3 Database file
(Contain 'N' table) or  'N' Database file each contain single table.



Regards,

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


Re: [sqlite] SQlite3 Query Format for Export

2013-11-19 Thread techi eth
I need this often.

If possible provide some hint of plugin in Linux platform.

Thanks


On Tue, Nov 19, 2013 at 7:01 PM, RSmith  wrote:

>
>  What will be the query format to export database table data into different
>> export format (CSV,HTML,XML,SQL) ?
>>
>>
> This is not an SQL function.
>
> Do you need it exported to some format once, or do you need this often
> (such as providing it as a standard functionality to users?)
>
> If you need it once, simply download one of the SQLite DB Managers that
> offers exporting. If you need it often, I'm afraid you will need to make
> the converters yourself or use some third-party plug-ins that can do it for
> the platform you are designing 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] SQlite3 Query Format for Export

2013-11-19 Thread techi eth
Hi,



What will be the query format to export database table data into different
export format (CSV,HTML,XML,SQL) ?


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


Re: [sqlite] Inter Process Communincation using SQLite3 Trigger

2013-11-01 Thread techi eth
Thanks for answer.

I am in sync with your answer.

I believe their is no risk from SQLite3 point of view to handle the
mentioned case.


On Fri, Nov 1, 2013 at 6:47 PM, Igor Tandetnik <i...@tandetnik.org> wrote:

> On 11/1/2013 5:58 AM, techi eth wrote:
>
>> 1)  Is process – B will allow to Insert?
>>
>
> Sure, why not.
>
>
>  2)  If allowed then it will select notify function from process – B or
>> Process - A?
>>
>
> The custom function will be called in process B - the process doing the
> insertion.
>
>
>  3)  If all works then what risk I will carry? (Like deleting row,
>> deleting trigger will crate any issue?)
>>
>
> I'm not sure I understand the question. Deleting a row will delete a row.
> Deleting a trigger will delete a trigger. Whether those are "issues" in
> your design is for you to decide.
>
>
>  I assume answer will valid for other operation like update & delete
>> operation as well.
>>
>
> Yes, nothing changes if you replace AFTER INSERT with AFTER UPDATE or
> AFTER DELETE.
> --
> Igor Tandetnik
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<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] Dropping Trigger from Table

2013-11-01 Thread techi eth
Thanks for all comments & suggestion.

My Point :

If we have trigger creation on per table basis then why can't we have
dropping also on table basis.

It is not good to have feature where each table owner are free to allow the
way he want to create trigger.



On Fri, Nov 1, 2013 at 6:33 PM, RSmith <rsm...@rsweb.co.za> wrote:

> On 2013/11/01 14:41, techi eth wrote:
>
>> I think so checking possible cases of any sqlite operation should not be
>> called as bogus. Where ever I am not sure I will ask expert help & I have
>> got all the time right answers.
>>
> My point here is (and was) that the SQL you said that you have tried, is
> completely bogus, it exists not in any form of SQL server in this World. I
> did not say that you are asking a bogus question - and the point of that
> being that you cannot simply make up SQL statements... at least try
> something that exists in reality and then maybe we can help if something is
> wrong with that.
>
>  I am checking the case where database tables are created by different
>> application. I am sure different application may not check available
>> trigger name in all tables before creating new trigger//...
>>
> They might not check yes, but if they don't, they will get errors - You
> cannot create the same trigger name more than once on any SQL table - and
> as far as I know, in SQLIte specifically, you cannot even have the same
> trigger name for different tables within the same database - so it is
> impossible to create the scenario for which you want to test with your code.
>
>
>  *Question:*
>>
>>
>> What happen when same trigger name is used by two different tables in
>> database and drop trigger query get executed.Find below statement :
>>
>> CREATE TRIGGER TestTrigger AFTER INSERT ON TestTbl1 BEGIN SELECT
>> Trigger_notifier_function();**END
>>
>>
>> CREATE TRIGGER TestTrigger AFTER INSERT ON TestTbl2 BEGIN SELECT
>> Trigger_notifier_function1();**END
>>
>> DROP TRIGGER IF EXISTS TestTrigger
>>
>> Please correct me if my question is wrong.
>> Note: Trigger logic will be different but trigger names are same.
>>
> This is what I mean with bogus SQL... have you actually tried to do that
> in SQLite?  You cannot do it, the second trigger will never be created and
> therefore never be possible to exist, and therefore unnecessary to check
> for. Check it for yourself!
>
>
>
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<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] Dropping Trigger from Table

2013-11-01 Thread techi eth
You seem to have a habit of inventing bogus SQL and then, when it doesn't
work, ask for the correct form on here.  If I was the forum police I would
suggest reading some freely available on-line documents, but since I'm not.

I think so checking possible cases of any sqlite operation should not be
called as bogus. Where ever I am not sure I will ask expert help & I have
got all the time right answers.
With my politeness I do not want to discuss this topic here. If you have
any specific concern please send mail separately to me I will reply
accordingly.

SQL is not a flow-control language, it makes adjustments to (or extractions
from) datasets based on relational parameters, some of which makes it seem
very very clever (and indeed I contend that it is quite clever), but it
still isn't a flow-control specification.

This is Ok. I understood & used same for test.DROP TRIGGER IF EXISTS
trigger_name

If I may ask, how on Earth did you end up having a Query whereby the
creation (or deletion) of entire Triggers becomes part of the

data-execution-logic?  Maybe explain the first principle you wish to
achieve and we could suggest how to best get there (as many

have done here already).

*Let me explain:*

I am checking the case where database tables are created by different
application. I am sure different application may not check available
trigger name in all tables before creating new trigger.

*Question:*

What happen when same trigger name is used by two different tables in
database and drop trigger query get executed.Find below statement :

CREATE TRIGGER TestTrigger AFTER INSERT ON TestTbl1 BEGIN SELECT
Trigger_notifier_function();END


CREATE TRIGGER TestTrigger AFTER INSERT ON TestTbl2 BEGIN SELECT
Trigger_notifier_function1();END

DROP TRIGGER IF EXISTS TestTrigger

Please correct me if my question is wrong.
Note: Trigger logic will be different but trigger names are same.



On Fri, Nov 1, 2013 at 5:36 PM, RSmith <rsm...@rsweb.co.za> wrote:

> You seem to have a habit of inventing bogus SQL and then, when it doesn't
> work, ask for the correct form on here.  If I was the forum police I would
> suggest reading some freely available on-line documents, but since I'm not
> - here's an attempt at answering the question:
>
> SQL is not a flow-control language, it makes adjustments to (or
> extractions from) datasets based on relational parameters, some of which
> makes it seem very very clever (and indeed I contend that it is quite
> clever), but it still isn't a flow-control specification.
>
> You will need to decide in your program code whether a Trigger or Index or
> Table needs to exist or not, and from there instuct SQL to make it or drop
> it.
>
> If I may ask, how on Earth did you end up having a Query whereby the
> creation (or deletion) of entire Triggers becomes part of the
> data-execution-logic?  Maybe explain the first principle you wish to
> achieve and we could suggest how to best get there (as many have done here
> already).
>
>
>
>
> On 2013/11/01 13:53, techi eth wrote:
>
>> How to drop trigger from specific table with condition around?
>>
>>
>>
>> I tried this but got syntax error.
>>
>> DROP TRIGGER trigger_name  From tbl_name = TestTbl WHERE ;
>>
>> Thanks
>> __**_
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<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<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] Dropping Trigger from Table

2013-11-01 Thread techi eth
How to drop trigger from specific table with condition around?



I tried this but got syntax error.

DROP TRIGGER trigger_name  From tbl_name = TestTbl WHERE ;

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


[sqlite] Inter Process Communincation using SQLite3 Trigger

2013-11-01 Thread techi eth
Hi,



I understand SQLite3 will not be able to handle any IPC related operation.
I am attempting my idea below to handle IPC with the help of SQLite3
Trigger.



*Scenario:*

I have two processes. Process – A will be responsible to create trigger &
Process -B will doing operation like update, insert or delete. Once process
– B will do update, Insert or delete, process – A will get notification
automatically.



1) Process - A create trigger where it actually select a function in
trigger action.

CREATE TRIGGER TestTrigger AFTER INSERT ON TestTbl

BEGIN

SELECT Trigger_notifier_function();

END

Note: Process - A will register function using sqlite_create_function().Mostly
Trigger_notifier_function() is dummy here.



2) Process - B will also create same name function using
sqlite_create_function().This function have some logic to handle IPC.

3) Process – B will insert data in table.



*My question:*

1)  Is process – B will allow to Insert?

2)  If allowed then it will select notify function from process – B or
Process - A?

3)  If all works then what risk I will carry? (Like deleting row,
deleting trigger will crate any issue?)



I assume answer will valid for other operation like update & delete
operation as well.



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


[sqlite] Hex value with DEFAULT Constraint

2013-10-29 Thread techi eth
Is it possible to attach hex value with DEFAULT constraint?



I am getting return error code as SQLITE_ERROR & detail error message as
 "unrecognized token".
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Feature Request: Binding Arrays

2013-10-16 Thread techi eth
It is really useful feature.

I have a use case where I need to log the data in continuous interval &
store in database. If array type is supported by sqlite then in single row
I can store data in array of time stamp & array of value.
Is it specific to int type or any other data type can be supported?


On Wed, Oct 16, 2013 at 6:15 PM, Paul van Helden wrote:

> > Since version 3.6.21, circa 2009-12-07.  Note however that this
> capability
> > is not built in.  It is an extension that you need to compile and link
> > separately.
> >
> > OK... Herewith my vote to make it standard then, like
> SQLITE_ENABLE_COLUMN_METADATA was enabled for the precompiled binary at
> some point.
>
> I prefer to stick to the precompiled binaries. Besides, it would make the
> sqlite3_intarray functions more visible in the documentation, etc. I'm sure
> I'm not the only one that didn't know about this very useful functionality.
>
> It's about time the binary got slightly bigger ;-)
> ___
> 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] Segmentation Fault With Trigger

2013-10-14 Thread techi eth
Please provide me hint to solve the issue.


Thanks..


On Fri, Oct 11, 2013 at 7:58 PM, techi eth <techi...@gmail.com> wrote:

> It is giving same trace what i have sent last time.
>
> It is possible by some one to send test code snapshot of scenario of
> selecting user defined function while trigger execution.
>
> Thanks a lot...
>
>
> On Fri, Oct 11, 2013 at 7:41 PM, Richard Hipp <d...@sqlite.org> wrote:
>
>> On Fri, Oct 11, 2013 at 10:06 AM, techi eth <techi...@gmail.com> wrote:
>>
>> > Please provide some hint.
>> >
>>
>> Recompile with -O0 and -g and then post the stack trace after the
>> segfault.
>>
>> --
>> D. Richard Hipp
>> d...@sqlite.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


Re: [sqlite] Segmentation Fault With Trigger

2013-10-11 Thread techi eth
It is giving same trace what i have sent last time.

It is possible by some one to send test code snapshot of scenario of
selecting user defined function while trigger execution.

Thanks a lot...


On Fri, Oct 11, 2013 at 7:41 PM, Richard Hipp <d...@sqlite.org> wrote:

> On Fri, Oct 11, 2013 at 10:06 AM, techi eth <techi...@gmail.com> wrote:
>
> > Please provide some hint.
> >
>
> Recompile with -O0 and -g and then post the stack trace after the segfault.
>
> --
> D. Richard Hipp
> d...@sqlite.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


Re: [sqlite] Segmentation Fault With Trigger

2013-10-11 Thread techi eth
Data Info is not an problem.I am passing data information for building
query before passing to sqlite exec function.If i remove trigger for insert
then my code is working perfectly fine.

My assumption is it is due to selecting function  during trigger.Please
suggest hint by looking sequence provide by me.

Thanks


On Fri, Oct 11, 2013 at 7:41 PM, Stephan Beal <sgb...@googlemail.com> wrote:

> On Fri, Oct 11, 2013 at 4:06 PM, techi eth <techi...@gmail.com> wrote:
>
> > > #4  0x778e1127 in SqliteTestInsert (SQLitePrivate=0x602300,
> > > TableName_p=0x4019a0 "dbTestTbl", DataInfoList=0x4)
> >
>
> There's the problem: DataInfoList is an invalid pointer. i have no idea
> what that is, but it's not part of sqlite3's sources.
>
> --
> - stephan beal
> http://wanderinghorse.net/home/stephan/
> http://gplus.to/sgbeal
> ___
> 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] Segmentation Fault With Trigger

2013-10-11 Thread techi eth
Please provide some hint.I have added some more details about function
definition & query.

/* Create function definition */
static void Test(sqlite3_context *context, int argc, sqlite3_value **argv)
{
printf ("Trigger Function Called\n");
if (argc == 1) {
char *text = sqlite3_value_text(argv[0]);
if (text && text[0]) {
  char result[2];
  result[0] = text[0]; result[1] = '\0';
  sqlite3_result_text(context, result, -1, SQLITE_TRANSIENT);
  return;
}
}
sqlite3_result_null(context);
}
/*Create Function */
sqlite3_create_function(Handler, "Test",1, SQLITE_UTF8, NULL, , NULL,
NULL);

/*Create Trigger Query */
create trigger TestTrigger after insert on dbTestTbl for each row begin
SELECT Test (new.RowId) from dbTestTbl; end;


On Fri, Oct 11, 2013 at 5:55 PM, techi eth <techi...@gmail.com> wrote:

> Please find below :
>
> #0  0x7fffe0b8 in ?? ()
>
> #1  0x776988f6 in ?? () from
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
>
> #2  0x7769e451 in sqlite3_step () from
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
>
> #3  0x776a1e4c in sqlite3_exec () from
> /usr/lib/x86_64-linux-gnu/libsqlite3.so.0
>
> #4  0x778e1127 in SqliteTestInsert (SQLitePrivate=0x602300,
> TableName_p=0x4019a0 "dbTestTbl", DataInfoList=0x4)
>
> #5  0x00400d58 in TEST_SqliteTestInsert (RowID=) at
> sqlite3_test.c:340
>
> #6  main (argc=, args=) at sqlite3_test.c:922
>
> Thanks
>
>
> On Fri, Oct 11, 2013 at 5:35 PM, Richard Hipp <d...@sqlite.org> wrote:
>
>> On Fri, Oct 11, 2013 at 7:57 AM, techi eth <techi...@gmail.com> wrote:
>>
>> > Hi,
>> >
>> > I am getting segmentation fault while executing query in sqlite3. [Linux
>> > OS].
>> >
>>
>> Can you send us a stack trace?
>>
>>
>> >
>> > Find below sequence.
>> >
>> > // Getting SQLiteHandler
>> >
>> > OpenConnection ();
>> >
>> > //Creating user defined function “Test”
>> >
>> > sqlite3_create_function(SQLiteHandler, "Test",1, SQLITE_UTF8, NULL,
>> ,
>> > NULL, NULL)
>> >
>> > //Creating table,Below is DDL
>> >
>> > CREATE TABLE dbTestTbl (
>> >
>> > RowID   INTEGER PRIMARY KEY AUTOINCREMENT,
>> >
>> > ParamaterID INTEGER,
>> >
>> > ParamaterValue  TEXT
>> >
>> > );
>> >
>> > //Createatd Trigger,Below is DDL
>> >
>> > CREATE TRIGGER TestTrigger
>> >
>> >AFTER INSERT ON dbTestTbl
>> >
>> >FOR EACH ROW
>> >
>> > BEGIN
>> >
>> > SELECT Test( RowID )
>> >
>> >   FROM dbTestTbl;
>> >
>> > END;
>> >
>> > // INSERT INTO dbTestTbl
>> >
>> > Please suggest what is wrong defined here.
>> >
>> > Thanks
>> > ___
>> > sqlite-users mailing list
>> > sqlite-users@sqlite.org
>> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> >
>>
>>
>>
>> --
>> D. Richard Hipp
>> d...@sqlite.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


Re: [sqlite] Segmentation Fault With Trigger

2013-10-11 Thread techi eth
Please find below :

#0  0x7fffe0b8 in ?? ()

#1  0x776988f6 in ?? () from
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0

#2  0x7769e451 in sqlite3_step () from
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0

#3  0x776a1e4c in sqlite3_exec () from
/usr/lib/x86_64-linux-gnu/libsqlite3.so.0

#4  0x778e1127 in SqliteTestInsert (SQLitePrivate=0x602300,
TableName_p=0x4019a0 "dbTestTbl", DataInfoList=0x4)

#5  0x00400d58 in TEST_SqliteTestInsert (RowID=) at
sqlite3_test.c:340

#6  main (argc=, args=) at sqlite3_test.c:922

Thanks


On Fri, Oct 11, 2013 at 5:35 PM, Richard Hipp <d...@sqlite.org> wrote:

> On Fri, Oct 11, 2013 at 7:57 AM, techi eth <techi...@gmail.com> wrote:
>
> > Hi,
> >
> > I am getting segmentation fault while executing query in sqlite3. [Linux
> > OS].
> >
>
> Can you send us a stack trace?
>
>
> >
> > Find below sequence.
> >
> > // Getting SQLiteHandler
> >
> > OpenConnection ();
> >
> > //Creating user defined function “Test”
> >
> > sqlite3_create_function(SQLiteHandler, "Test",1, SQLITE_UTF8, NULL,
> ,
> > NULL, NULL)
> >
> > //Creating table,Below is DDL
> >
> > CREATE TABLE dbTestTbl (
> >
> > RowID   INTEGER PRIMARY KEY AUTOINCREMENT,
> >
> > ParamaterID INTEGER,
> >
> > ParamaterValue  TEXT
> >
> > );
> >
> > //Createatd Trigger,Below is DDL
> >
> > CREATE TRIGGER TestTrigger
> >
> >AFTER INSERT ON dbTestTbl
> >
> >FOR EACH ROW
> >
> > BEGIN
> >
> > SELECT Test( RowID )
> >
> >   FROM dbTestTbl;
> >
> > END;
> >
> > // INSERT INTO dbTestTbl
> >
> > Please suggest what is wrong defined here.
> >
> > Thanks
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
>
>
> --
> D. Richard Hipp
> d...@sqlite.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


[sqlite] Segmentation Fault With Trigger

2013-10-11 Thread techi eth
Hi,

I am getting segmentation fault while executing query in sqlite3. [Linux
OS].

Find below sequence.

// Getting SQLiteHandler

OpenConnection ();

//Creating user defined function “Test”

sqlite3_create_function(SQLiteHandler, "Test",1, SQLITE_UTF8, NULL, ,
NULL, NULL)

//Creating table,Below is DDL

CREATE TABLE dbTestTbl (

RowID   INTEGER PRIMARY KEY AUTOINCREMENT,

ParamaterID INTEGER,

ParamaterValue  TEXT

);

//Createatd Trigger,Below is DDL

CREATE TRIGGER TestTrigger

   AFTER INSERT ON dbTestTbl

   FOR EACH ROW

BEGIN

SELECT Test( RowID )

  FROM dbTestTbl;

END;

// INSERT INTO dbTestTbl

Please suggest what is wrong defined here.

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


[sqlite] Array Accessing in SQLite

2013-10-04 Thread techi eth
Hi,

Can anyone let me know what is best way to handle C Array in SQLite3 database
?

As of now I can think of creating multiple row for storing each array
element.

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


Re: [sqlite] Sqlite handler in trigger

2013-09-06 Thread techi eth
Thanks for clarification.

My understanding:

Process creating notified function has to create trigger & do the other
operation (Update, Insert and Delete) to get trigger logic execution. I
understand it may not be in same sequence.

Process can register function & create trigger, But trigger operation may
come on run time .(All by using common sqlite handler...)

>Which part of this sentence did you find unclear the first time round?

It is all clear

I was just checking for hint, if some one comes across to handle this kind
of scenario by using combination of sqlite capability & application logic!!!


On Fri, Sep 6, 2013 at 10:34 AM, Igor Tandetnik <i...@tandetnik.org> wrote:

> On 9/6/2013 12:51 AM, techi eth wrote:
>
>> I am not sure if my problem I have stated clearly, found below detail
>> explanation!!!
>>
>> --**--**
>> 
>>
>> Process 1:
>>
>> Handler1 = OpenConn();
>>
>> Sqlite_Createfunc(Handler1, my_notifier_function()..);
>>
>> CREATE TRIGGER Event_test1 AFTER Update ON test BEGIN
>>
>> SELECT my_notifier_function();
>>
>> END;
>>
>> --**--**
>> 
>>
>> Proecss2:
>>
>> Handler2 = OpenConn();
>>
>> Update test SET value;
>>
>
> That last statement will fail with "unknown function
> 'my_notifier_function' " error.
>
>  In this scenario when proecss2 will do update...
>>
>
> In this scenario process2 will be unable to do update.
>
>
>  If above will not happen then please suggest what is best I can get from
>> sqlite3 to handle this kind of scenario.
>>
>
> Once again: there is no mechanism built into SQLite that would allow one
> process to be automatically notified that another process made a change to
> the database. Which part of this sentence did you find unclear the first
> time round?
>
> --
> Igor Tandetnik
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<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 handler in trigger

2013-09-05 Thread techi eth
I am not sure if my problem I have stated clearly, found below detail
explanation!!!



Process 1:

Handler1 = OpenConn();

Sqlite_Createfunc(Handler1, my_notifier_function()..);

CREATE TRIGGER Event_test1 AFTER Update ON test BEGIN

   SELECT my_notifier_function();

END;



Proecss2:

Handler2 = OpenConn();

Update test SET value;



In this scenario when proecss2 will do update then trigger logic will get
executed & my_notifier_function() function may get called.

If above will not happen then please suggest what is best I can get from
sqlite3 to handle this kind of scenario. May be any other possible
operation?

Thanks..



On Thu, Sep 5, 2013 at 6:55 PM, Igor Tandetnik <i...@tandetnik.org> wrote:

> On 9/5/2013 5:39 AM, techi eth wrote:
>
>> I have case where one process is updating data with his private handler
>> but
>> trigger on update is created by other process by his private handler.
>>
>
> I'm not sure I understand this sentence. When you run CREATE TRIGGER
> statement, the trigger you've just created becomes part of the database
> schema, visible to all connections (unless you do CREATE TEMP TRIGGER; is
> this what you are talking about?)
>
> On the other hand, sqlite3_create_function() registers a custom function
> just for this connection. If you create a trigger that calls this function,
> then those connections where the function is not registered will fail to
> even prepare an UPDATE statement - SQLite will issue an "unknown function"
> error.
>
> In general, there is no mechanism built into SQLite that would allow one
> process to be automatically notified that another process made a change to
> the database. If that's what you want, you would have to implement that in
> your application - you can't somehow trick SQLite into doing it for you.
> --
> Igor Tandetnik
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<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] Sqlite handler in trigger

2013-09-05 Thread techi eth
Hi,

 I would like to check sqlite handler usability while using trigger:

I have register one function to sqlite by sqlite3_create_function().Now I
am creating trigger on update & selecting that function for callaback.

In above scenario it is mandatory that sqlite3 handler used while create
function & setting trigger should use for update.

I have case where one process is updating data with his private handler but
trigger on update is created by other process by his private handler.

Cheers -

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


Re: [sqlite] Table Creation Behaviour!!!

2013-08-30 Thread techi eth
Thanks.

What about INSERT query behavior.
Is their any specific reason of allowing inserting  same data set
which is already present in database ?

Cheers -

On 8/30/13, Clemens Ladisch <clem...@ladisch.de> wrote:
> techi eth wrote:
>> I have open the connection, created the table by using CREATE TABLE IF
>> NOT
>> EXISTS , doing some operation & closing the connection.
>>
>> If I again open the connection & try to do table creation again (With
>> same
>> table name & same database file) then what will be the behavior?
>>
>> I am expecting it should not create table & return me error, because
>> their
>> is already table with same name exists.
>
> RTFM <http://www.sqlite.org/lang_createtable.html>:
> | It is usually an error to attempt to create a new table in a database
> | that already contains a table of the same name. However, if the "IF
> | NOT EXISTS" clause is specified as part of the CREATE TABLE statement
> | and a table of the same name already exists, the CREATE TABLE command
> | simply has no effect (and no error message is returned).
>
>
> Regards,
> Clemens
> ___
> 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] Table Creation Behaviour!!!

2013-08-30 Thread techi eth
Query Regarding Table Creation :

I have open the connection, created the table by using CREATE TABLE IF NOT
EXISTS , doing some operation & closing the connection.

If I again open the connection & try to do table creation again (With same
table name & same database file) then what will be the behavior?

I am expecting it should not create table & return me error, because their
is already table with same name exists.

Cheers -

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


Re: [sqlite] Database File Size

2013-08-29 Thread techi eth
I am thinking to use auto_vacuum INCREMENTAL & PRAGMA
incremental_vacuum(N) to make sure whenever required, pages can be
free.

I assume this will be better option with compare to FULL.

I assume i can do anytime this operation in squence after opening
successfull connection to Database.I am holding open connection
handler as long as i required in system.

Thanks..


Cheers -
Techi

On 8/30/13, techi eth <techi...@gmail.com> wrote:
> I am using Jffs2 file system. As of now I using all default from
> sqlite3.I am not sure with this information it is possible to get some
> approx that with 'X KB data, database file size will be 'Y' KB or MB.
>
>> Regarding default file size.
> I understand with the use of max_page_count & size of each page
> database file size is get calculated.
> What is default setting for max_page_count (I leanr Default for page is
> 1KB)
>
> Cheers -
> Techi
>
> On 8/29/13, Simon Slavin <slav...@bigfraud.org> wrote:
>>
>> On 29 Aug 2013, at 9:11am, techi eth <techi...@gmail.com> wrote:
>>
>>> 1) Is their any way I can calculate approx file size based on data.
>>>
>>> Ex :  Let us say i am creating table with  (row ID int ,Test Text).
>>>
>>> Each text string size is 10 byte. If I will create 100 row of this in
>>> database then what would be Max size of created database file.
>>
>> Assuming that you are talking about a database file created from scratch,
>> you might be able to take a guess at the maximum file size by just
>> creating
>> a file like that yourself and seeing how bit it is.  But the answer for
>> your
>> users would depend on which file system and which operating system they
>> are
>> using.  This is because those things govern the page size selected by
>> SQLite:
>>
>> <http://www.sqlite.org/pragma.html#pragma_page_size>
>>
>> You would have to allow so much 'slop' it might be easier just to pick an
>> acceptable number -- say half a megabyte, and use that.
>>
>>> 2) How do I can fix the database file size to make sure I have not
>>> exceeded
>>> max page count?
>>>
>>> http://www.sqlite.org/pragma.html#pragma_max_page_count
>>
>> No need.  SQLite will itself refuse to make a database file bigger than
>> that.  I believe it generates an SQLITE_IOERR for the command that tries
>> to
>> exceed that page count.
>>
>> Simon.
>> ___
>> 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] Database File Size

2013-08-29 Thread techi eth
I am using Jffs2 file system. As of now I using all default from
sqlite3.I am not sure with this information it is possible to get some
approx that with 'X KB data, database file size will be 'Y' KB or MB.

> Regarding default file size.
I understand with the use of max_page_count & size of each page
database file size is get calculated.
What is default setting for max_page_count (I leanr Default for page is 1KB)

Cheers -
Techi

On 8/29/13, Simon Slavin <slav...@bigfraud.org> wrote:
>
> On 29 Aug 2013, at 9:11am, techi eth <techi...@gmail.com> wrote:
>
>> 1) Is their any way I can calculate approx file size based on data.
>>
>> Ex :  Let us say i am creating table with  (row ID int ,Test Text).
>>
>> Each text string size is 10 byte. If I will create 100 row of this in
>> database then what would be Max size of created database file.
>
> Assuming that you are talking about a database file created from scratch,
> you might be able to take a guess at the maximum file size by just creating
> a file like that yourself and seeing how bit it is.  But the answer for your
> users would depend on which file system and which operating system they are
> using.  This is because those things govern the page size selected by
> SQLite:
>
> <http://www.sqlite.org/pragma.html#pragma_page_size>
>
> You would have to allow so much 'slop' it might be easier just to pick an
> acceptable number -- say half a megabyte, and use that.
>
>> 2) How do I can fix the database file size to make sure I have not
>> exceeded
>> max page count?
>>
>> http://www.sqlite.org/pragma.html#pragma_max_page_count
>
> No need.  SQLite will itself refuse to make a database file bigger than
> that.  I believe it generates an SQLITE_IOERR for the command that tries to
> exceed that page count.
>
> Simon.
> ___
> 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] Database locking Error

2013-08-29 Thread techi eth
Thanks for suggestion. I will take it forward.

locking will happen with two simultaneous processes accessing for read also?

Thanks


On 8/29/13, Simon Slavin <slav...@bigfraud.org> wrote:
>
> On 29 Aug 2013, at 6:48am, techi eth <techi...@gmail.com> wrote:
>
>> I am checking for all the function.As of now i am not using sqlite3 time
>> out but testing application will take decision accordingly to recall the
>> operation based on type of error.
>
> If you have two simultaneous processes accessing the same database and have
> not set a timeout, that explains your locking errors.  You will get constant
> collisions as both processes try to access the database at the same time and
> if you haven't set a timeout every one of these will instantly be reported
> as a locking error.
>
> I suggest you set a timeout in both processes to, perhaps, 5 seconds.  This
> means that the processes will each retry for anything up to 5 seconds before
> reporting locking errors.
>
> Simon.
> ___
> 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] Sqlite3 on JFFS2 File System

2013-08-29 Thread techi eth
Hi,

 Anybody have used Sqlite3 on JFFS2 file system with Journal_mode = WAL.

 I have found issue of I/O error.

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


[sqlite] Database File Size

2013-08-29 Thread techi eth
Database files size:

1) Is their any way I can calculate approx file size based on data.

 Ex :  Let us say i am creating table with  (row ID int ,Test Text).

Each text string size is 10 byte. If I will create 100 row of this in
database then what would be Max size of created database file.

2) How do I can fix the database file size to make sure I have not exceeded
max page count?

http://www.sqlite.org/pragma.html#pragma_max_page_count

Cheers -

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


[sqlite] auto_vacuum default setting

2013-08-29 Thread techi eth
When I look through details about PRAGMA auto_vacuum,I think it is always
beneficial to have auto_vaccum set to Full so that whenever delete happens we
have shrink of size.

http://www.sqlite.org/pragma.html#pragma_auto_vacuum

I wanted to know is their any benefit to have this to none in default
instead of full.

Cheers -

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


Re: [sqlite] Database locking Error

2013-08-28 Thread techi eth
I am checking for all the function.As of now i am not using sqlite3 time
out but testing application will take decision accordingly to recall the
operation based on type of error.



On Wed, Aug 28, 2013 at 3:03 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 28 Aug 2013, at 9:24am, techi eth <techi...@gmail.com> wrote:
>
> > Yes, i am checking the return code.
>
> Just for the function that gives the error, or for the calls before that
> too ?
>
> And are you setting a timeout ?  If so, for how long ?
>
> Simon.
> ___
> 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] I/O error in sqlite3

2013-08-28 Thread techi eth
Kindly let me know the reason for I/O error. WAL mode is creating problem
on ARM target.


Thanks..


On Tue, Aug 27, 2013 at 10:13 AM, techi eth <techi...@gmail.com> wrote:

> I have got the reason for I/O error:
>
> It is due to PRAGMA journal mode WAL. If I run with default journal mode
> then application is working fine.
>
> In above case what is the system architecture requirement to get WAL mode
> enable?
>
> How do I can achieve better concurrency in terms of reading?
>
> Thanks.
>
>
> On Tue, Aug 27, 2013 at 9:58 AM, techi eth <techi...@gmail.com> wrote:
>
>> What is possible cause of I/O error in sqlite3?
>>
>> My application is running fine on Desktop PC.Same application when I try
>> to run on ARM target it is giving I/O error.
>>
>> sqlite3 on Host : 3.7.9
>>
>> sqlite3 on Target : 3.7.14.1
>>
>
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Database locking Error

2013-08-28 Thread techi eth
Yes, i am checking the return code.


On Tue, Aug 27, 2013 at 5:09 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 27 Aug 2013, at 5:15am, techi eth <techi...@gmail.com> wrote:
>
> > For read operation i am doing _prepare(), _step(), _finalize().
> > For all other operation i am doing _exec().
> >
> > Do you see any issue ?
>
> Nothing obvious from what I already know apart from the fact that you
> don't mention setting a timeout:
>
> <http://www.sqlite.org/c3ref/busy_timeout.html>
> <http://www.sqlite.org/pragma.html#pragma_busy_timeout>
>
> Without that, a process getting a lock won't back off and retry, it'll
> just immediately return an error.  Which is almost never what people want.
>  You would probably be better off setting this to 5 seconds or something.
>
> I suspect that the process which is getting the lock is fine and that it's
> the other process which is keeping the file locked.
>
> Are you checking the return codes from /all/ your SQLite calls in other
> processes ?  The code you included doesn't seem to do that but I thought
> that might be pseudocode.
>
> Simon.
> ___
> 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] I/O error in sqlite3

2013-08-26 Thread techi eth
I have got the reason for I/O error:

It is due to PRAGMA journal mode WAL. If I run with default journal mode
then application is working fine.

In above case what is the system architecture requirement to get WAL mode
enable?

How do I can achieve better concurrency in terms of reading?

Thanks.


On Tue, Aug 27, 2013 at 9:58 AM, techi eth <techi...@gmail.com> wrote:

> What is possible cause of I/O error in sqlite3?
>
> My application is running fine on Desktop PC.Same application when I try
> to run on ARM target it is giving I/O error.
>
> sqlite3 on Host : 3.7.9
>
> sqlite3 on Target : 3.7.14.1
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] I/O error in sqlite3

2013-08-26 Thread techi eth
What is possible cause of I/O error in sqlite3?

My application is running fine on Desktop PC.Same application when I try to
run on ARM target it is giving I/O error.

sqlite3 on Host : 3.7.9

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


Re: [sqlite] Database locking Error

2013-08-26 Thread techi eth
For read operation i am doing _prepare(), _step(), _finalize().
For all other operation i am doing _exec().

Do you see any issue ?

Cheers -
Techi


On Mon, Aug 26, 2013 at 9:22 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 26 Aug 2013, at 9:02am, techi eth <techi...@gmail.com> wrote:
>
> > Fun_Read() on TblTest**
> > /* Do the periodic read operation by using db handler return from above*/
>
> How is your read done ?  Do you use _exec() like you do for the PRAGMA, or
> _prepare(), _step(), _finalize(), or _query() or something else ?
>
> Simon.
> ___
> 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] Database locking Error

2013-08-26 Thread techi eth
Oppps. Apologies for my mistake.

My test is working correctly now.

Thanks a lot.

>You only have to do this once, e.g. at database creation.
>Journal mode WAL is a persistent property of the database file.
>Every connection will respect it.

All PRAGMA Option is attached to database as a persistent property?

Is their any issue if we set all option again with every new connection to
same file?


On Mon, Aug 26, 2013 at 2:40 PM, Kees Nuyt <k.n...@zonnet.nl> wrote:

> On Mon, 26 Aug 2013 13:32:42 +0530, techi eth <techi...@gmail.com>
> wrote:
>
> >PRAGMA jouranl_mode = WAL
>
> That's misspelled, both in your text and in your code.
>
> Try:
> PRAGMA journal_mode=WAL;
>
> You only have to do this once, e.g. at database creation.
> Journal mode WAL is a persistent property of the database file.
> Every connection will respect it.
>
> --
> Groet, Cordialement, Pozdrawiam, Regards,
>
> Kees Nuyt
>
> ___
> 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] Database locking Error

2013-08-26 Thread techi eth
Thanks.

I tried using PRAGMA jouranl_mode = WAL but still it is getting failed for
some time. Find below  more details.

Process 1:

Fun_Open()

sqlite3_open(DATABASE, );

sqlite3_exec(dbUpdate, " PRAGMA jouranl_mode = WAL", NULL, NULL, );

Fun_Update() on TblTest

/* Do the periodic update operation by using db handler return from above*/

Process 2:

Fun_Open()

sqlite3_open(DATABASE, );

sqlite3_exec(dbRead, " PRAGMA jouranl_mode = WAL", NULL, NULL, );

Fun_Read() on TblTest**
/* Do the periodic read operation by using db handler return from above*/

Cheers -
Techi


On Mon, Aug 26, 2013 at 12:14 PM, Dan Kennedy <danielk1...@gmail.com> wrote:

> On 08/26/2013 01:37 PM, techi eth wrote:
>
>> Hi,
>>
>> I come across database file locking error while trying below case with
>> Update.
>>
>> Case: One process is updating a Colum periodically & other process is
>> selecting same Colum or other colum in table periodically for read.
>> What is the best way to handle so that Update will not get locking error?
>>
>
> Using WAL mode.
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<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] Database locking Error

2013-08-26 Thread techi eth
Hi,

I come across database file locking error while trying below case with
Update.

Case: One process is updating a Colum periodically & other process is
selecting same Colum or other colum in table periodically for read.
What is the best way to handle so that Update will not get locking error?

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


[sqlite] BLOB & Other Data Type

2013-08-21 Thread techi eth
Hi,

 What is difference by using Colum data type as blob or Any other
(Text,INT,REAL,NUMERIC)

http://www.sqlite.org/datatype3.html

According to above link I understand “The value is a blob of data, stored
exactly as it was input”.I beleive that it what required.

Ex : Please let me know difference between below two operration.

CREATE TABLE Test ( ID INT PRIMARY KEY NOT NULL, NAME TEXT NOT NULL, AGE
INT)

INSERT INTO Test (ID,NAME,AGE)

VALUES (1, 'Test', 32);

 Or

CREATE TABLE Test ( ID BLOB PRIMARY KEY NOT NULL, NAME BLOB NOT NULL, AGE
BLOB)

INSERT INTO Test (ID,NAME,AGE)

VALUES (1, 'Test', 32);

Cheers -

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


[sqlite] SELECT Count

2013-08-19 Thread techi eth
Hi,

What is the way to get number of possible count matching with criteria for
SELECT?

SELECT Colum from Table WHERE Criteria

I tried with sqlite3_count_changes() & sqlite3_data_count() function but
they are not returning actual value.

Definitely getting Colum count by sqlite3_coloum_count () & doing
sqlite3_step () for each row will get me result but I am looking better way
to get the result (May be one of register function).

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


[sqlite] Number of Colum!!!

2013-08-13 Thread techi eth
Is their any limit on number of Colum in SQLite3 table?

Cheers -

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


[sqlite] sqlite3 error string size!!!

2013-08-12 Thread techi eth
Hi,

What is the maximum size error string returned by sqlite3_errmsg() function
?

Cheers –

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


[sqlite] Default Constraint Behaviour!!!

2013-08-09 Thread techi eth
Is it possible to read default value of any Colum?
Ex :  Create table by adding default constraint to Colum & then read back
the default constraint value before doing INSERT,UPDATE.

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


Re: [sqlite] Where Clause

2013-08-08 Thread techi eth
> BEGIN;

> SELECT COUNT() FROM  WHERE ;

> if count == 0

> raise exception

> else

> UPDATE ...

> COMMIT

I have passed the query for count to sqlite3_exec () function.

Return of count value is part of callback function or I need to use some
other way to get.

Cheers -

Techi


On Fri, Aug 2, 2013 at 4:53 PM, Hick Gunter <h...@scigames.at> wrote:

> Please note that you do need to have an explicit transaction in progress.
> Otherwise the SELECT may count records that no longer exist when the UPDATE
> starts.
>
> -Ursprüngliche Nachricht-
> Von: techi eth [mailto:techi...@gmail.com]
> Gesendet: Freitag, 02. August 2013 13:13
> An: General Discussion of SQLite Database
> Betreff: Re: [sqlite] Where Clause
>
> I was checking for Update only if condition will match.
>
> In fact it can be any operation like SELECT,INSERT,UPDATE or DELETE
>
> I think hint given by you using count() function will do the required.
>
> So here If condition matches then count will return nonzero value & based
> on that I can continue further.
>
> Thanks
>
>
> On Fri, Aug 2, 2013 at 4:15 PM, Hick Gunter <h...@scigames.at> wrote:
>
> > Please describe in simple words what you are trying to do.
> >
> > UPDATE  SET = WHERE 
> >
> > Will change the value of  in all records of the  that
> > satisfy the .
> >
> > You seem to be expecting that the field is changed also in records
> > that do not satisfy the condition.
> >
> > Or perhaps you really want something like:
> >
> > BEGIN;
> >     SELECT COUNT() FROM  WHERE ;
> > if count == 0
> > raise exception
> > else
> > UPDATE ...
> > COMMIT
> >
> > -Ursprüngliche Nachricht-
> > Von: techi eth [mailto:techi...@gmail.com]
> > Gesendet: Freitag, 02. August 2013 12:36
> > An: General Discussion of SQLite Database
> > Betreff: Re: [sqlite] Where Clause
> >
> > Is their any Query format which can change the value based on
> > conditional expression is TRUE!!!
> >
> > Thanks..
> >
> > Techi -
> >
> >
> > On Fri, Aug 2, 2013 at 2:11 PM, Hick Gunter <h...@scigames.at> wrote:
> >
> > > The SQL you gave translates to
> > >
> > > "Change the 'Name' field to have the value 'test' in all records
> > > where the 'ID' field has the value 2".
> > >
> > > If there is no such record, then SQL has nothing to do and very
> > > successfully does exactly nothing.
> > >
> > > SQL is "set oriented" and update operations on empty sets always
> succeed.
> > >
> > > I guess you are thinking along procedural/file oriented lines as in
> > > pseudocode
> > >
> > > record.id = 2;
> > > error = readwithlock( file, byID,  );
> > > if (error) raise exception;
> > > record.name = 'test';
> > > error = updatewithunlock ( file,  );
> > > if (error) raise exception;
> > >
> > > SQLite implements UPDATE as a SELECT followed by REPLACE statemenst
> > > as if written like
> > >
> > >  (INSERT OR) REPLACE INTO table SELECT id,'test' FROM table
> > > WHERE id = 2;
> > >
> > > Which is equivalent to (naïve, not using index) pseudocode like
> > >
> > > open( file );
> > > while (! eof( file ) )
> > > {
> > > error = readseqwithlock( file,  );
> > > if (error) raise exception;
> > > if (record.id == 2)
> > > {
> > > record.name = 'test';
> > > error = updatewithunlock( file,  );
> > > if (error) raise exception;
> > > } else {
> > > error = unlock( file );
> > > if (error) raise exception;
> > > }
> > > }
> > >
> > > HTH
> > > Gunter
> > >
> > > -Ursprüngliche Nachricht-
> > > Von: techi eth [mailto:techi...@gmail.com]
> > > Gesendet: Freitag, 02. August 2013 10:15
> > > An: General Discussion of SQLite Database
> > > Betreff: [sqlite] Where Clause
> > >
> > > Come across one issue with conditional query execution.
> > >
> > > Query: UPDATE COMPANY SET Name= 'test' WHERE ID = 2; According to my
> > > understanding if no ID = 2 is present in table then error should
> > > return but it return with SQLITE_OK however Name value is not

Re: [sqlite] Query on Update or Selective Insert

2013-08-07 Thread techi eth
Apologies to use programming convention!!!

Here I mean to have Colum

UPDATE table_name SET column1 = value1, column2 = value2, columnN =
valueN

Here N is 100.

Cheers -

Techi



On Wed, Aug 7, 2013 at 3:26 PM, Hick Gunter <h...@scigames.at> wrote:

> What do you mean by "variable"?
>
> -Ursprüngliche Nachricht-
> Von: techi eth [mailto:techi...@gmail.com]
> Gesendet: Mittwoch, 07. August 2013 10:50
> An: General Discussion of SQLite Database
> Betreff: [sqlite] Query on Update or Selective Insert
>
> Query on Update or Selective Insert:
>
> I am trying to update 100 variables at a time & due to some of the reason
> 99 th or any mid index variable cause update to fail.
>
> In that case this query has to execute it again for the entire variable or
> only for failed variable.
>
> Cheers -
>
> Techi
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
> --
>  Gunter Hick
> Software Engineer
> Scientific Games International GmbH
> Klitschgasse 2 – 4, A - 1130 Vienna, Austria
> FN 157284 a, HG Wien
> Tel: +43 1 80100 0
> E-Mail: h...@scigames.at
>
> This e-mail is confidential and may well also be legally privileged. If
> you have received it in error, you are on notice as to its status and
> accordingly please notify us immediately by reply e-mail and then delete
> this message from your system. Please do not copy it or use it for any
> purposes, or disclose its contents to any person as to do so could be a
> breach of confidence. Thank you for your cooperation.
> ___
> 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] Query on Update or Selective Insert

2013-08-07 Thread techi eth
Query on Update or Selective Insert:

I am trying to update 100 variables at a time & due to some of the reason 99
th or any mid index variable cause update to fail.

In that case this query has to execute it again for the entire variable or
only for failed variable.

Cheers -

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


Re: [sqlite] Where Clause

2013-08-02 Thread techi eth
I was checking for Update only if condition will match.

In fact it can be any operation like SELECT,INSERT,UPDATE or DELETE

I think hint given by you using count() function will do the required.

So here If condition matches then count will return nonzero value & based
on that I can continue further.

Thanks


On Fri, Aug 2, 2013 at 4:15 PM, Hick Gunter <h...@scigames.at> wrote:

> Please describe in simple words what you are trying to do.
>
> UPDATE  SET = WHERE 
>
> Will change the value of  in all records of the  that
> satisfy the .
>
> You seem to be expecting that the field is changed also in records that do
> not satisfy the condition.
>
> Or perhaps you really want something like:
>
> BEGIN;
> SELECT COUNT() FROM  WHERE ;
> if count == 0
> raise exception
> else
> UPDATE ...
> COMMIT
>
> -Ursprüngliche Nachricht-
> Von: techi eth [mailto:techi...@gmail.com]
> Gesendet: Freitag, 02. August 2013 12:36
> An: General Discussion of SQLite Database
> Betreff: Re: [sqlite] Where Clause
>
> Is their any Query format which can change the value based on conditional
> expression is TRUE!!!
>
> Thanks..
>
> Techi -
>
>
> On Fri, Aug 2, 2013 at 2:11 PM, Hick Gunter <h...@scigames.at> wrote:
>
> > The SQL you gave translates to
> >
> > "Change the 'Name' field to have the value 'test' in all records where
> > the 'ID' field has the value 2".
> >
> > If there is no such record, then SQL has nothing to do and very
> > successfully does exactly nothing.
> >
> > SQL is "set oriented" and update operations on empty sets always succeed.
> >
> > I guess you are thinking along procedural/file oriented lines as in
> > pseudocode
> >
> > record.id = 2;
> > error = readwithlock( file, byID,  );
> > if (error) raise exception;
> > record.name = 'test';
> > error = updatewithunlock ( file,  );
> > if (error) raise exception;
> >
> > SQLite implements UPDATE as a SELECT followed by REPLACE statemenst as
> > if written like
> >
> >  (INSERT OR) REPLACE INTO table SELECT id,'test' FROM table WHERE
> > id = 2;
> >
> > Which is equivalent to (naïve, not using index) pseudocode like
> >
> > open( file );
> > while (! eof( file ) )
> > {
> > error = readseqwithlock( file,  );
> > if (error) raise exception;
> > if (record.id == 2)
> >     {
> > record.name = 'test';
> > error = updatewithunlock( file,  );
> > if (error) raise exception;
> > } else {
> > error = unlock( file );
> > if (error) raise exception;
> > }
> > }
> >
> > HTH
> > Gunter
> >
> > -Ursprüngliche Nachricht-
> > Von: techi eth [mailto:techi...@gmail.com]
> > Gesendet: Freitag, 02. August 2013 10:15
> > An: General Discussion of SQLite Database
> > Betreff: [sqlite] Where Clause
> >
> > Come across one issue with conditional query execution.
> >
> > Query: UPDATE COMPANY SET Name= 'test' WHERE ID = 2; According to my
> > understanding if no ID = 2 is present in table then error should
> > return but it return with SQLITE_OK however Name value is not changed.
> >
> > Cheers -
> > Techi
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> >
> > --
> > 
> >  Gunter Hick
> > Software Engineer
> > Scientific Games International GmbH
> > Klitschgasse 2 - 4, A - 1130 Vienna, Austria FN 157284 a, HG Wien
> > Tel: +43 1 80100 0
> > E-Mail: h...@scigames.at
> >
> > This e-mail is confidential and may well also be legally privileged.
> > If you have received it in error, you are on notice as to its status
> > and accordingly please notify us immediately by reply e-mail and then
> > delete this message from your system. Please do not copy it or use it
> > for any purposes, or disclose its contents to any person as to do so
> > could be a breach of confidence. Thank you for your cooperation.
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> ___
>

Re: [sqlite] Where Clause

2013-08-02 Thread techi eth
Is their any Query format which can change the value based on conditional
expression is TRUE!!!

Thanks..

Techi -


On Fri, Aug 2, 2013 at 2:11 PM, Hick Gunter <h...@scigames.at> wrote:

> The SQL you gave translates to
>
> "Change the 'Name' field to have the value 'test' in all records where the
> 'ID' field has the value 2".
>
> If there is no such record, then SQL has nothing to do and very
> successfully does exactly nothing.
>
> SQL is "set oriented" and update operations on empty sets always succeed.
>
> I guess you are thinking along procedural/file oriented lines as in
> pseudocode
>
> record.id = 2;
> error = readwithlock( file, byID,  );
> if (error) raise exception;
> record.name = 'test';
> error = updatewithunlock ( file,  );
> if (error) raise exception;
>
> SQLite implements UPDATE as a SELECT followed by REPLACE statemenst as if
> written like
>
>  (INSERT OR) REPLACE INTO table SELECT id,'test' FROM table WHERE id =
> 2;
>
> Which is equivalent to (naïve, not using index) pseudocode like
>
> open( file );
> while (! eof( file ) )
> {
> error = readseqwithlock( file,  );
> if (error) raise exception;
> if (record.id == 2)
> {
> record.name = 'test';
> error = updatewithunlock( file,  );
> if (error) raise exception;
> } else {
> error = unlock( file );
> if (error) raise exception;
> }
> }
>
> HTH
> Gunter
>
> -Ursprüngliche Nachricht-
> Von: techi eth [mailto:techi...@gmail.com]
> Gesendet: Freitag, 02. August 2013 10:15
> An: General Discussion of SQLite Database
> Betreff: [sqlite] Where Clause
>
> Come across one issue with conditional query execution.
>
> Query: UPDATE COMPANY SET Name= 'test' WHERE ID = 2; According to my
> understanding if no ID = 2 is present in table then error should return but
> it return with SQLITE_OK however Name value is not changed.
>
> Cheers -
> Techi
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
> --
>  Gunter Hick
> Software Engineer
> Scientific Games International GmbH
> Klitschgasse 2 – 4, A - 1130 Vienna, Austria
> FN 157284 a, HG Wien
> Tel: +43 1 80100 0
> E-Mail: h...@scigames.at
>
> This e-mail is confidential and may well also be legally privileged. If
> you have received it in error, you are on notice as to its status and
> accordingly please notify us immediately by reply e-mail and then delete
> this message from your system. Please do not copy it or use it for any
> purposes, or disclose its contents to any person as to do so could be a
> breach of confidence. Thank you for your cooperation.
> ___
> 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] Query on database back-up:

2013-08-02 Thread techi eth
Thanks.All cases clear except below

What happen if other process is not able to complete operation within
timeout duration?

Cheers -
Techi




On Fri, Aug 2, 2013 at 2:28 PM, Clemens Ladisch <clem...@ladisch.de> wrote:

> > techi eth wrote:
> >> 1. "Any database clients wishing to write to the database file while a
> >> backup is being created must wait until the shared lock is
> >> relinquished."
> >
> > Example 1: Loading and Saving In-Memory Databases will not fulfill
> > this shortcoming.
>
> In-memory databases cannot be accessed by other clients.
>
> > Example 2: Fulfill the shortcoming but cost of more time due to
> > restart of backup from fresh in the case of INSERT, ALTER, DROP &
> > UPDATE.
> >
> > Addinitionally what happen if other process is not able to complete
> > operation within timeout duration?
>
> If you tell the backup API to copy all pages at once, you get
> a behaviour similar to a plain file copy.  Using smaller steps allows
> you to balance the speed of the backup itself against the risk of other
> clients being locked out for too long.
>
> >> 2. "It cannot be used to copy data to or from in-memory databases."
> >
> > I haven't got it full but I understand by CP I am able to copy any
> > file in Linux system.
>
> And an in-memory database does not have a file.
>
> >> 3."If a power failure or operating system failure occurs while copying
> >> the database file the backup database may be corrupted following
> >> system recovery"
> >
> > This is very useful benefit. What is the resulted outcome of power
> > failure or OS failure if we use backup API?
>
> The transaction is rolled back, and the destination is not changed.
>
>
> Regards,
> Clemens
> ___
> 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] Where Clause

2013-08-02 Thread techi eth
At the end of execution I am expecting SET will change the value but it
actually doesn't SET the value due to wrong condition.

I will check return from sqlite3 & due to success return I am in wrong
assumption.


On Fri, Aug 2, 2013 at 1:57 PM, Igor Korot <ikoro...@gmail.com> wrote:

> Hi
> Why do you think it should return error?
> On Aug 2, 2013 1:15 AM, "techi eth" <techi...@gmail.com> wrote:
>
> > Come across one issue with conditional query execution.
> >
> > Query: UPDATE COMPANY SET Name= 'test' WHERE ID = 2;
> > According to my understanding if no ID = 2 is present in table then error
> > should return but it return with SQLITE_OK however Name value is not
> > changed.
> >
> > Cheers -
> > Techi
> > ___
> > 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-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Where Clause

2013-08-02 Thread techi eth
Come across one issue with conditional query execution.

Query: UPDATE COMPANY SET Name= 'test' WHERE ID = 2;
According to my understanding if no ID = 2 is present in table then error
should return but it return with SQLITE_OK however Name value is not
changed.

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


Re: [sqlite] Query on database back-up:

2013-08-02 Thread techi eth
Appreciate if I will get clarification.

If any of the point out of the scope of mailing list then please mark.
Thanks a lot!!!


On Wed, Jul 31, 2013 at 6:53 PM, techi eth <techi...@gmail.com> wrote:

> Thanks for answer.
>
> Let me put my query on point mentioned by comparing historic way of
> doing copy at the start of link.
> 1. "Any database clients wishing to write to the database file while a
> backup is being created must wait until the shared lock is
> relinquished."
>
> Example 1: Loading and Saving In-Memory Databases will not fulfill
> this shortcoming.
>
> Example 2: Fulfill the shortcoming but cost of more time due to
> restart of backup from fresh in the case of INSERT, ALTER, DROP &
> UPDATE.I understand SELECT will not add time.
>
> Addinitionally what happen if other process is not able to complete
> operation within timeout duration?
>
> 2. "It cannot be used to copy data to or from in-memory databases."
>
> I haven't got it full but I understand by CP I am able to copy any
> file in Linux system.
>
> 3."If a power failure or operating system failure occurs while copying
> the database file the backup database may be corrupted following
> system recovery"
>
> This is very useful benefit. What is the resulted outcome of power
> failure or OS failure if we use backup API?
>
>
>
> On 7/31/13, Simon Slavin <slav...@bigfraud.org> wrote:
> >
> > On 31 Jul 2013, at 12:56pm, techi eth <techi...@gmail.com> wrote:
> >
> >> I have followed below link for details. It say “If another thread or
> >> process writes to the source database while this function is sleeping,
> >> then
> >> SQLite detects this and usually restarts the backup process when
> >> sqlite3_backup_step() is next called”.
> >>
> >> - It means it will start back-up from start or resume from last left
> page
> >> but making sure all update will be written in backup file.
> >
> > Every time a change is made the backup has to restart from the beginning
> > again.  So if, for example, it would take 300 seconds to backup the
> entire
> > file, the backup process will not complete until there has been a 300
> second
> > period when no changes were made to the file.
> >
> >> - Is their any issue if process acquiring database handle will do both
> >> the
> >> operation (Writing & Backup).
> >
> > No.  This is not a problem.  Though, of course, if anything does use that
> > handle to write to the database the backup will be (automatically)
> > restarted.
> >
> >> http://www.sqlite.org/backup.html
> >
> > Simon.
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Transaction Handling

2013-07-31 Thread techi eth
Is it possible to use Sqlite3 transaction capability based on actual return
of individual transaction query execution?

 Example:

BEGIN

SELECT for reading the database (Here I will get data in my read call back
function Based on data status I may initiate other transaction, like below
Update)

UPDATE

COMMIT

Note :This is implemented by C wrapper function of handling individual
operation like Select, Update, Drop or Insert.

Cheers-

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


Re: [sqlite] Query on database back-up:

2013-07-31 Thread techi eth
Thanks for answer.

Let me put my query on point mentioned by comparing historic way of
doing copy at the start of link.
1. "Any database clients wishing to write to the database file while a
backup is being created must wait until the shared lock is
relinquished."

Example 1: Loading and Saving In-Memory Databases will not fulfill
this shortcoming.

Example 2: Fulfill the shortcoming but cost of more time due to
restart of backup from fresh in the case of INSERT, ALTER, DROP &
UPDATE.I understand SELECT will not add time.

Addinitionally what happen if other process is not able to complete
operation within timeout duration?

2. "It cannot be used to copy data to or from in-memory databases."

I haven't got it full but I understand by CP I am able to copy any
file in Linux system.

3."If a power failure or operating system failure occurs while copying
the database file the backup database may be corrupted following
system recovery"

This is very useful benefit. What is the resulted outcome of power
failure or OS failure if we use backup API?



On 7/31/13, Simon Slavin <slav...@bigfraud.org> wrote:
>
> On 31 Jul 2013, at 12:56pm, techi eth <techi...@gmail.com> wrote:
>
>> I have followed below link for details. It say “If another thread or
>> process writes to the source database while this function is sleeping,
>> then
>> SQLite detects this and usually restarts the backup process when
>> sqlite3_backup_step() is next called”.
>>
>> - It means it will start back-up from start or resume from last left page
>> but making sure all update will be written in backup file.
>
> Every time a change is made the backup has to restart from the beginning
> again.  So if, for example, it would take 300 seconds to backup the entire
> file, the backup process will not complete until there has been a 300 second
> period when no changes were made to the file.
>
>> - Is their any issue if process acquiring database handle will do both
>> the
>> operation (Writing & Backup).
>
> No.  This is not a problem.  Though, of course, if anything does use that
> handle to write to the database the backup will be (automatically)
> restarted.
>
>> http://www.sqlite.org/backup.html
>
> Simon.
> ___
> 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] Query on database back-up:

2013-07-31 Thread techi eth
Hi,

Case:

“I copied first five pages from database using online backup api & during
sleep time other process write to database which is actually part of first
copied five pages, In that case at the end of backup can I assure I will
have my database backed up with latest changes. (Changes done during backup
as well)

As of now I am having database on Flash memory.

I have followed below link for details. It say “If another thread or
process writes to the source database while this function is sleeping, then
SQLite detects this and usually restarts the backup process when
sqlite3_backup_step() is next called”.

- It means it will start back-up from start or resume from last left page
but making sure all update will be written in backup file.

- Is their any issue if process acquiring database handle will do both the
operation (Writing & Backup).

http://www.sqlite.org/backup.html

Cheers

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


Re: [sqlite] Integrity Check Failure Handling

2013-07-29 Thread techi eth
Many Thanks for comment.

I shall agree with your view.

>Could be many rows in many tables were corrupted.  If SQLite3 knew exactly
what had >been corrupted it could just go and fix it without even needing
your help.

Here i am thinking of getting details about table & infected
row,SQLite3 doesn't need to fix them.Calling Application will understand &
do the required needful to change that part of database.
It might be helpful to get return data structure with infected row
in corresponding table.



On Mon, Jul 29, 2013 at 4:22 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 29 Jul 2013, at 10:21am, techi eth <techi...@gmail.com> wrote:
>
> > Reference from below link gave me hint about integrity check failure case
> > recovery by Export/Import of database.
> >
> > Please let me know is this is correct & way to handle integrity failure
> > check.
>
> This is not the correct way to handle integrity failure check.
>
> > http://blog.niklasottosson.com/?p=852
> >
> >
> http://community.spiceworks.com/how_to/show/1468-how-to-fix-corrupt-sqlite-database
>
> This process, if it works, will present you with a /usable/ database: one
> which won't cause SQLite to crash.  But the database
>
> A) may have incorrect data in it if some corruption affected only the
> contents of fields
> B) may have inconsistent data in it, e.g. an entry in your 'sales' table
> for a customer who is not in the 'customer' table
> C) may be missing all data added after the point of corruption, or worse
> still just /some/ of the data added after the point of corruption.
>
> It all depends on exactly which bytes of the file got corrupted.
>
> > In failure case integrity check return say “If any problems are found,
> then
> > strings are returned (as multiple rows with a single column per row)”
> >
> > With this how can I found in which table, row got issue?
>
> Could be many rows in many tables were corrupted.  If SQLite knew exactly
> what had been corrupted it could just go and fix it without even needing
> your help.
>
>
> This is not the correct way to handle integrity failure check.  The
> correct way to handle integrity failure check it to figure out what caused
> it (probably a hardware or low-level programming issue), try to make sure
> it doesn't happen again, then to restore the database file(s) from the last
> good backup you took.
>
> The method of rescue described on those pages /can/ be useful if you have
> a programmer who understands the data structure who has been told to spend
> hours desperately recovering all available data.  It might be useful to
> reassemble new data files which could be printed out, then inspected for
> useful information.  But I would not just recover datafiles that way and
> continue to use them in an operating system: you are running the risk of
> accumulating missing and incorrect data which will cause you problems later.
>
> Simon.
> ___
> 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] Integrity Check Failure Handling

2013-07-29 Thread techi eth
Reference from below link gave me hint about integrity check failure case
recovery by Export/Import of database.

Please let me know is this is correct & way to handle integrity failure
check.

http://blog.niklasottosson.com/?p=852

http://community.spiceworks.com/how_to/show/1468-how-to-fix-corrupt-sqlite-database


In failure case integrity check return say “If any problems are found, then
strings are returned (as multiple rows with a single column per row)”

With this how can I found in which table, row got issue?

Cheers-

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


Re: [sqlite] Access Permission on Table

2013-07-23 Thread techi eth
I am getting request from different process for different SQlite3 operation
to be performed. Here I want to restrict Update/Alter/Drop operation to
creator of the table but read can be done by all.

I am using sqlite3_exec() for query execution. In those scenarios can I
directly map set_authorization function.

Appreciate if I will get link to example.

Cheers-

Techi


On Mon, Jul 22, 2013 at 2:53 PM, Simon Davies
<simon.james.dav...@gmail.com>wrote:

> On 22 July 2013 10:02, techi eth <techi...@gmail.com> wrote:
> > Is their any statement I can build using SQLite3, which will provide me
> > access permission over table.
> >
> > Let us say I have 3 tables (table 1, table 2, table 3). Here I am looking
> > Read permission for one->many but Write can be done by creator of table
> > only. If other will try to access then they couldn't be able to do &
> error
> > will be thrown.
>
> Perhaps http://www.sqlite.org/c3ref/set_authorizer.html helps...
>
> >
> > Cheers-
> >
> > Techi
>
> Regards,
> Simon
> ___
> 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] Memory Access

2013-07-23 Thread techi eth
I would like to check how we can restrict SQLite3 for more
updating/dropping (I think this two will restrict flash life) based on
memory life.

If I say my flash will support ‘N’ Thousand access over the life time.

Cheers-

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


[sqlite] Access Permission on Table

2013-07-22 Thread techi eth
Is their any statement I can build using SQLite3, which will provide me
access permission over table.

Let us say I have 3 tables (table 1, table 2, table 3). Here I am looking
Read permission for one->many but Write can be done by creator of table
only. If other will try to access then they couldn't be able to do & error
will be thrown.

Cheers-

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


Re: [sqlite] Trigger Logic!!!

2013-07-22 Thread techi eth
Thanks for quick answer.

Yes,I understand i may no be able do inter process communication but
calling process can be register for call back (function register to
sqlite3_create_function())  on trigger & do whatever required .

Cheers-


On Mon, Jul 22, 2013 at 12:09 PM, RSmith <rsm...@rsweb.co.za> wrote:

> There is no way to contact an unknown thread that may or may not be
> running. This means that any thread you wish to speak to needs to be
> registered somehow in some list and have a means of "listening" to you,
> which in turn means SQLite (or indeed any other RDBMS) cannot simply notify
> one or more other applications of something.
>
> You will need to register some function with SQLite which you can call in
> a trigger (as Peter mentioned), but this function cannot be attached in a
> different thread, i.e. you cannot have the function call the registered
> code from one or more OTHER threads/applications than the one making the
> database connection, so you will need to make your own code in which, if
> the function gets called, it contains a mechanism for communicating it to
> another instance or instances of itself, or indeed any other apllication
> thread running in the OS which it somehow knows about and knows how to
> contact.
>
> Another option is to have a continuous interrogation of some data table
> which contains possible messages that one application may set and another
> may check until there is something to read, then read it and act
> accordingly.  The caveat here is that one thread's DB connection may not
> flush cached values for some time and it is IO intensive, depending on how
> fast polling you are doing and how deterministic you need it to be. This
> sort of communication (if it can be called that) is ok if you have a slow
> non-deterministic one-way notification need.
>
> Personally, I prefer using a named pipe or socket connection on a local
> machine/device to an application which serves the changed data. This is the
> purpose pipes/sockets exist for (as opposed to a file system), and it makes
> process visibility and debugging much easier. (Not to mention the enormous
> ease with which it can later be scaled up to a multi-tiered networked /
> internet system). The con here is that the serving application must be
> alive and running all the time for anyone else to know the current data
> state, although a last-known-state DB table can be pressed into service
> here should this be a real problem.
>
> RDBMSes should never be in charge of communications.
>
> Have a great day!
>
>
> PS: On Windows systems specifically you can also use the DDE service for
> inter-application communications, it's a cheap and nasty solution, not my
> favourite, but sometimes cheap and nasty is what is needed. Sockets work
> cross-platform mostly and does not require much of an application change if
> you do go multi-platform, just the socket layer itself adjusts.
>
>
>
> On 2013/07/22 07:32, techi eth wrote:
>
>> I want to create a trigger on INSERT & in trigger logic I want to notify
>> other running executable in system.
>>
>> Can I do this using trigger operation?
>>
>>   Example:
>>
>> Create table ();
>>
>> CREATE TABLE test (
>>
>> ID INT PRIMARY KEY NOT NULL,
>>
>> NAME TEXT NOT NULL,
>>
>> );
>>
>>
>>
>> CREATE TRIGGER Event_test1 AFTER INSERT
>>
>> ON test
>>
>> BEGIN
>>
>> 
>>
>> END;
>>
>>
>> Cheers
>>
>> Techi
>>
>>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<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] Trigger Logic!!!

2013-07-21 Thread techi eth
I want to create a trigger on INSERT & in trigger logic I want to notify
other running executable in system.

Can I do this using trigger operation?

 Example:

Create table ();

CREATE TABLE test (

ID INT PRIMARY KEY NOT NULL,

NAME TEXT NOT NULL,

);



CREATE TRIGGER Event_test1 AFTER INSERT

ON test

BEGIN



END;


Cheers

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


[sqlite] Integer data type

2013-07-19 Thread techi eth
Definition of integer data type will talk for signed integer. What about
unsigned integer ?Are they also be part of same data type.

*INTEGER*. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8
bytes depending on the magnitude of the value.
http://www.sqlite.org/datatype3.html

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


Re: [sqlite] SQLite3 : Corrupt/IO Error

2013-07-19 Thread techi eth
Thanks for answer.

I can do integrity check by PRAGMA integrity_check.Please correct me if i
wrong.
Here backup means copying database file OR we can create query to SQLite
for backup or copy.

Cheers-
Techi



On Wed, Jul 17, 2013 at 4:42 PM, Paolo Bolzoni <
paolo.bolzoni.br...@gmail.com> wrote:

> On Wed, Jul 17, 2013 at 12:55 PM, techi eth <techi...@gmail.com> wrote:
> > 2)  How do we make database safe from these error Or What is
> Possibility to
> > access database after error.
> After error, as Stephan said you are out of luck.
>
> You should avoid this errors in the first place:
> - make backup often,
> - keep the safety features of sqlite3 on,
> - use a error resilient filesystem (e.g., zfs),
> - use ecc memory.
> ___
> 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] SQLite3 : Corrupt/IO Error

2013-07-17 Thread techi eth
Hi,

I have question on SQLITE_CORRUPT, SQLITE_IOERR occur during database
access.

Question

1)  How to get generated this kind of error for testing.

2)  How do we make database safe from these error Or What is Possibility to
access database after error.

Cheers-

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


Re: [sqlite] Array Accessing in SQLite3

2013-07-14 Thread techi eth
I found so many Type name to be used while creating table for array
type.What is significance of size under bracket ?.What is differences among
all ?
http://www.sqlite.org/datatype3.html
---
CHARACTER(20)
VARCHAR(255)
VARYING CHARACTER(255)
NCHAR(55)
NATIVE CHARACTER(70)
NVARCHAR(100)
TEXT
---


Thanks


On Fri, Jul 12, 2013 at 1:07 PM, Hick Gunter <h...@scigames.at> wrote:

> Please read up on SQL, there are numerous tutorials available online.
>
> There is no "array" in SQL other than that a table may be considered as an
> array of records.
>
> Your example creates a table with two fields named 'test' and 'name' and
> with declared datatypes of '10' and '50' respectively.
>
> -----Ursprüngliche Nachricht-
> Von: techi eth [mailto:techi...@gmail.com]
> Gesendet: Freitag, 12. Juli 2013 09:13
> An: General Discussion of SQLite Database
> Betreff: [sqlite] Array Accessing in SQLite3
>
> I have query regarding accessing single & multidimensional array in
> SQLite3.
>
> Example:  I have created table with (test [10] INTEGER, name [50] TEXT).
>
> How do I pass a value to insert each element of array?
>
> How do I read back? (I am using callback function for read back)
>
>
> Please cover answer by considering multidimensional array case as well.
>
> Thanks--
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
> --
>  Gunter Hick
> Software Engineer
> Scientific Games International GmbH
> Klitschgasse 2 – 4, A - 1130 Vienna, Austria
> FN 157284 a, HG Wien
> Tel: +43 1 80100 0
> E-Mail: h...@scigames.at
>
> This e-mail is confidential and may well also be legally privileged. If
> you have received it in error, you are on notice as to its status and
> accordingly please notify us immediately by reply e-mail and then delete
> this message from your system. Please do not copy it or use it for any
> purposes, or disclose its contents to any person as to do so could be a
> breach of confidence. Thank you for your cooperation.
> ___
> 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] Array Accessing in SQLite3

2013-07-12 Thread techi eth
I have query regarding accessing single & multidimensional array in SQLite3.

Example:  I have created table with (test [10] INTEGER, name [50] TEXT).

How do I pass a value to insert each element of array?

How do I read back? (I am using callback function for read back)


Please cover answer by considering multidimensional array case as well.

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


Re: [sqlite] SQLite3 extended API usage

2013-07-08 Thread techi eth
Yes, sqlite3_get_table() function works!!!

Thanks.

Better to update documentation accordingly.

Cheers-
eth



On Mon, Jul 8, 2013 at 4:56 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 8 Jul 2013, at 9:21am, techi eth <techi...@gmail.com> wrote:
>
> > We arrive at same place were we start.I am using Sqlite3 version 3.7.9
> > & by refrence from below link i can use to get tabel function but i am
> > getting undefined refrence error.
>
> Does your sqlite3_open_v2() call work ?
>
> Does it return SQLITE_OK ?
>
> Are you correctly passing the db handle it returns to your other SQLite
> calls ?
>
> > http://www.sqlite.org/c3ref/free_table.html
> >
> > Is API still available with 3.7.9 version ? Or i want to use than what
> > is the way ?
>
> The c3ref pages are the correct documentation for all 3.x.x versions so
> you are reading the right pages !  However, this routine is marked as
> 'legacy' which means it’s old and there are better ways to do things now.
>  I don’t know why it’s not working for you but since you are writing new
> code now I suggest you use the sqlite3_exec() interface instead.  That’s
> the simplest way to do a query.
>
> <http://www.sqlite.org/c3ref/exec.html>
>
> here is an example of code which calls _exec():
>
> <http://www.sqlite.org/quickstart.html>
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite3 extended API usage

2013-07-08 Thread techi eth
We arrive at same place were we start.I am using Sqlite3 version 3.7.9
& by refrence from below link i can use to get tabel function but i am
getting undefined refrence error.
http://www.sqlite.org/c3ref/free_table.html

Is API still available with 3.7.9 version ? Or i want to use than what
is the way ?

Thanks


On 7/8/13, Simon Slavin  wrote:
>
> On 8 Jul 2013, at 8:54am, Kees Nuyt  wrote:
>
>> On Mon, 8 Jul 2013 06:43:33 +0100, Simon Slavin 
>> wrote:
>>
>>> There is no call 'sqlite_get_table()' in SQLite version 3.
>>> Nor is there anything like it.
>>> The closest thing is 'sqlite3_exec()'.
>>
>> Not completely true. The C API documentation mentions a legacy
>> interface: sqlite3_get_table().
>> http://www.sqlite.org/c3ref/free_table.html
>
> Oh wow.  Thanks.  I especially like the triple-starred parameter.
>
> Simon.
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite3 extended API usage

2013-07-07 Thread techi eth
Thanks.

I am using SQLite3 version : 3.7.9.

Do i need to configure with some option to get linkage problem get resolved.





On Sat, Jul 6, 2013 at 1:34 PM, Luuk <luu...@gmail.com> wrote:

> On 06-07-2013 09:50, techi eth wrote:
>
>> Hi,When i try to use extended API like sqlite_get_table(), i am getting
>>
>> undefined reference to function.
>> How do i get it resolve ? I am following below link for API reference.
>> http://www.sqlite.org/c_**interface.html<http://www.sqlite.org/c_interface.html>
>>
>>
>>
> That link leads to:
> The C language interface to SQLite Version 2
>
> Maybe you should use:
> C/C++ Interface For SQLite Version 3
> (http://www.sqlite.org/**capi3ref.html<http://www.sqlite.org/capi3ref.html>
> )
>
> __**_
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-**bin/mailman/listinfo/sqlite-**users<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] SQLite3 extended API usage

2013-07-06 Thread techi eth
Hi,When i try to use extended API like sqlite_get_table(), i am getting
undefined reference to function.
How do i get it resolve ? I am following below link for API reference.
http://www.sqlite.org/c_interface.html


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


[sqlite] Sqlite3 Affinity

2013-07-02 Thread techi eth
Few Query :
1) Is their any function or Method to get Affinity type associated
with colum.
2) I understand Integer,Text & Float could satisfy all data
type requirement.In that case where i can use blob Or Numeric type.

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