On Thu, Nov 17, 2011 at 5:23 PM, Simon Slavin <slav...@bigfraud.org> wrote:

>
> On 17 Nov 2011, at 9:44pm, Francis J. Monari, Esquire wrote:
>
> > * of those file identifiers having leading zeros, some leading zeros are
> > being stripped off (handled like integers), and some leading zeros are
> > not (handled like text).
>
> Check to see that the affinity for that column is string, not number.
>  Preferably redefine it as TEXT not NVARCHAR, but if you can't do this
> consult the table on
>
> <http://www.sqlite.org/datatype3.html>
>
> Do your SQL commands always include apostrophes around those values in
> INSERT and UPDATE commands ?  Without them, you're saying that the values
> are numbers.  With them, your explicitly declaring them as text.
>

The NVARCHAR type should be understood as text.

I'm guessing, that since the OP says he is using TCL, he is probably doing
something like this:

    set value 0001234
    db eval {INSERT INTO table VALUES($value)}

And the leading zeros are being stripped off (and the number is being
converted into octal) by TCL on the first statement.  So that by the time
SQLite gets the value, it is already an integer with the leading zeros
removed.



>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to