Re: [sqlite] Hard time with blobs

2008-07-24 Thread Sherief N. Farouk
I'm having a problem with the last parameter, the function used to dispose
of the blob. Does sqlite defer actually inserting the blob into the database
somehow? In other words, will I get into trouble if I do:

Sqlite3_bind_blob(Statement, 1, BlobData, BlobSize, do_nothing);
Delete [] BlobData;

?

- Sherief

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:sqlite-users-
> [EMAIL PROTECTED] On Behalf Of Dan
> Sent: Friday, July 25, 2008 12:51 AM
> To: General Discussion of SQLite Database
> Subject: Re: [sqlite] Hard time with blobs
> 
> 
> On Jul 25, 2008, at 10:35 AM, Sherief N. Farouk wrote:
> 
> > I want to use blobs to store binary objects in the database, but
> > I'm having
> > a hard time understanding how they work. First of all, I don't see
> > a way to
> > set a blob's size, and sqlite3_blob_write doesn't increase the size
> > of the
> > blob, which is putting me in a weird catch-22 situation.
> >
> > What's the best solution for storing a bunch of binary objects,
> > given the
> > two alternatives: They may be immutable (write once, read many), or
> > mutable
> > (write many, possibly overwriting regions or appending, write many)?
> 
> You can work with blobs without using the sqlite3_blob_XXX() APIs.
> Insert
> blobs by binding them with sqlite3_bind_blob(), retrieve them using
> sqlite3_column_blob().
> 
> Sometimes it is better to use the sqlite3_blob_XXX() APIs because they
> allow sqlite to work with large blobs without creating a copy of the
> blob in memory. To create a large zeroed blob in the database, use
> either sqlite3_bind_zeroblob() or the "zeroblob" SQL function. Then
> populate it using sqlite3_blob_XXX() after it has been inserted.
> 
> Dan.
> 
> ___
> 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] Hard time with blobs

2008-07-24 Thread Dan

On Jul 25, 2008, at 10:35 AM, Sherief N. Farouk wrote:

> I want to use blobs to store binary objects in the database, but  
> I'm having
> a hard time understanding how they work. First of all, I don't see  
> a way to
> set a blob's size, and sqlite3_blob_write doesn't increase the size  
> of the
> blob, which is putting me in a weird catch-22 situation.
>
> What's the best solution for storing a bunch of binary objects,  
> given the
> two alternatives: They may be immutable (write once, read many), or  
> mutable
> (write many, possibly overwriting regions or appending, write many)?

You can work with blobs without using the sqlite3_blob_XXX() APIs.  
Insert
blobs by binding them with sqlite3_bind_blob(), retrieve them using
sqlite3_column_blob().

Sometimes it is better to use the sqlite3_blob_XXX() APIs because they
allow sqlite to work with large blobs without creating a copy of the
blob in memory. To create a large zeroed blob in the database, use
either sqlite3_bind_zeroblob() or the "zeroblob" SQL function. Then
populate it using sqlite3_blob_XXX() after it has been inserted.

Dan.

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


Re: [sqlite] error:unable to open database file

2008-07-24 Thread kriscbe

hi all,

solved it.previously for every 1 second in my code DB file 26 times opened
and 26 times colses.
so after particular no of time the DB file unable to reopen that file.
for that i used a singleton pattern thats why DB file open only once in my
entire code.
because of that it works fine.

thanks Dennis for u r reply.(now i learn about file permissions in sqlite)

thanks,
kris cbe





kriscbe wrote:
> 
> i tried with 3 options in that pragma temp_store(0,1,2).
> but same problem occured.
> now that time increased for every 40 secs.
> 
> thanks
> 
> kris cbe
> 
> 
> 
> Dennis Cote wrote:
>> 
>> kriscbe wrote:
>>> 
>>> i am getting new problem while executing my sqlite3 using c++ after some
>>> no
>>> of operations on db file 
>>> i t gives error "unable to open database file"
>>> 
>> 
>> This is probably another case of a misleading error message. SQLite may 
>> be trying to open a temporary file, not your database file. You can 
>> check the temp store settings with a couple of pragma commands.
>> 
>>pragma temp_store;
>>pragam temp_store_directory;
>> 
>> See http://www.sqlite.org/pragma.html#modify for details about these 
>> pragma commands.
>> 
>> SQLite needs to have permission to create files in that directory.
>> 
>> HTH
>> Dennis Cote
>> 
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/error%3Aunable-to-open-database-file-tp18608770p18644858.html
Sent from the SQLite mailing list archive at Nabble.com.

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


