Re: [sqlite] newbie question

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

Listman wrote:
> anyone see a problem with us piggy backing on the svn sqlite  
> client install?

You should be asking the Subversion folks. I'd assume they would want
you to ensure your tables have their own namespace prefix.  You will
also want to find out if they ever wipe the database.  Finally make sure
your code doesn't leave open transactions for long periods of time as
SQLite can only have one transaction open for writing at a time,
blocking/queuing others wanting to write.

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

iD8DBQFI9C1emOOfHg372QQRAqI/AKDQy/vYYBGrIYHZYNuCH6SauBCbMQCgyOP6
aAq+aGisFbGOiLI3VNIeYG4=
=Igho
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLITE_STATIC and bind*()

2008-10-13 Thread Sherief N. Farouk
> > Sqlite3_bind_text(Statement, S.c_str(), S.size() + 1,
> > SQLITE_[TRANSIENT | STATIC?]);
> 
> Drop +1. It's unlikely that you actually want terminating NUL to be
> part
> of the string in the database.
> 

Sorry, mixed that one with the nByte parameter of prepare_v2. It's "-1" in
code though, so my program shouldn't exhibit a problem. I wrote the snippet
in this email on the fly :).

> > Is SQLITE_STATIC suitable for this situation?
> 
> Yes, as long as "use statement" part involves calling sqlite3_reset or
> sqlite3_finalize on Statement.

So no accesses happen after a finalize or reset, perfect :).

Thanks a lot for the help.

- Sherief

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


Re: [sqlite] SQLITE_STATIC and bind*()

2008-10-13 Thread Igor Tandetnik
"Sherief N. Farouk" <[EMAIL PROTECTED]>
wrote in message news:[EMAIL PROTECTED]
> Does the bind text family attempt to access the data pointed to by the
> passed parameter after the lifetime of the function call?

Yes, unless you pass SQLITE_TRANSIENT flag.

> Sqlite3_bind_text(Statement, S.c_str(), S.size() + 1,
> SQLITE_[TRANSIENT | STATIC?]);

Drop +1. It's unlikely that you actually want terminating NUL to be part 
of the string in the database.

> //use statement
>
> }
>
> Is SQLITE_STATIC suitable for this situation?

Yes, as long as "use statement" part involves calling sqlite3_reset or 
sqlite3_finalize on Statement.

Igor Tandetnik 



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


[sqlite] newbie question

2008-10-13 Thread Listman

hi, the SCM tool Subversion is going to start using sqlite in the  
upcoming 1.6 release to manage client metadata. would it be possible  
for us to also that sqlite install as part of some custom code we  
write around subversion? we'd like to be able to cache the list of  
managed object in the working copy with sqlite rather than require an  
"svn ls" or "svn info" every time we want to interact with that  
object. anyone see a problem with us piggy backing on the svn sqlite  
client install?

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


[sqlite] SQLITE_STATIC and bind*()

2008-10-13 Thread Sherief N. Farouk
Does the bind text family attempt to access the data pointed to by the
passed parameter after the lifetime of the function call? I have a situation
similar to the following:

 

Std::string S("Blah");
foo(S);

Rest_of_program();

 

Where foo() is:

 

Void foo(string& S)

{

//prepare a statement

Sqlite3_bind_text(Statement, S.c_str(), S.size() + 1, SQLITE_[TRANSIENT |
STATIC?]);

//use statement

}

Is SQLITE_STATIC suitable for this situation? The string S is guaranteed to
be "alive" until foo returns, but not afterwards. If S was terminated after
the call to foo(), is my program well formed or do I need to use
SQLITE_TRANSIENT?

 

-  Sherief

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


Re: [sqlite] Joining 2 views

2008-10-13 Thread Guenther Schmidt
Hi P,

well I tried to put all the business logic out of my program and into 
views. Basically all my program does is feed data into tables that are 
created for dynamic data and are cleaned before each import.

Once the import is finished my app then selects from those views.

Those views use each other and for as long they do not join each other 
everything is fine.

I did not want to use Temp tables because AFAIK I need to create and 
drop them programmitcally and that means that I have to put part of the 
business logic back into my app, which I had hoped to avoid.

