Jay,

On Sun, Dec 2, 2012 at 1:31 PM, Jay A. Kreibich <j...@kreibi.ch> 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 <j...@kreibi.ch> wrote:
>> > On Sun, Dec 02, 2012 at 11:58:54AM -0800, Igor Korot scratched on the wall:
>> >> Hi, ALL,
>> >> ALTER TABLE <table_name> 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 sqlite_master directly.
>>
>> ;-)
>> I thought that the word "safest" is explicit. Guess not...
>
>   Life is short.

Agreed.

>
>> 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?
>
>   That's the safest, but it might not be the fastest.  Without the FK,
>   it would normally be a simple matter of creating the new table,
>   copying the data with a INSERT...SELECT (which should auto adjust the
>   types), then swapping the tables.  I'm not sure of the FK will allow
>   you to do that or not.  Worth a shot before you dump the whole
>   database... you might need to update both tables at the same time
>   within a transaction.

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

and then load this file back into the db.
All this will be done in the console (command prompt) window.

Do I need to use ".dump/.load" commands for that?

Thank you.

>
>    -j
>
> --
> Jay A. Kreibich < J A Y  @  K R E I B I.C H >
>
> "Intelligence is like underwear: it is important that you have it,
>  but showing it to the wrong people has the tendency to make them
>  feel uncomfortable." -- Angela Johnson
> _______________________________________________
> 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

Reply via email to