[sqlite] Hard time with blobs

2008-07-24 Thread Sherief N. Farouk
I want to use blobs to store binary objects in the database, but I'm having
a hard time understanding how they work. First of all, I don't see a way to
set a blob's size, and sqlite3_blob_write doesn't increase the size of the
blob, which is putting me in a weird catch-22 situation.

What's the best solution for storing a bunch of binary objects, given the
two alternatives: They may be immutable (write once, read many), or mutable
(write many, possibly overwriting regions or appending, write many)?

- Sherief

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


Re: [sqlite] Loading from Read Only storage and saving changes to aseparate storage unit

2008-07-24 Thread Griggs, Donald
 Hi, Daniel,

Regarding:
"Another morning another question, what sort of facilities does
SQLite provide for Loading from a read only storage location and then
saving changes to a separate read/write storage unit?  I know I can open
a database file with a read only flag but how would I go about managing
the changes to that database and storing them to a separate storage
device?  All I could think of is creating a separate read/write database
on the read/write storage but short of duplicating tables between the
two databases I can't think of a simple mechanism for organising the two
tables so only the changes to the original read only table are stored
out into the read/write table with out adding allot of data management
logic on the code side."

"I'd imagine there is some mechanism for dealing with this kind of
storage layout if SQLite is used in embedded systems as the sort of
storage arrangement I'm describing is fairly common but I'm unsure as to
the terms to search in the documentation for as every product seems to
use different terms for that sort of facility.  Any help or pointers to
the correct bit of documentation to look at would be most appreciated!"
=
 
I may not be understanding your questions well, but as to:
"...without adding a lot of data management logic on the code side."

SQLite's goal (I believe) was to deliver a very small, lightweight SQL
engine implenting most of the SQL-92 standard.  From that viewpoint,
tasks such as:

  -- synchronizing two databases or 
  -- presenting a unified view of a datastore split between a read-only
database and a read-write one

fall squarely outside of the sqlite library.  Of course, someone on this
list may possibly have written such code and may be willing to share
tome tips, though I don't personally recall any discussion on a
read-only / read-write split.

Sqlite *does* implement a very useful ATTACH command so that you can
work on multiple sqlite databases, though.

If you *do* develop a code layer you think would be generally useful,
you may want to share it in the CONTRIBUTIONS section of the website.

Best of luck,
   Donald Griggs


This email and any attachments have been scanned for known viruses using 
multiple scanners. We believe that this email and any attachments are virus 
free, however the recipient must take full responsibility for virus checking. 
This email message is intended for the named recipient only. It may be 
privileged and/or confidential. If you are not the named recipient of this 
email please notify us immediately and do not copy it or use it for any 
purpose, nor disclose its contents to any other person.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Does sqlite support stored procedure?

2008-07-24 Thread BareFeet
Hi John,

> I would like to know if SQLite supports stored procedures.

Technically, no it doesn't.

For what purpose do you want to store procedures?

You can store some procedures in triggers, if you want to have SQLite  
trigger a task when some data is changed.

You can simply create a "Procedures" table like this:

create table "Procedures" (Name, SQL);

and populate it with SQL procedures. You can call those procedures  
later from within your program and sqlite3 command line and execute  
them.

Tom
BareFeet

  --
Comparison of SQLite GUI applications:
http://www.tandb.com.au/sqlite/compare/

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


Re: [sqlite] Does sqlite support stored procedure?

2008-07-24 Thread Griggs, Donald
Hi, John,

Regarding: "I would like to know if SQLite supports stored procedures.
This should be a simple question, but I did not find a clear answer on
the SQLite website."

In a word -- no, it does not.

HOWEVER, it DOES:
  -- support a TRIGGER feature, with limitations.
  -- allow the creation of  user functions in the calling language,
which can then be invoked much like a stored procedure.

See also:  
  http://www.sqlite.org/omitted.html
  http://www.sqlite.org/lang_createtrigger.html

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of John Zhang


This email and any attachments have been scanned for known viruses using 
multiple scanners. We believe that this email and any attachments are virus 
free, however the recipient must take full responsibility for virus checking. 
This email message is intended for the named recipient only. It may be 
privileged and/or confidential. If you are not the named recipient of this 
email please notify us immediately and do not copy it or use it for any 
purpose, nor disclose its contents to any other person.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Ignoring "The"

