RE: [sqlite] Importing a CSV file

2005-02-26 Thread Brass Tilde
  That should have been obvious if you'd attempted to select 
  something from the table with headers turned on in the command 
  line utility.
 
 Thank you so much, and sorry for sending this stupid 
 question. 

No apologies necessary, except for me.  Re-reading that passage, it looks
much harsher than I meant it.  Sorry about that.  I merely meant it as a
suggestion for *next* time something like that happens.

 Sometimes things ar just too obvious to be seen (in 
 french, we say they are on one's nose). 

In English, right in front of one's nose. :)

 In fact, as the table was empty, I did not know how to start the 
 troubleshooting. I tried to dump the table, but sqlite keeps 
 the exact formatting of the sql instruction :

In the command line utility, the .header option controls the display of
the column names when you do a select.  I didn't notice your problem right
off either, so I just created the table and selected from it to see the
extra column.




[sqlite] Mac

2005-02-26 Thread Richard Nagle
Okay:
First is there a current version (compiled) 3.1.3 of SQlite for mac os x ?
Second:
under 2.8.x
after you start SQlite,
sqlite.database
0 main
1 temp
Where the Company Database I have created?
I can see it there in the folder (sqlite) ...
TKS -
Richard


Re: [sqlite] Mac

2005-02-26 Thread Kurt Welgehausen
 Where the Company Database I have created?

Try

$ sqlite db file name

Then

sqlite.tables

Regards


RE: [sqlite] Mac

2005-02-26 Thread Tim Anderson
 -Original Message-
 From: Richard Nagle [mailto:[EMAIL PROTECTED]
 Sent: 26 February 2005 17:56
 To: sqlite-users@sqlite.org
 Subject: [sqlite] Mac
 
 Okay:
 First is there a current version (compiled) 3.1.3 of SQlite for mac os

 x

I built this the other day, on OS X 10.2. I can put it up for download
if you are stuck, but it is honestly very easy to build. The only
uncertainty I had was whether to use --disable-shared; I did in the end,
but I'm not sure if it is still necessary.

Tim


[sqlite] Version 3.1.3 is a headache

2005-02-26 Thread Jakub Adamek
Hi, I really love SQLite, but upgrading to 3.1.3 was not a good idea. I 
have already posted 3 tickets with rather serious problems with column 
names.

The last one is really annoying and I can't believe the auto-tests could 
have missed it ...

  create table a (id, x);
  create table b (id, y);
  insert into a values (1,1);
  insert into b values (1,2);
  select * from a inner join b;
column names returned: id,x,id,y How am I supposed to use such 
column names? Ouwey. No wonder that my C++ wrapper does not want to work 
with such a result set.

Jakub


Re: [sqlite] Version 3.1.3 is a headache

2005-02-26 Thread Bernhard Döbler
Isn't ID the field INNER JOIN uses to combine the tables...
That means you have to columns named ID but theire content is the same.

Bernhard

- Original Message - 
From: Jakub Adamek [EMAIL PROTECTED]
To: sqlite-users@sqlite.org
Sent: Saturday, February 26, 2005 10:43 PM
Subject: [sqlite] Version 3.1.3 is a headache


 Hi, I really love SQLite, but upgrading to 3.1.3 was not a good idea. I 
 have already posted 3 tickets with rather serious problems with column 
 names.
 
 The last one is really annoying and I can't believe the auto-tests could 
 have missed it ...
 
create table a (id, x);
create table b (id, y);
insert into a values (1,1);
insert into b values (1,2);
select * from a inner join b;
 
  column names returned: id,x,id,y How am I supposed to use such 
 column names? Ouwey. No wonder that my C++ wrapper does not want to work 
 with such a result set.
 



Re: [sqlite] Version 3.1.3 is a headache

2005-02-26 Thread D. Richard Hipp
On Sat, 2005-02-26 at 22:43 +0100, Jakub Adamek wrote:
 Hi, I really love SQLite, but upgrading to 3.1.3 was not a good idea. I 
 have already posted 3 tickets with rather serious problems with column 
 names.
 
 The last one is really annoying and I can't believe the auto-tests could 
 have missed it ...
 
create table a (id, x);
create table b (id, y);
insert into a values (1,1);
insert into b values (1,2);
select * from a inner join b;
 
  column names returned: id,x,id,y How am I supposed to use such 
 column names? Ouwey. No wonder that my C++ wrapper does not want to work 
 with such a result set.
 

Your tickets are unhelpful and will likely be ignored.  Rather
than complain about the column names, perhaps you can present
alternative suggestions.  Posting what PostgreSQL, Oracle, and
MySQL do with the same queries would be a good start.  Explaining
why you think the current names are undesirable (instead of
just saying Ouwey) would also be a positive step toward
getting the problem addressed.
-- 
D. Richard Hipp [EMAIL PROTECTED]



[sqlite] lobjc

2005-02-26 Thread SlackRat
I seem to be having some trouble linking a small test programme as included 
below.

I am totally new to Windows and am sure that I have missed something elementary.

I obtained sqlite and have installed:
windows98(2)
dev-c++ 4.9.9.2 (latest modified version)
sqlite-3.1.3.zip
sqlitedll-3.1.3.zip
sqlite-source.zip

The sqlite3.h that I am using I took directly from the sqlite-source package

The programme compiles fine but the linker advises:

  cannot find -lobjc   and ld exits with status 1

I have a copy of libobjc.a in cygwin/lib/mingw and copied it to 
c:/dev-cpp/lib/gcc/mingw32/3.4.2 as lobjc.a
but this is not working

Any help would be greatly appreciated


// testsql.c

#include stdio.h
#include sqlite3.h

static int callback(void *NotUsed, int argc, char **argv, char **azColName){
  int i;
  for(i=0; iargc; i++){
printf(%s = %s\n, azColName[i], argv[i] ? argv[i] : NULL);
  }
  printf(\n);
  return 0;
}

int main(int argc, char **argv){
  sqlite3 *db;
  char *zErrMsg = 0;
  int rc;

  if( argc!=3 ){
fprintf(stderr, Usage: %s DATABASE SQL-STATEMENT\n, argv[0]);
exit(1);
  }
  rc = sqlite3_open(argv[1], db);
  if( rc ){
fprintf(stderr, Can't open database: %s\n, sqlite3_errmsg(db));
sqlite3_close(db);
exit(1);
  }
  rc = sqlite3_exec(db, argv[2], callback, 0, zErrMsg);
  if( rc!=SQLITE_OK ){
fprintf(stderr, SQL error: %s\n, zErrMsg);
  }
  sqlite3_close(db);
  return 0;
}
// eof
.
--
Slackrat

Re: [sqlite] lobjc

2005-02-26 Thread Ulrik Petersen
Hi,
SlackRat wrote:
I seem to be having some trouble linking a small test programme as included 
below.
I am totally new to Windows and am sure that I have missed something elementary.
I obtained sqlite and have installed:
windows98(2)
dev-c++ 4.9.9.2 (latest modified version)
sqlite-3.1.3.zip
sqlitedll-3.1.3.zip
sqlite-source.zip
 

This sounds like more of a problem with configuring dev-c++ than with 
SQLite.  Perhaps you would be better served on a dev-c++ forum.

The sqlite3.h that I am using I took directly from the sqlite-source package
The programme compiles fine but the linker advises:
  cannot find -lobjc   and ld exits with status 1
 

This means that the linker is configured (somewhere, in some dialog box) 
to use Objective C (is my guess), where you really want to use plain C.  
Perhaps you mistakenly selected Objective C as your default language 
when you created the project.  I don't know -- as I said, this sounds 
more like a configuration problem with dev-c++ than a problem with SQLite.

Go hunt for references to libobjc, -lobjc, and Objective C in the 
configuration dialogs.  And make sure that all paths in any 
path-configuration dialog box are set correctly.

I have a copy of libobjc.a in cygwin/lib/mingw and copied it to 
c:/dev-cpp/lib/gcc/mingw32/3.4.2 as lobjc.a
but this is not working
 

Unless your Cygwin version of libobjc.a is exactly the same as the one 
that comes with dev-c++, I suspect this may not be a good idea.

Perhaps try uninstalling and reinstalling dev-c++.
HTH
Ulrik Petersen
--
Ulrik Petersen, MA, B.Sc.
University of Aalborg, Denmark