Before using sqlite I had used Access for that, which seems so index 
even views, but at some point access threw unexpected errors when I then 
tried to access those views of views via odbc, why I don't now but 
that's when I switched to sqlite and this problem came up.

Best regards

Guenther

P Kishor schrieb:
> On 10/13/08, Guenther Schmidt <[EMAIL PROTECTED]> wrote:
>   
>>  Hi P,
>>
>>  thanks, I had considered that.
>>
>>  Hope there is another solution though.
>> 
>
> possibly, but how about enlightening others as to why you considered
> creating temp tables and then decided not to do so?
>
> In fact, how about explaining in an email all the things that you have
> considered, tried and rejected so others may learn from it?
>
>
>   
>>  Günther
>>
>>  P Kishor schrieb:
>>  On 10/13/08, Guenther Schmidt <[EMAIL PROTECTED]> wrote:
>>
>>
>>  Hi,
>>
>>  unfortunately I've hit a point where I run a query where one VIEW joins
>>  another VIEW.
>>
>>  Both views are rather large and since there is no index on the fields
>>  where they join the query takes very very long. (About 15 min).
>>
>>  Does anybody here know a solution to this problem?
>>
>>  create temporary tables with the views, possibly index these temp
>> tables, then query that table.
>>
>>
>>
>>  Best regards
>>
>>  Günther
>>
>>  ___
>>  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] Joining 2 views

2008-10-13 Thread P Kishor
On 10/13/08, Guenther Schmidt <[EMAIL PROTECTED]> wrote:
>
>  Hi P,
>
>  thanks, I had considered that.
>
>  Hope there is another solution though.

possibly, but how about enlightening others as to why you considered
creating temp tables and then decided not to do so?

In fact, how about explaining in an email all the things that you have
considered, tried and rejected so others may learn from it?


>
>  Günther
>
>  P Kishor schrieb:
>  On 10/13/08, Guenther Schmidt <[EMAIL PROTECTED]> wrote:
>
>
>  Hi,
>
>  unfortunately I've hit a point where I run a query where one VIEW joins
>  another VIEW.
>
>  Both views are rather large and since there is no index on the fields
>  where they join the query takes very very long. (About 15 min).
>
>  Does anybody here know a solution to this problem?
>
>  create temporary tables with the views, possibly index these temp
> tables, then query that table.
>
>
>
>  Best regards
>
>  Günther
>
>  ___
>  sqlite-users mailing list
>  sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>
>
>
>
>


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Joining 2 views

2008-10-13 Thread Guenther Schmidt
Hi P,

thanks, I had considered that.

Hope there is another solution though.

Günther

P Kishor schrieb:
> On 10/13/08, Guenther Schmidt <[EMAIL PROTECTED]> wrote:
>   
>> Hi,
>>
>>  unfortunately I've hit a point where I run a query where one VIEW joins
>>  another VIEW.
>>
>>  Both views are rather large and since there is no index on the fields
>>  where they join the query takes very very long. (About 15 min).
>>
>>  Does anybody here know a solution to this problem?
>> 
>
> create temporary tables with the views, possibly index these temp
> tables, then query that table.
>
>   
>>  Best regards
>>
>>  Günther
>>
>>  ___
>>  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] Joining 2 views

2008-10-13 Thread P Kishor
On 10/13/08, Guenther Schmidt <[EMAIL PROTECTED]> wrote:
> Hi,
>
>  unfortunately I've hit a point where I run a query where one VIEW joins
>  another VIEW.
>
>  Both views are rather large and since there is no index on the fields
>  where they join the query takes very very long. (About 15 min).
>
>  Does anybody here know a solution to this problem?

create temporary tables with the views, possibly index these temp
tables, then query that table.

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


-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Institute for Environmental Studies http://www.nelson.wisc.edu/
Open Source Geospatial Foundation (OSGeo) http://www.osgeo.org/
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Joining 2 views

2008-10-13 Thread Guenther Schmidt
Hi,

unfortunately I've hit a point where I run a query where one VIEW joins 
another VIEW.

