On 3/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
"Mitchell Vincent" <[EMAIL PROTECTED]> wrote:
>
> Now comes the fun part. I'm converting these databases (and there are
> a LOT of them), I'm doing "sqlite OLD.DB .dump | sqlite3 NEW.DB" which
> works flawlessly. Is there any way to change the schema on the fly to
> say "Varchar(1024)" instead of just "varchar" (or just use an SQLite
> 'type' of "text") ?
>

Do "sqlite OLD.DB .dump >temp.sql"  Bring up temp.sql in a
text editor.  Find the CREATE TABLE statements.  Modify the
column types to be whatever you want.  Save the file.  Then
do "sqlite3 NEW.DB <temp.sql".

Thank you!

This is something that would be part of an automatic conversion
process that would happen if a user opened a database in the old
format.

I'm curious to know if there is an option to have schema converted to
the main SQLite 'types' instead of just keeping whatever type name was
assigned (varchar, in my example, would just be TEXT I think).

I just thought about putting another step in the process..

sqlite OLD.DB .dump > program_search_replace > temp.sql

program_search_replace would just be something I'd write to string
replace "varchar" with "varchar(1024)" and print the modified string
directly back out. I'm not sure how the output redirection feeds the
data into the program but I'll go off and look that up!

--
- Mitchell Vincent
- K Software - Innovative Software Solutions
- Visit our website and check out our great software!
- http://www.ksoftware.net

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to