Re: [sqlite] New Mailing List: List-Id Header

2003-10-19 Thread William Trenker
D. Richard Hipp wrote:

> William Trenker wrote:
> > 
> > Any chance of adding the standard List-Id header to the new mailing list?  
> 
> If I made the change correctly, this reply should have the List-Id header line.
> 
Thanks for the quick response.

Regards,
Bill

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] AUTO INCREMENT

2003-10-19 Thread Greg Obleshchuk
Hi Kevin,
You could also query the table or view but don't return any rows.  If you set the 
option to get the column types in the resultset this should do what you want .  AN 
example of what I am trying to say would help :)

PRAGMA show_datatypes = ON; 
select COl3 from tablename where 0 = 1

Then in the array that is returned you should have the column type as used when the 
table was created.  This may save you the trouble of working through the SQLtext.  The 
where statement should result in no CPU time used for the query

regards
Greg O

  - Original Message - 
  From: Kevin Waterson 
  To: [EMAIL PROTECTED] 
  Sent: Monday, October 20, 2003 10:59 AM
  Subject: Re: [sqlite] AUTO INCREMENT


  This one time, at band camp, "Ian VanDerPoel" <[EMAIL PROTECTED]> wrote:


  > You can find the info you want in the  sqlite_master 
  > table. There is some doco on it at the sqlite.org the website. I am not sure if 
the info is held anywhere else but 
  > select * from sqlite_master where name = quotes; will return the sql used to build 