Both views are rather large and since there is no index on the fields 
where they join the query takes very very long. (About 15 min).

Does anybody here know a solution to this problem?

Best regards

Günther

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


Re: [sqlite] sqlite3_open() problem

2008-10-13 Thread Leandro dos Santos Ribeiro
Leandro dos Santos Ribeiro wrote:
> D. Richard Hipp wrote:
>   
>> On Oct 10, 2008, at 4:59 PM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED] 
>>  > wrote:
>>
>>   
>> 
>>> Hello Team.
>>>
>>> I have a problem with running SQLite.
>>> I am running linux 2.6.17 on *ARM* and basically problem is that my
>>> application
>>> is crushing on *sqlite3_open*()  function while the sqlite3 command
>>> shell is
>>> running without problems.
>>> 
>>>   
>> The command-line shell uses sqlite3_open() too.  So if it works there,  
>> I do not understand why it is not working in your program.  Have you  
>> run your program in a debugger to see exactly where it is crashing?
>>
>>
>>
>> D. Richard Hipp
>> [EMAIL PROTECTED]
>>
>>
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>>   
>> 
> Hello D. Richard Hipp,
>
> Yes, I did run the program in a debugger and it is crashing when the 
> program tries to execute the sqlite3_open() function.
> It seems that I'm not the only one with that problem, but I didn't find 
> the answer yet.
> Thanks .
>
>  
>  Best regards.
>  
>   Leandro S. Ribeiro
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   
Hello everybody,

I found the problem with the sqlite3_open() crashing.
To solve it I just added the libs  libpthread and libdl to my project.
Thanks to all.

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


Re: [sqlite] Intermittent SQLITE_CANTOPEN on Windows

2008-10-13 Thread Mihai Limbasan

Stephen Oberholtzer wrote:

On Mon, Oct 13, 2008 at 12:52 PM, Doug <[EMAIL PROTECTED]> wrote:

  

I'm using SQLite 3.5.6 on Windows and intermittently get SQLITE_CANTOPEN
when doing an insert.  When that fails, I can use the debugger to go back
up
and step through the same lines again (using the same database handle -
nothing opened or closed in between) and it will work.





We see this a lot when people have an antivirus that autoscans files after
they've been modified.  Is that possibly the case?

  
System Restore also tends to interfere a lot when one chooses filenames 
with extensions that are monitored by that service (especially .sdb 
which is very tempting when using SQLite, but is the extension used by 
the shim engine.) Here is a list of extensions to avoid: 
http://msdn.microsoft.com/en-us/library/aa378870.aspx.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Intermittent SQLITE_CANTOPEN on Windows

2008-10-13 Thread Stephen Oberholtzer
On Mon, Oct 13, 2008 at 12:52 PM, Doug <[EMAIL PROTECTED]> wrote:

> I'm using SQLite 3.5.6 on Windows and intermittently get SQLITE_CANTOPEN
> when doing an insert.  When that fails, I can use the debugger to go back
> up
> and step through the same lines again (using the same database handle -
> nothing opened or closed in between) and it will work.
>


We see this a lot when people have an antivirus that autoscans files after
they've been modified.  Is that possibly the case?

-- 
-- Stevie-O
Real programmers use COPY CON PROGRAM.EXE
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Intermittent SQLITE_CANTOPEN on Windows

2008-10-13 Thread Doug
I'm using SQLite 3.5.6 on Windows and intermittently get SQLITE_CANTOPEN
when doing an insert.  When that fails, I can use the debugger to go back up
and step through the same lines again (using the same database handle -
nothing opened or closed in between) and it will work.

I am using sqlite3_bind_blob with the following: INSERT OR REPLACE INTO
BlobTable (BlobKey, BlobVal) Values ('exampleKey', ?)
in case that makes any difference (the SQLITE_CANTOPEN code is returned from
sqlite3_step).

I doubt this has anything to do with SQLite as it's been working perfectly
for years, but I also can't figure out what has changed on my system such
that this would be happening now.

Thanks in advance for any ideas.

Doug



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


Re: [sqlite] sqlite3_open() problem

