Re: [sqlite] Question on Blobs

2008-02-29 Thread Fred J. Stephens
Dennis Cote wrote: > If you are using the command line sqlite3 program rather than the > library, then all your input must be text that can appear on the command > line or be redirected from stdin. Handling binary data this way will be > difficult. Thanks Dennis, You cleared up allot for me. I

Re: [sqlite] How to recover from database corruption? (and why does it happen?)

2008-02-29 Thread Luca Olivetti
En/na Luca Olivetti ha escrit: > Hello, > I'm using sqlite 3.3.8 under linux (mandriva 2007.1). [...] > 1) is sqlite suitable when you have multiple threads accessing the same > database? Or should I delegate the access in a single thread and > serialize the queries from the various threads? >

[sqlite] Retrieve Rownumber in sqlite

2008-02-29 Thread Kalyani Phadke
In SQL Server2005, Row_number() function is used to retrieve the sequential number of a row within a partition of a result set, starting at 1 for the first row in each partition. Which is very useful when implementing paging through a large number records in Table. Is there any function available

Re: [sqlite] How To concatenate two fields in one

2008-02-29 Thread Dennis Cote
Alessio Forconi wrote: > > What I would like to achieve is the same as writing in SQL Server > > SELECT IDStudent, Name + " - " + Surname AS Nominative FROM Students > You need to use the SQL standard concatenation operator. SELECT IDStudent, Name || " - " || Surname AS Nominative

Re: [sqlite] Update fail without ERRORS

2008-02-29 Thread Dennis Cote
[EMAIL PROTECTED] wrote: > > How can I debug this issu ? > You will have to show some of the code you are having problems with before anyone here can help you with this. Dennis Cote ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Optimization Question for SQLite Experts

2008-02-29 Thread Dennis Cote
Mark Gilbert wrote: > > In fact we stumbled across the solution, and I am amazed we didnt > think of it earlier, and no-one suggested it. Basically our LEAVES > table doesn't have an Index !! > > As soon as we added an index, the process sped up by 17000% :-) > > However, I have some

Re: [sqlite] How To concatenate two fields in one

2008-02-29 Thread Samuel Neff
SQLite uses '||' as the concatenation operator (which is correct, MSSQL is really wrong to accept '+' and not use '||'). HTH, Sam On Fri, Feb 29, 2008 at 11:52 AM, Alessio Forconi <[EMAIL PROTECTED]> wrote: > > What I would like to achieve is the same as writing in SQL Server > > SELECT

Re: [sqlite] Optimization Question for SQLite Experts

2008-02-29 Thread Samuel Neff
shouldn't leafID be the primary key of your LEAVES table and thus already indexed? What does your create table statement look like? I'd expect CREATE TABLE Leaves (LeafID INTEGER PRIMARY KEY AUTOINCREMENT, ... other columns ... ) As far as the create index failing, no idea there, sorry.. Sam

Re: [sqlite] How To concatenate two fields in one

2008-02-29 Thread Stephen Oberholtzer
On Fri, Feb 29, 2008 at 11:52 AM, Alessio Forconi <[EMAIL PROTECTED]> wrote: > Hello everyone, > > SELECT IDStudent, Name + " - " + Surname AS Nominative FROM Students + is addition. You want ||. Also, you're using double-quotes (") when you should be using single-quotes ('). SELECT IDStudent,

Re: [sqlite] How To concatenate two fields in one

2008-02-29 Thread Igor Tandetnik
Alessio Forconi <[EMAIL PROTECTED]> wrote: > What I would like to achieve is the same as writing in SQL Server > > SELECT IDStudent, Name + " - " + Surname AS Nominative FROM Students SELECT IDStudent, Name || ' - ' || Surname AS Nominative FROM Students Igor Tandetnik

Re: [sqlite] Update fail without ERRORS

2008-02-29 Thread Stephen Oberholtzer
On Fri, Feb 29, 2008 at 11:01 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm working on a program using sqlite library, but I've got an issue > that I can't solve. > Suddenly, my program don't update the tables > I > don't understand whats matter because, if I write SQL

Re: [sqlite] How To concatenate two fields in one

2008-02-29 Thread John Stanton
Use the standard SQL || operator for concatenate. The + is not SQL and specific to SQl Server. Alessio Forconi wrote: > Hello everyone, > > This is my first message. > > I have a table called Students: > > IDStudent char(10) PRIMARY KEY, NOT NULL > Name char (30) NOT NULL > Surname char(30)

Re: [sqlite] CREATE INDEX problem - answer

