[EMAIL PROTECTED] wrote:
<[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 )

I think what the OP is saying is that he thinks sqlite3_column_decltype should return the complete declared type char(32) not just the char portion. This seems to be an issue with the way sqlite is parsing the column declaration. I suspect sqlite may be getting confused by the square bracket quoting used on the typename. The syntax grammar at http://www.sqlite.org/lang_createtable.html says that the type of a column can be given as

   type := typename ( number )

Which the OP is doing, but the type returned by the decltype API only has the typename part. Whether or not the square bracket quoting should be included is debatable.

This does seem like a bug to me.

Dennis Cote

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

Reply via email to