On 3/9/07, Christian Werner <[EMAIL PROTECTED]> wrote:
Mitchell Vincent wrote:
>
> I have an old SQLite 2.8 database that shared it's schema with
> PostgreSQL. One of the nifty things about PostgreSQL (that admittedly
> has me spoiled) is the ability to just say "varchar" without any
> length specifier.
>
> Specifying "varchar" in SQLite works great - no problem at all. Until
> I tried to use it with ODBC. The SQLite ODBC driver works fine but
> assumes a 255 character limit. As soon as it returns a result longer
> than 255 it blows an error.
>
> I see in the SQLite ODBC driver's documentation that it does support >
> 255 varchar fields but I _assume_ have to specify that it's > 255 in
> the schema.
>
> 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") ?

Mitchell,

the artificial limitation of VARCHAR columns to 255 chars in the SQLite
ODBC drivers is yet another tribute to M$ACCE$$.
If you want a proper untruncated mapping to larger VARCHAR columns use
"text" or "memo" in your CREATE TABLE statement. These will be mapped
to SQL_LONGVARCHAR by the drivers.

Sorry for that inconvenience, but blame billg, not me ;-)

Regards,
Christian

Thanks Christian!

I never meant to blame you at all - I figured the assumed 255 char
limit was there for good reason! I should have created better schema
anyway.

I'm looking into ways of changing the schema type name when I do my
SQLite2->SQLite3 conversion. Most likely I'll have to pipe the .dump
from the SQLite2 db through a program to replace 'varchar' with
'text'... I'm working on that now!

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