Re: [sqlite] Re: Padding with zeros

2006-01-06 Thread Brian Johnson
I missed replying to the correct email, but this tip from Igor Tandetnik worked beautifully: Igor Tandetnik Thu, 29 Dec 2005 14:50:08 -0800 Brian Johnson wrote: I need to update a char field to add integer prefixes, but I need to pad them with zeroes so I can sort them. I'm not exactly sure what

Re: [sqlite] Re: Padding with zeros

2005-12-30 Thread Jay Sprenkle
http://www.google.com/search?hl=en&q=sqlite+collate&btnG=Google+Search On 12/29/05, Brian Johnson <[EMAIL PROTECTED]> wrote: > where can I find info about this? > > Jay Sprenkle ([EMAIL PROTECTED]) wrote: > > > > Have you looked at the collating sequence options? > > perhaps you can get it to sor

Re: [sqlite] Re: Padding with zeros

2005-12-29 Thread Nathan Kurz
On Fri, Dec 30, 2005 at 12:21:05AM +, Brian Johnson wrote: > I have a field of text and I want to prefix the that text with numbers padded > with zeroes. > > eg currently > text 1 > text 2 > text 3 > > to become > 001 text 1 > 002 text 3 > 003 text 2 > > or ultimately > b001 text 1 > b002 te

Re: [sqlite] Re: Padding with zeros

2005-12-29 Thread Brian Johnson
where can I find info about this? Jay Sprenkle ([EMAIL PROTECTED]) wrote: > > Have you looked at the collating sequence options? > perhaps you can get it to sort how you want without the padding. > > On 12/29/05, Igor Tandetnik <[EMAIL PROTECTED]> wrote: > > Brian Johnson wrote: > > > I need to up

Re: [sqlite] Re: Padding with zeros

2005-12-29 Thread Brian Johnson
I have a field of text and I want to prefix the that text with numbers padded with zeroes. eg currently text 1 text 2 text 3 to become 001 text 1 002 text 3 003 text 2 or ultimately b001 text 1 b002 text 3 b003 text 2 Igor Tandetnik ([EMAIL PROTECTED]) wrote: > > Brian Johnson wrote: > > I nee

Re: [sqlite] Re: Padding with zeros

2005-12-29 Thread Jay Sprenkle
Have you looked at the collating sequence options? perhaps you can get it to sort how you want without the padding. On 12/29/05, Igor Tandetnik <[EMAIL PROTECTED]> wrote: > Brian Johnson wrote: > > I need to update a char field to add integer prefixes, but I need to > > pad them with zeroes so I c

[sqlite] Re: Padding with zeros

2005-12-29 Thread Igor Tandetnik
Brian Johnson wrote: I need to update a char field to add integer prefixes, but I need to pad them with zeroes so I can sort them. I'm not exactly sure what you are trying to do, but this would perhaps give you an idea: update table set field=substr('00...0' || field, -20, 20) assuming you