2008-07-24 Thread Stephen Oberholtzer
On Wed, Jul 23, 2008 at 9:11 AM, Andrew Gatt <[EMAIL PROTECTED]> wrote:

> I have a table of music artist names which i'd like to output in order.
> Normally i just use:
>
> select * from artists order by artist_name;
>
> What i'd really like to do is order the artists by name but ignore any
> "the" or "the," preceding it.
>

iTunes and iPods solve this problem by having two of each field: Title /
Sort Title, Artist / Sort Artist, Album / Sort Album.  The "Sort" versions
are populated by stripping things like "The" and whatnot.   You can keep
them in sync with triggers, or application logic, or whatever.



-- 
-- 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


Re: [sqlite] Corrupted database repairing

2008-07-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Alexey Pechnikov wrote:
> Is any way to repair corrupted database? 

- From a theoretical point of view the only way to repair a corrupted
database is if there are multiple redundant copies of data or of
generating that data.  Since SQLite doesn't do that (exception: indices
can be regenerated from uncorrupted data) you are mainly out of luck.
Instead SQLite takes the approach of trying to prevent corruption in the
first place.

You can address this problem yourself.  Write your own custom VFS layer
where you can store multiple redundant copies, checksums or whatever
else you are trying to defend against.  You can also use it to verify
that SQLite handles situations well, in addition to your own code.  (For
example make a write routine emulate disk full).  [BTW the SQLite test
suite is full of tests like this anyway]

It is also worth noting that unless you are running on mainframes or
"server" hardware, other corruption will be ignored.  For example
commodity machines don't have error checking or correcting RAM, checking
CPUs, checking hard disk controllers.  The good news is that it is
slowly coming such as end to end checksums in ZFS, checksums in the SATA
spec etc.

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

iD8DBQFIiRLmmOOfHg372QQRAvh+AKCfOBIFCNDFt+3pPjR0dMAm+nMcggCgwrkb
Z3HWu8qk90LKDD5rgVO9kZs=
=ikGn
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Does sqlite support stored procedure?

2008-07-24 Thread John Zhang
I would like to know if SQLite supports stored procedures.  This should be a 
simple question, but I did not find a clear answer on the SQLite website.

Thanks,
John



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


Re: [sqlite] Corrupted database repairing

2008-07-24 Thread Alexey Pechnikov
В сообщении от Thursday 24 July 2008 20:48:08 Alexey Pechnikov написал(а):
> Hello!
>
> Is any way to repair corrupted database? May be I have archive copy of
> database and corrupted this pages - can I get correct pages and merge their
> with archive database?
>
> P.S. I have no corrupted database now but this question is important for
> me.

If page allocation data is correct than exists chance to repair non-corrupted 
pages. But how do it? And can I disable database schema reading and get 
access to non-corrupted pages?

Can I manually set database schema (may be in memory only for current session) 
for get access to tables?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Loading from Read Only storage and saving changes to a separate storage unit

2008-07-24 Thread Brown, Daniel
Morning List,

Another morning another question, what sort of facilities does SQLite
provide for Loading from a read only storage location and then saving
changes to a separate read/write storage unit?  I know I can open a
database file with a read only flag but how would I go about managing
the changes to that database and storing them to a separate storage
device?  All I could think of is creating a separate read/write database
on the read/write storage but short of duplicating tables between the
two databases I can't think of a simple mechanism for organising the two
tables so only the changes to the original read only table are stored
out into the read/write table with out adding allot of data management
logic on the code side.

I'd imagine there is some mechanism for dealing with this kind of
storage layout if SQLite is used in embedded systems as the sort of
storage arrangement I'm describing is fairly common but I'm unsure as to
the terms to search in the documentation for as every product seems to
use different terms for that sort of facility.  Any help or pointers to
the correct bit of documentation to look at would be most appreciated!

Cheers,

Daniel Brown 
"The best laid schemes o' mice an' men, gang aft agley"


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


[sqlite] Corrupted database repairing

2008-07-24 Thread Alexey Pechnikov
Hello!

Is any way to repair corrupted database? May be I have archive copy of 
database and corrupted this pages - can I get correct pages and merge their 
with archive database?

P.S. I have no corrupted database now but this question is important for me.

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


