Re: Random Number SKU Generator

From: "Peter Dabrowski" <meritage(at)mail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Random Number SKU Generator
Date: 2015-02-18 15:18:17
Message-ID: trinity-8bbef996-df74-4fca-ad7a-c17a2c9f3374-1424272697370@3capp-mailcom-lxa08
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Yes, I agree with this.
I believe  that Luhn algorithm function got check digit, so if this check digit could be placed in front this could be achieved.

regards
Peter

Sent: Sunday, February 15, 2015 at 8:22 PM
From: "David G Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] Random Number SKU Generator
Peter Dabrowski wrote
> I found one issue,
> The leading zeros are removed. expected number "00042" printed "42"

My unscientific suggestion is to combine a leading random number between 1
and 9 with the trailing 4 digit (With leading zeros) number so that you
never have the first digit of the SKU be a zero.

Too many technical issues with all numeric strings containing leading zeros;
and I think human ones too.

David J.

--
View this message in context: http://postgresql.nabble.com/Random-Number-SKU-Generator-tp5837824p5838022.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

--
Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice[http://www.postgresql.org/mailpref/pgsql-novice]

Attachment Content-Type Size
luhn.sql application/sql 2.9 KB

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Dale Hayes 2015-02-18 22:24:10 STOP
Previous Message Skylar Thompson 2015-02-17 19:55:01 Re: copy from pipe