[EMAIL PROTECTED] wrote: > 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. > I did some checking and standard SQL:1999 does not allow the data type (i.e. the char in your definition) in a column definition to be quoted. Therefore the column definitions given in your original post are not valid SQL syntax.
You should use CREATE TABLE "XTollData" ( "DutyID" char(32) NOT NULL , "CarNumber" char(10) NULL ); or if you must use the non-standard square bracket quotes CREATE TABLE [XTollData] ( [DutyID] char(32) NOT NULL , [CarNumber] char(10) NULL ); To define your table using valid SQL (or extended SQL) syntax. SQLite accepts a wide variety of nonsense as the column data type because it is generally ignored internally since SQLite uses dynamic typing. While I think it should return whatever it accepts as the column's declared type, it really shouldn't accept the syntax you used to define your table. It should have given you a syntax error on your create statement. I have copied the pertinent sections from the standard syntax specs below. <column definition> ::= <column name> { <data type> | <domain name> } [ <reference scope check> ] [ <default clause> ] [ <column constraint definition>... ] [ <collate clause> ] <column name> ::= <identifier> <identifier> ::= <actual identifier> <actual identifier> ::= <regular identifier> | <delimited identifier> <delimited identifier> ::= <double quote> <delimited identifier body> <double quote> <delimited identifier body> ::= <delimited identifier part>... <delimited identifier part> ::= <nondoublequote character> | <doublequote symbol> <nondoublequote character> ::= !! See the Syntax Rules <doublequote symbol> ::= "" !! two consecutive double quote characters <data type> ::= <predefined type> | <row type> | <user-defined type> | <reference type> | <collection type> <predefined type> ::= <character string type> [ CHARACTER SET <character set specification> ] | <national character string type> | <binary large object string type> | <bit string type> | <numeric type> | <boolean type> | <datetime type> | <interval type> <character string type> ::= CHARACTER [ <left paren> <length> <right paren> ] | CHAR [ <left paren> <length> <right paren> ] | CHARACTER VARYING <left paren> <length> <right paren> | CHAR VARYING <left paren> <length> <right paren> | VARCHAR <left paren> <length> <right paren> | CHARACTER LARGE OBJECT [ <left paren> <large object length> <right paren> ] | CHAR LARGE OBJECT [ <left paren> <large object length> <right paren> ] | CLOB [ <left paren> <large object length> <right paren> ] HTH Dennis Cote ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------