[sqlite] Trigger (on delete)

2008-07-24 Thread Juzbrig

I want to make simple trigger.
I have table 'genre' and 'artist', 'artist' have foreign key 'genre_id'
which is the primary key in 'genre' table
I want the trigger to delete artist wchich have the same foreign key as the
deleted genre for example: 
"delete from artist where genre_id = '10'" is triggered when "delete from
genre where genre_id = '10'" is call.

here is the form to fill :

CREATE TRIGGER delete_artist
  BEFORE DELETE
  ON genre
BEGIN
  /* Insert trigger body here */
  
  
END;
-- 
View this message in context: 
http://www.nabble.com/Trigger-%28on-delete%29-tp18632270p18632270.html
Sent from the SQLite mailing list archive at Nabble.com.

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


Re: [sqlite] Trigger (on delete)

2008-07-24 Thread Igor Tandetnik
Juzbrig <[EMAIL PROTECTED]> wrote:
> I want to make simple trigger.
> I have table 'genre' and 'artist', 'artist' have foreign key
> 'genre_id' which is the primary key in 'genre' table
> I want the trigger to delete artist wchich have the same foreign key
> as the deleted genre for example:
> "delete from artist where genre_id = '10'" is triggered when "delete
> from genre where genre_id = '10'" is call.
>
> here is the form to fill :
>
> CREATE TRIGGER delete_artist
>  BEFORE DELETE
>  ON genre
> BEGIN
>  /* Insert trigger body here */
>
>
> END;

BEGIN
delete from artist where genre_id=old.genre_id;
END;

Igor Tandetnik 



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


Re: [sqlite] Overall question about transactions

2008-07-24 Thread Igor Tandetnik
Enrique Ramirez
<[EMAIL PROTECTED]> wrote:
> I've been working on DBMS systems for a couple of years now (namely
> MS-SQL and MySQL) and I find SQLite's usage of transactions to be
> quite unique and interesting. I've been reading on different websites
> about them and one particular site (which sadly I can't remember)
> confused me a bit. They were recommending that transactions be used
> even on select statements if they were consecutive.

There's nothing specific to SQLite there, the same is true for any DBMS. 
But not just when two statemetns are consecutive - when you want two 
consecutive statements to return consistent results. E.g if you run 
"select count(*) from myTable" twice in a row outside a transaction, you 
may get different results. If you run the two within a single 
transaction, you are guaranteed the same result. Sometimes the 
consistency between two selects is important.

> My questions are then,
> 1) is this correct?

That transactions are only ever useful when making changes? No, this is 
incorrect. They are also useful for preventing somebody else from making 
changes while you are in the middle of reading.

> 2) if no changes are being made to the database, what is being
> commited?

Nothing. Why do you believe something necessarily must be?

 3) is the 'optimization' coming from preventing SQLite from
> generating a new transaction for each query?

What 'optimization'?

> And an off-topic question if I may, is there a way to browse through
> archives of older mailings?

http://www.mail-archive.com/sqlite-users@sqlite.org
http://news.gmane.org/gmane.comp.db.sqlite.general
http://www.nabble.com/SQLite-f797.html

Igor Tandetnik



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


Re: [sqlite] problem building reduced-size sqlite

2008-07-24 Thread Shane Harrelson
Dennis-

I'm not able to duplicate this here, and it apparently worked for the OP.
What OS and shell are you running configure in?  Can you check for stray
/r/n line endings in the configure script.  That can sometimes confuse the
shell, and I may have left a one in.

I can't comment on the suggested lemon changes (--help support and usage
updates) -- perhaps open a ticket and see what DRH says.

-Shane