2008-02-29 Thread Mark Gilbert
I have solved my problem below I am trying to add an index to my database, but the following code is failing in CREATE INDEX with error 14 (unable to open Database file). rc = sqlite3_open(OurDataBaseName, ); if (rc) { fprintf(stderr, "sqlite3_open returned

[sqlite] sqlite 3.5.6 and readline

2008-02-29 Thread jcroux
Hello, I am trying to compile sqlite in a /custom/directory and keep the ability to use arrows to get previously entered commands in the sqlite3 executable. I read the wiki about that topic http://www.sqlite.org/cvstrac/wiki?p=ReadLine but I am still failing. It is advised to find the variable

Re: [sqlite] Optimization Question for SQLite Experts

2008-02-29 Thread Mark Gilbert
Hey Samuel Thanks for your ideas. In fact we stumbled across the solution, and I am amazed we didnt think of it earlier, and no-one suggested it. Basically our LEAVES table doesn't have an Index !! As soon as we added an index, the process sped up by 17000% :-) However, I have some

Re: [sqlite] newB question; c++ and sqlite3; how2 check if word exist in the table

2008-02-29 Thread Dennis Cote
vl.pavlov wrote: > > i wander how 2 check (efficiently) if some word (string, in c++) exist in > the sqlite3 table > Assuming this is the same database as your last question. You have the table: create table words (word text primary key, number integer); Then this query will work:

[sqlite] How To concatenate two fields in one

2008-02-29 Thread Alessio Forconi
Hello everyone, This is my first message. I have a table called Students: IDStudent char(10) PRIMARY KEY, NOT NULL Name char (30) NOT NULL Surname char(30) NOT NULL What I would like to achieve is the same as writing in SQL Server SELECT IDStudent, Name + " - " + Surname AS Nominative FROM

Re: [sqlite] Optimizing an insert/update

2008-02-29 Thread Dennis Cote
Michael Miller wrote: > I apologize if this is a double-post; I just got approved for the mailing > list, and I can't find the older message in the archives, so I'm reposting > it. > > I have a table with two columns, the first with a string and the second with > an integer. > > > Given a set

Re: [sqlite] Join Syntax Questions

2008-02-29 Thread Dennis Cote
Mitchell Vincent wrote: > I could swear I've done this type of thing before and am sure I'm > overlooking something simple. > > Is this correct syntax? > > SELECT im.invoice_date as invoice_date,im.pay_by as > due_date,im.invoice_id as invoice_id, im.invoice_number as >

[sqlite] Update fail without ERRORS

2008-02-29 Thread [EMAIL PROTECTED]
I'm working on a program using sqlite library, but I've got an issue that I can't solve. Suddenly, my program don't update the tables I don't understand whats matter because, if I write SQL instructions using Sqlite3 client, UPDATE works fine, and I haven't any ERROR CODE. sqlite3_exec

Re: [sqlite] export to SQL insert statements with column names

2008-02-29 Thread Dennis Cote
[EMAIL PROTECTED] wrote: > Is there a way to export/dump SQLite data into INSERT statements which > also have column names? > No. You would have to build a custom version and modify the source of the dump command in shell.c. HTH Dennis Cote ___

Re: [sqlite] Question on Blobs

2008-02-29 Thread Dennis Cote
Fred J. Stephens wrote: > Thanks John & Dennis; > Looks like I am getting ahead of myself here. I'm just doing a simple > PIM app as a BASH script that uses SQLite to store data. Probably I > can't do this in a script as you could in C. > > I find the formating of the text from a file is not

Re: [sqlite] undefined symbol: sqlite3_prepare_v2

2008-02-29 Thread Dennis Cote
Joanne Pham wrote: > The question is how to check the sqlite version from this > library(libsql3.so.0.8.6. > Joanne, Have your application execute the following SQL statement and then look at the result. select sqlite_version(); This will return the versionif the library used to execute

Re: [sqlite] Nested calls to prepare/step/prepare

2008-02-29 Thread Jay A. Kreibich
On Fri, Feb 29, 2008 at 11:50:32AM +0700, Dan scratched on the wall: > > On Feb 29, 2008, at 5:21 AM, Ken wrote: > > > I wanted to find out if the following is allowed in Sqlite. > > > >sqlite3_prepare_v2 > > while ( ) { > >sqlite3_step > > sqlite3_prepare_v2 --- I;m getting a

Re: [sqlite] Optimizing an insert/update

2008-02-29 Thread Cyril SCETBON
Michael Miller wrote: > I apologize if this is a double-post; I just got approved for the mailing > list, and I can't find the older message in the archives, so I'm reposting > it. > > I have a table with two columns, the first with a string and the second with > an integer. > > > Given a set

[sqlite] Unable to Open Database File when creating Index

2008-02-29 Thread Mark Gilbert
Folks. I am trying to add an index to my database, but the following code is failing in CREATE INDEX with error 14 (unable to open Database file). rc = sqlite3_open(OurDataBaseName, ); if (rc) { fprintf(stderr, "sqlite3_open returned %d\n",rc); return -1; } rc =

[sqlite] installation of sqlite in linux

2008-02-29 Thread debz
I have downloaded tclsqlite-3.5.6.so.gz(with tcl binding , i need tcl).I dont know how to install.plz help. -- View this message in context: http://www.nabble.com/installation-of-sqlite-in-linux-tp15759216p15759216.html Sent from the SQLite mailing list archive at Nabble.com.

Re: [sqlite] Optimizing an insert/update

2008-02-29 Thread Lars Aronsson
Michael Miller wrote: > "If the string doesn't exist in the table, create a new row with > the string in the first column and 1 in the second column. If > the string does exist in the table, increment the second column > by 1" One way you can do it is to insert everything into a temporary

[sqlite] newB question; c++ and sqlite3; how2 check if word exist in the table

2008-02-29 Thread vl.pavlov
hi again, i wander how 2 check (efficiently) if some word (string, in c++) exist in the sqlite3 table any suggestions ? -- View this message in context: http://www.nabble.com/newB-question--c%2B%2B-and-sqlite3--how2-check-if-word-exist-in-the-table-tp15758100p15758100.html Sent from the

[sqlite] export to SQL insert statements with column names

2008-02-29 Thread Shibu.Narayanan
Hi, Is there a way to export/dump SQLite data into INSERT statements which also have column names? As of now, a sqlite dump looks like this INSERT INTO "ric_tb_language" VALUES('ENG','English'); INSERT INTO "ric_tb_language" VALUES('SPN','Spanish'); INSERT INTO "ric_tb_language"