but if you create a table using: CREATE TABLE XTollData ( DutyID char (32) NOT NULL , CarNumber char (10) NULL );
SQLite3_Column_decltype will return the result of 'DutyID' as 'char(32)'. That is, SQLite3_Column_decltype treat '[char](32)' as 'char', treat 'char(32)' as 'char(32)'. I think this IS a bug. A Delphi compoenent(ASGSQLite3) use SQLite3_Column_decltype to determine the data type and data size of a field. And this "feature" makes it get the wrong size of '[char](32)' (as 1 byte), and get the right size of 'char(32)' (as 32 bytes). ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <sqlite-users@sqlite.org> Sent: Tuesday, March 20, 2007 7:48 PM Subject: Re: [sqlite] data type problem <[EMAIL PROTECTED]> wrote: > if you create a table use following statement (script generated from MS SQL > Server 2000) > CREATE TABLE [XTollData] ( > [DutyID] [char] (32) NOT NULL , > [CarNumber] [char] (10) NULL > ); > > SQLite3_Column_decltype will treat DutyID as data type 'char' but not > 'char(32)' This is a feature, not a bug. If you want the database to enforce a maximum string length, then add CHECK( length(DutyID)<=32 ) -- D. Richard Hipp <[EMAIL PROTECTED]> ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------