2008-10-13 Thread Leandro dos Santos Ribeiro
D. Richard Hipp wrote:
> On Oct 10, 2008, at 4:59 PM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED] 
>  > wrote:
>
>   
>> Hello Team.
>>
>> I have a problem with running SQLite.
>> I am running linux 2.6.17 on *ARM* and basically problem is that my
>> application
>> is crushing on *sqlite3_open*()  function while the sqlite3 command
>> shell is
>> running without problems.
>> 
>
> The command-line shell uses sqlite3_open() too.  So if it works there,  
> I do not understand why it is not working in your program.  Have you  
> run your program in a debugger to see exactly where it is crashing?
>
>
>
> D. Richard Hipp
> [EMAIL PROTECTED]
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
>   
Hello D. Richard Hipp,

Yes, I did run the program in a debugger and it is crashing when the 
program tries to execute the sqlite3_open() function.
It seems that I'm not the only one with that problem, but I didn't find 
the answer yet.
Thanks .

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


[sqlite] Testing for existence of extension

2008-10-13 Thread Christoph Burgmer
Hi,

I am a happy user of FTS3 and want to rely on this functionality in my program 
which hopefully will be used on a variety of systems. Now I found out that it 
wouldn't even run on a up to date Ubuntu, at least two bug reports are 
pending.
Now that FTS3 will only be optionally available, which is fine for me, I would 
like to gracefully degrade when the extension is not found. Just how to find 
out about it?
As I read, it can either be compiled in, or plugged into the system, the 
second solution obviously requesting my system to take care of this as I 
understand. How can I find out if and how it is available to me?
I checked both website (and wiki) and mailing list, but can't find help on 
checking for the existence of a plugin, nor about compiled-in options.

Help appreciated,

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


Re: [sqlite] from access to sqlite

2008-10-13 Thread Olaf Schmidt

"Fabio Stranieri" <[EMAIL PROTECTED]>
schrieb im Newsbeitrag
news:[EMAIL PROTECTED]

> "'11/10/2008 00:00:00'"
As I see it, there's no need, to hardcode your
Dates this way.
You can use an appropriate Format-String to
retrieve that directly from VB-DateVariables:

Format(now,"'dd\/mm\/ hh:mm:ss'")

> That said, i have solved my problem, but i'm like to
> understand why it no work with datetime format.
It has solved your problem, because you imported the
dates as text - and as I see it, the Date-String-Format
you currently use is not really sortable or "comparable"
as other Date-String-Formats, which normally need
to begin with the year, followed by the month and day.
Your current order is days, months, year inside your
imported date-strings and that will cause problems
with sorting, has "internationalization-issues" etc.

So I'd strongly recommend, that you either change
your self-defined Text-Date-imports to a "standard
SQL-String-date" (starting with the year) or that you
try to make it work with your original wrapper-providers
datetime-format.

Please ask their tec-support or read their docu on date-
columns/date-imports from MS-DBs.

And regarding your problems with STRFTIME -
this is not a VB-Function - you would have to
place it as Text in your Query-String.

Olaf




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


Re: [sqlite] from access to sqlite

2008-10-13 Thread Olaf Schmidt

"Toby Bascom" <[EMAIL PROTECTED]>
schrieb im Newsbeitrag news:[EMAIL PROTECTED]

> Olaf is, in a word, a genius!
Heh, don't make me blush here, especially in this group,
where the real DB-experts hang around...
Without the sqlite-engine my wrapper wouldn't exist.

I'd suggest the groups on the public MS-NewsServer
(msnews.microsoft.com) for all these questions which
target more the VB-(respective the COM-wrapper-)
side of SQLite:
microsoft.public.vb.database
microsoft.public.vb.database.ado
or even
microsoft.public.vb.general.discussion

> Try adding single quotation marks around the 2 date variables:
That's already ensured in the Format-String.
Format(VBDateVariable, "'-mm-dd hh:nn:ss'")

> dhRichClient = End of 20MB ADO desktop installations!!
Thanks, but as said - without that great engine under
the hood, it wouldn't have been possible.

Olaf



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