Re: [sqlite] What is the easiest way of changing the field type?

2012-12-03 Thread Keith Medcalf
eral Discussion of SQLite Database > Subject: Re: [sqlite] What is the easiest way of changing the field type? > > > On 3 Dec 2012, at 7:29pm, Igor Korot wrote: > > > I didn't get errors when I did that with my table. Other than that its all > > the same. &g

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-03 Thread Simon Davies
On 3 December 2012 19:29, Igor Korot wrote: > Simon, > > On Mon, Dec 3, 2012 at 11:03 AM, Simon Slavin wrote: >> >> On 3 Dec 2012, at 6:53pm, Igor Korot wrote: >> > > Here is the session: > > sqlite> CREATE TABLE test(id1 integer, id2 double); > sqlite> INSERT INTO test( 1, 1.0 ); > Error: near

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-03 Thread Simon Slavin
On 3 Dec 2012, at 7:29pm, Igor Korot wrote: > I didn't get errors when I did that with my table. Other than that its all > the same. You didn't get any time shown when the .read command finished. This suggests that something crashed the .read command. Anything done after that can malfunctio

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-03 Thread Igor Korot
Simon, On Mon, Dec 3, 2012 at 11:03 AM, Simon Slavin wrote: > > On 3 Dec 2012, at 6:53pm, Igor Korot wrote: > >> Yes, using standard sqlite3 shell from command prompt in Windows 7 64-bit. >> After .dump/.read no queries to the table in question produced output. >> >> When restarted the shell eve

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-03 Thread Simon Slavin
On 3 Dec 2012, at 6:53pm, Igor Korot wrote: > Yes, using standard sqlite3 shell from command prompt in Windows 7 64-bit. > After .dump/.read no queries to the table in question produced output. > > When restarted the shell everything worked. I've not come across that before. Try .timer ON SE

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-03 Thread Igor Korot
Simon, On Mon, Dec 3, 2012 at 9:39 AM, Simon Slavin wrote: > > On 3 Dec 2012, at 5:38pm, Igor Korot wrote: > >> Simon, >> Yes, thank you. > > Great. > >> ALL, >> After recreating the table this way I had to restart sqlite console as >> otherwise >> all queries to the table were dead. >> >> Is t

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-03 Thread Simon Slavin
On 3 Dec 2012, at 5:38pm, Igor Korot wrote: > Simon, > Yes, thank you. Great. > ALL, > After recreating the table this way I had to restart sqlite console as > otherwise > all queries to the table were dead. > > Is this normal? Hmm. No, if you're using the standard sqlite3 shell tool you s

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-03 Thread Igor Korot
Simon, Yes, thank you. ALL, After recreating the table this way I had to restart sqlite console as otherwise all queries to the table were dead. Is this normal? Thank you. On Mon, Dec 3, 2012 at 1:42 AM, Simon Slavin wrote: > > On 3 Dec 2012, at 1:08am, Igor Korot wrote: > >> I thought that s

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-03 Thread Simon Slavin
On 3 Dec 2012, at 1:08am, Igor Korot wrote: > I thought that simply using ".backup/.restore" will give me what I want, > but it gives me a file in internal format. > What I am trying to do is do make a text file which gives me all SQL command > that was issued (CREATE TABLE and INSERT) than fix

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Donald Griggs
Regarding: > > > > Note that you only need to .dump/.read the table(s) you want to alter. > > *Well, I don't think it's true. > 1. When I execute "CREATE TABLE" with the table name that already exists > wouldn't I get an error message? > 2. If I drop this table first I will get an error about the

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Igor Korot
Donald, On Sun, Dec 2, 2012 at 7:22 PM, Donald Griggs wrote: > Regarding: > > *How do I do that? > I thought that simply using ".backup/.restore" will give me what I want, > but it gives me a file in internal format. > What I am trying to do is do make a text file which gives me all SQL command >

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Donald Griggs
Regarding: *How do I do that? I thought that simply using ".backup/.restore" will give me what I want, but it gives me a file in internal format. What I am trying to do is do make a text file which gives me all SQL command that was issued (CREATE TABLE and INSERT) than fix the particular CREATE TA

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Igor Korot
Jay, On Sun, Dec 2, 2012 at 1:31 PM, Jay A. Kreibich wrote: > On Sun, Dec 02, 2012 at 12:52:33PM -0800, Igor Korot scratched on the wall: >> Jay, >> >> On Sun, Dec 2, 2012 at 12:16 PM, Jay A. Kreibich wrote: >> > On Sun, Dec 02, 2012 at 11:58:54AM -0800, Igor Korot scratched on the wall: >> >> H

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Jay A. Kreibich
On Sun, Dec 02, 2012 at 12:52:33PM -0800, Igor Korot scratched on the wall: > Jay, > > On Sun, Dec 2, 2012 at 12:16 PM, Jay A. Kreibich wrote: > > On Sun, Dec 02, 2012 at 11:58:54AM -0800, Igor Korot scratched on the wall: > >> Hi, ALL, > >> ALTER TABLE command does not support changing the fiel

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Gerry Snyder
On 12/2/2012 1:52 PM, Igor Korot wrote: So, does this mean that I need to drop the DB in the text file, edit it and then re-create it from this file? How to make alterations to a table that can not be done with the ALTER TABLE command is outlined in topic 11 of the FAQ: http://sqlite.org/f

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Igor Korot
Jay, On Sun, Dec 2, 2012 at 12:16 PM, Jay A. Kreibich wrote: > On Sun, Dec 02, 2012 at 11:58:54AM -0800, Igor Korot scratched on the wall: >> Hi, ALL, >> ALTER TABLE command does not support changing the field type. >> >> What is the easiest and fastest way to change the field type from >> integ

Re: [sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Jay A. Kreibich
On Sun, Dec 02, 2012 at 11:58:54AM -0800, Igor Korot scratched on the wall: > Hi, ALL, > ALTER TABLE command does not support changing the field type. > > What is the easiest and fastest way to change the field type from > integer to double? The easy, fast, and dangerous method is to edit sqli

[sqlite] What is the easiest way of changing the field type?

2012-12-02 Thread Igor Korot
Hi, ALL, ALTER TABLE command does not support changing the field type. What is the easiest and fastest way to change the field type from integer to double? I know it is all saved as text but for me when I look at the db structure I know what kind of variable I will use and what calculation needs