On 7/23/08, Dennis Cote <[EMAIL PROTECTED]> wrote:
>
> Shane Harrelson wrote:
> > I checked in some updates to the "configure" support that will hopefully
> do
> > the right thing and pass any OMIT options to lemon and mkkeywordhash.
> > There was also a minor fix to handle SQLITE_OMIT_VIEW being defined while
> > SQLITE_OMIT_SUBQUERY is undefined in select.c (something you probably
> rand
> > into with your example.)  Also note that in your example, -DTEMP_STORE=2
> > should probably be replaced with some variation of the --enable-tempstore
> > configure option.
> >
>
> Shane,
>
> I just looked at your changes, and it seems to me the format of the
> options being passed to lemon is incorrect.
>
> The lemon program take options of the form D=SQLITE_OMIT* as shown in
> the usage information.
>
> $ ./lemon --help
> Command line syntax error: undefined option.
> c:\sqlite\SQLite3\build\lemon.exe --help
> here --^
> Valid command line options for "c:\sqlite\SQLite3\build\lemon.exe" are:
>   -b   Print only the basis in report.
>   -c   Don't compress the action table.
>   D=   Define an %ifdef macro.
>   -g   Print grammar without actions.
>   -m   Output a makeheaders compatible file
>   -q   (Quiet) Don't print the report file.
>   -s   Print parser stats to standard output.
>   -x   Print the version number.
>
> I have tested that these options work as expected by manually editing
> the old Makefile and passing such options using the OPTS variable.
>
> Further testing reveals that lemon also seems to accept option in the
> form -DSQLITE_OMIT* just like the compiler, so this is probably a
> non-issue (except that the lemon usage documentation should be updated
> and the command should be changed to accept a --help option as well).
>
> When I use configure to build a new makefile after your changes the
> OPT_FEATURE_FLAGS are set incorrectly.
>
> I ran this command:
>
> $ ../sqlite/configure CFLAGS="-DSQLITE_OMIT_TRIGGER"
>
> During the run the following messages were generated (near the end):
>
> ../sqlite/configure: OPT_FEATURE_FLAGS+= -DSQLITE_OMIT_TRIGGER: command
> not found
> ../sqlite/configure: ac_temp_CFLAGS+= -DSQLITE_OS_WIN=1: command not found
>
> The generated makefile contains the following line:
>
> OPT_FEATURE_FLAGS = -DSQLITE_OMIT_LOAD_EXTENSION=1
>
> with no mention of the SQLITE_OMIT_TRIGGER option.
>
> When make is executed lemon is called to generate the parser like this:
>
> ./lemon.exe  -DSQLITE_OMIT_LOAD_EXTENSION=1 parse.y
>
> and the generated parser still contains all the trigger related code.
>
> It looks like this feature still needs some more work.
>
> Dennis Cote
>
> ___
> 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] Overall question about transactions

2008-07-24 Thread Enrique Ramirez
Hello to all,

I've been working on DBMS systems for a couple of years now (namely
MS-SQL and MySQL) and I find SQLite's usage of transactions to be
quite unique and interesting. I've been reading on different websites
about them and one particular site (which sadly I can't remember)
confused me a bit. They were recommending that transactions be used
even on select statements if they were consecutive. I find this
confusing since I thought transactions were only useful if you are
making changes and want a mechanism to rollback changes if errors
occur. So from what I gather, pseudocode like this should
theoretically work correcty:

Start Transaction;
Query the database;
Do the needed operations on the resultset;
Query the database with a different query;
Do the needed operations on the resultset;
Commit Transaction;

My questions are then,
1) is this correct?
2) if no changes are being made to the database, what is being commited?
3) is the 'optimization' coming from preventing SQLite from generating
a new transaction for each query?

And an off-topic question if I may, is there a way to browse through
archives of older mailings? I'd hate to ask questions that have been
answered thousands of times.

Cheers,
-- 
// --
Enrique Ramirez Irizarry
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] FTS index size

2008-07-24 Thread Jiri Hajek
> So, indeed, there's room for improvement!

Thanks for looking into it, I'm interested in your results. That said, I
still believe that the best way would be to make the current FTS
implementation independent of the VIRTUAL TABLE structure, but be able to
accept more general structures, namely ordinary SQLite tables. The reasons
were mentioned in my last e-mail, one of them was that if I have a field in
FTS table, it can't be indexed (using ordinary SQLite index, not only FTS),
which is sometimes desirable (see Path field in my Songs table example).

Jiri

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


Re: [sqlite] SQLite under c++

2008-07-24 Thread Igor Tandetnik
"Juzbrig" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ok it works but how do I get messages/errors  back from DB? Because
> now im doing it blind.

You check return value for error code. If you got one, you call 
sqlite3_errmsg[16] for an error message.

Igor Tandetnik



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


Re: [sqlite] Ignoring "The"

2008-07-24 Thread Chris Wedgwood
On Wed, Jul 23, 2008 at 02:11:27PM +0100, Andrew Gatt wrote:

> I have a table of music artist names which i'd like to output in
> order.  Normally i just use:
>
> select * from artists order by artist_name;
>
> What i'd really like to do is order the artists by name but ignore
> any "the" or "the," preceding it.

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


Re: [sqlite] .separator \t not working

2008-07-24 Thread none given
It still is not working... 

Terminal does not add a tab character with ctrl-v. I even tried pasting one... 
but in both cases the error bell rings!

Merci pour l'aide ;-)

S.




--- On Thu, 7/24/08, Schplurtz le déboulonné <[EMAIL PROTECTED]> wrote:

> From: Schplurtz le déboulonné <[EMAIL PROTECTED]>
> Subject: Re: [sqlite] .separator \t not working
> To: "General Discussion of SQLite Database" 
> Date: Thursday, July 24, 2008, 7:51 AM
> Hello,
> Le 24 juil. 08 à 01:28, none given a écrit :
> 
> > I then attempt the 3 variations of the statement as
> such :
> > sqlite3 test.db ".separator '\t'
> .import data.csv wc2"
> > sqlite3 test.db ".separator \t .import
> data.csv wc2"
> > sqlite3 test.db ".separator '\t'
> \n .import data.csv wc2"
> [snip]
> > What am I doing wrong?
> 
> 
> I think you can enter only one dot command, so use the
> -separator
> option.
> 
> And sqlite has a strange behaviour with \t on command
> line, you
> must give a REAL tab to the -separator option. On command
> line, use
> Control-v  to insert a real TAB. The command
> should look like
> this :
> 
> sqlite3 test.db -separator '  ' test.db
> ".import data.csv wc2"
> 
> Check
> http://sqlite.org:8080/cgi-bin/mailman/private/sqlite-users/2008-July/004448.html
> for how to do it from a program.
> 
> /schplurtz
> 
> ___
> 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] error:unable to open database file

2008-07-24 Thread kriscbe

i tried with 3 options in that pragma temp_store(0,1,2).
but same problem occured.
now that time increased for every 40 secs.

thanks

kris cbe



Dennis Cote wrote:
> 
> kriscbe wrote:
>> 
>> i am getting new problem while executing my sqlite3 using c++ after some
>> no
>> of operations on db file 
>> i t gives error "unable to open database file"
>> 
> 
> This is probably another case of a misleading error message. SQLite may 
> be trying to open a temporary file, not your database file. You can 
> check the temp store settings with a couple of pragma commands.
> 
>pragma temp_store;
>pragam temp_store_directory;
> 
> See http://www.sqlite.org/pragma.html#modify for details about these 
> pragma commands.
> 
> SQLite needs to have permission to create files in that directory.
> 
> HTH
> Dennis Cote
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/error%3Aunable-to-open-database-file-tp18608770p18628387.html
Sent from the SQLite mailing list archive at Nabble.com.

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


Re: [sqlite] SQLite under c++

2008-07-24 Thread Juzbrig

Ok it works but how do I get messages/errors  back from DB? Because now im
doing it blind.



Mike Marshall wrote:
> 
> Do something like this
> 
> sqlite3_stmt* pStatement;
> vector vResults;
> int nError = sqlite3_prepare_v2(pHandle,"SELECT col1 FROM
> table",-1,,NULL);
> while (sqlite3_step(pStatement) == SQLITE_ROW)
> {
>   
>   vResults.push_back((char*)sqlite3_column_text(pStatement, 0));  
> }
> sqlite3_finalize(pStatement);
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Juzbrig
> Sent: 23 July 2008 13:31
> To: sqlite-users@sqlite.org
> Subject: [sqlite] SQLite under c++
> 
> 
> Hi.
> I am new in sqlite (before I have mysql + php experience). I have a
> question
> 
> If my DB is alredy open
> 
> sqlite3* handle;
> const char* baza = "cols.db3" ;
> char *zErrMsg = 0;
> sqlite3_open(test_baza,);
> 
> How can I get the results of SQL "SELECT * FROM" into a string table or
> any
> c++ structure ?
> sqlite3_exec() doesn't seem to return any strings/chars.
> 
> If anyone could write me that in code I would be grateful.
> -- 
> View this message in context:
> http://www.nabble.com/SQLite-under-c%2B%2B-tp18609682p18609682.html
> Sent from the SQLite mailing list archive at Nabble.com.
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/SQLite-under-c%2B%2B-tp18609682p18628239.html
Sent from the SQLite mailing list archive at Nabble.com.

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