On Sat, 08 Aug 2009 11:16:35 +0200, Gilles Ganault
<[email protected]> wrote:

>Hello
>
>       I'd like to use also use items' ID number as barcodes, so I'd like
>to set the size to eg. 10 so that I don't end up with really tiny
>barcodes for the first hundred's of articles.
>
>Is it possible to have auto-incremented primary keys be a fixed size,
>eg. 0000000001, 0000000002, etc.?

No.
Usually this kind of presentation tasks are done by the
host-language: sprintf("%10d",ID)

In SQLite, you can add leading zeroes in the SELECT:

select substr('0000000000000000' || ID, length(ID))
 from mytable;

-- 
  (  Kees Nuyt
  )
c[_]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to