Hi,

I dont' know what SQLite Administrator is doin during the output but I
think SQLite stores the data as you inserted it.

About this you cold read faq #3 at http://www.sqlite.org/faq.html#q3

Regards, Claudio

On 11/14/06, Mario Figueiredo <[EMAIL PROTECTED]> wrote:
Hello everyone,

I plan to incorprorate SQLite with my C++ projects. I have read the
documentation on how it manages datatypes and I believe I understood it.
However I still have a few doubts that don't seem to be covered by the
documentation.

Are ANSI datatypes recognized? I'm particularly interested in CHAR(X) and
VARCHAR(X). And they seem to work in a way I can't understand.

Within sqlite3 shell I create a simple test table:

CREATE TABLE mytable (
    col1 CHAR(5),
    col2 VARCHAR(5),
    col3 INTEGER
)

and insert the following values:

INSERT INTO mytable VALUES('W23456','W23456',1)

The 6 character long strings are not truncated or an SQL error issued. A
select statement on the table reveals the 5 character lenght constraint to
not have been obeyed. The output is:

W23456|W23456|1

However, when using an external tool (SQLite Administrator 0.8.2.6 Beta) to
read the table, it does show both fields truncated to 5 characters.

So I'm a little confused. What is indeed happening? Is the constraint being
applied only when reading data? And then only when some command is appended
to the select statement?

Thank you,
Mario Figueiredo



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

Reply via email to