Subject Re: [firebird-support] Field for BarCode
Author Paul Schmidt
On Thu, 2003-07-24 at 23:15, Ryan Nilsson-Harding wrote:
> Hi there.
>
> I am nearing the end of the primary development of my app. Testing
> will begin in about a month or so.
>
> In the future, I would like to add a barcode scan ability to my app.
> I will be setting all of this up in a later release, but I would like
> to have the table structure ready now, for when I do this later.
>
> I'm gathering I will be using a BLOB field (sub_type binary)
> Can anyone give me any relevant pointers on storing barcode data?
> Is this field all thats needed, as far as FB is concerned, to store
> this kind of data?
>
> Is there anything tricky needed for this blob field? Do I need a
> filter of any kind?

Why store the barcode, why not the data the barcode represents?

Barcodes themselves are a way of representing data, you will find it
much more efficient to have your application contain a way to generate
the proper barcode from the data, then simply store the data and
regenerate the barcode as needed. For example say I am storing the
number 22376877175 this can be stored in a 64bit int, which is 8 bytes,
maximum 11 bytes if you stored it as ASCII. However a barcode takes up
a lot more then 11 bytes, and you are restricted to the same size and
format of barcode.

PaulS