the table. you can parse the data type from that.

  yep, guess I will just write up a getFieldType function

  Thanks for your time.

  Kind regards
  Kevin

  -- 
   __  
  (_ \ 
   _) )            
  |  /  / _  ) / _  | / ___) / _  )
  | |  ( (/ / ( ( | |( (___ ( (/ / 
  |_|   \) \_||_| \) \)
  Kevin Waterson
  Port Macquarie, Australia

  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] AUTO INCREMENT

2003-10-19 Thread Kevin Waterson
This one time, at band camp, "Ian VanDerPoel" <[EMAIL PROTECTED]> wrote:


> You can find the info you want in the  sqlite_master 
> table. There is some doco on it at the sqlite.org the website. I am not sure if the 
> info is held anywhere else but 
> select * from sqlite_master where name = quotes; will return the sql used to build 
> the table. you can parse the data type from that.

yep, guess I will just write up a getFieldType function

Thanks for your time.

Kind regards
Kevin

-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] AUTO INCREMENT

2003-10-19 Thread Kevin Waterson
This one time, at band camp, Kevin Waterson <[EMAIL PROTECTED]> wrote:


> OK, that sounds fine, but is it possible to determine the type of field so my script
> will be able to add the quotes if it is of type INTEGER?

I guess what I really need is something like MySQL's mysql_field_type()

Kind regards
Kevin
-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] AUTO INCREMENT

2003-10-19 Thread Kevin Waterson
I have a table that looks like this..
#
#SQLite Admin Structure Dump for table quotes
#
create table quotes(id INTEGER PRIMARY KEY, author varchar(50), quote TEXT, category 
varchar(20))

I am trying to auto increment the id field with this query
INSERT INTO quotes (id, author, quote, category) VALUES ('NULL', 'blah', 'blah', 
'blah')

instead, I get an error saying 'datatype mismatch'

I thought if I inserted a NULL into an INTEGER PRIMARY KEY it would auto
increment for me. Obviously I am doing something wrong/insane here.

Kind regards
Kevin

-- 
 __  
(_ \ 
 _) )            
|  /  / _  ) / _  | / ___) / _  )
| |  ( (/ / ( ( | |( (___ ( (/ / 
|_|   \) \_||_| \) \)
Kevin Waterson
Port Macquarie, Australia

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] temporary files

2003-10-19 Thread Will Leshner
Yes, I think that is what is supposed to happen, but it doesn't appear to be working. But I have made modifications to my os.c file, so maybe I screwed something up.

Nuno Lucas wrote:

I don't have Mac knowledge, but the automatic deletion of temp files is done on the 
sqliteOsClose() function, at "os.c".
Just a clue...


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [sqlite] temporary files

2003-10-19 Thread Nuno Lucas
I don't have Mac knowledge, but the automatic deletion of temp files is done on the 
sqliteOsClose() function, at "os.c".
Just a clue...

Regards,
~Nuno Lucas

=== On 2003-10-19, Will Leshner wrote ===
>I've noticed that, on Mac OS X at least, I'm getting a lot of temporary 
>files filling up my in my /private/tmp directory as I use SQLite, and 
>they aren't being deleted even when I close the database. I've seen 
>comments in the archives for this mailing list that suggest that the 
>files should be getting removed automatically when they are closed. 
>Perhaps that they aren't is a bug in OS X? I've also found one piece of 
>commented out code in pager.h that, when re-enabled, does seem to 
>delete the files when the database closes. Is it safe to put that code 
>back in? And will that code pretty much shoot all the temporary files 
>that might be getting created?
>
>Thanks for any info.
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


--
/"\ 
\ /ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL 
 X   - AGAINST MS ATTACHMENTS
/ \ 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] New Mailing List: List-Id Header

2003-10-19 Thread JeeBak Kim
* D. Richard Hipp ([EMAIL PROTECTED]) [031019 14:08]:
> William Trenker wrote:
> >
> >Any chance of adding the standard List-Id header to the new mailing list?  
> 
> If I made the change correctly, this reply should have the List-Id header
> line.

I'm getting the backspace character in that header:

  List-Id: SQLite Users Mailing List 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] New Mailing List: List-Id Header

2003-10-19 Thread D. Richard Hipp
William Trenker wrote:
Any chance of adding the standard List-Id header to the new mailing list?  
If I made the change correctly, this reply should have the List-Id header
line.
--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] New Mailing List: List-Id Header

2003-10-19 Thread William Trenker
(Sorry if this comes through twice.  I changed email addresses when I changed to the 
new sqlite list and got things confused on my end.  All is fixed now.)

Any chance of adding the standard List-Id header to the new mailing list?  This header 
is handy for filtering messages and some email clients (like Opera's M2) use it to 
automatically group messages by mailing list.

Here's a reference:
RFC 2919 - List-Id: A Structured Field and Namespace for the Identification of Mailing 
Lists
http://www.faqs.org/rfcs/rfc2919.html

Thanks for considering this request, and thanks for the new list.
Bill

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [sqlite] Select from Select

2003-10-19 Thread Michael A. Cleverly
On Sun, 19 Oct 2003, Brian Pugh wrote:

> How many records in a certain Postcode area (Zip code to our
> US friends!);
> How many of those have telephones (ie, the field is blank if
> they don't have a telephone);
> How many with telephones can be canvassed (I have a field called
> Canvass that has either a 'Y' or 'N' in there)
 
> Table is called NewsData; Postcode field is called Postcode;
> Telephone field is called Tel; Canvass field is called Canvass

Try something like:

select postcode, count(*) as num_records, 
   sum(case when tel is not null then 1 else 0 end) as num_phones,
   sum(case when tel is not null and canvas='Y' then 1 else 0 end) as 
   num_canvasable
  from NewsData
 group by postcode;

Michael


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[sqlite] temporary files

2003-10-19 Thread Will Leshner
I've noticed that, on Mac OS X at least, I'm getting a lot of temporary 
files filling up my in my /private/tmp directory as I use SQLite, and 
they aren't being deleted even when I close the database. I've seen 
comments in the archives for this mailing list that suggest that the 
files should be getting removed automatically when they are closed. 
Perhaps that they aren't is a bug in OS X? I've also found one piece of 
commented out code in pager.h that, when re-enabled, does seem to 
delete the files when the database closes. Is it safe to put that code 
back in? And will that code pretty much shoot all the temporary files 
that might be getting created?

Thanks for any info.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[sqlite] Select from Select

2003-10-19 Thread Brian Pugh
Hi,

I would like to be able to run a query on my names and addresses
database, returning the following:

How many records in a certain Postcode area (Zip code to our
US friends!);
How many of those have telephones (ie, the field is blank if
they don't have a telephone);
How many with telephones can be canvassed (I have a field called
Canvass that has either a 'Y' or 'N' in there)

I can do the first (how many records), but I don't want to have
to run a query for every return needed. I think a "select from
select" is needed, but I don't know how to code it

Table is called NewsData; Postcode field is called Postcode;
Telephone field is called Tel; Canvass field is called Canvass

Many thanks for any help,

Brian Pugh