PL/BARCODE Is Out!

PL/BARCODE is now available for Oracle Database and Oracle APEX. It generates 13 types of linear and 2D barcodes directly in PL/SQL and returns PNG images or vector PDFs. Use a product code already stored in Oracle to show a scannable barcode in a stock report and print the same code on the label attached to the item.

13 formats for product, inventory and payment data

The seven linear formats are Code 128, GS1-128, EAN-13, UPC-A, Code 39, ITF and POSTNET. Code 128 works for alphanumeric product codes and warehouse identifiers. For retail data, PL/BARCODE calculates a missing EAN-13 or UPC-A check digit and validates an existing one. Keep these identifiers in a text column so that any leading zeroes are carried into the barcode.

On a GS1-128 shipment label, a single scan can carry an item identifier, an expiration date and a lot number. Your application assembles those fields into a GS1 element string, and PL/BARCODE encodes that string into the symbol.

The six 2D formats are QR Code, Swiss QR, Micro QR, Data Matrix, PDF417 and Aztec Code. A QR code can open a product page from a label or screen, and Micro QR fits short payloads in a smaller symbol. Data Matrix can encode compact item identifiers, while PDF417 can carry a longer payload such as batch details. Aztec supports Compact and Full symbols for uses such as tickets. Swiss QR encodes a prepared Swiss Payments Code payload for use in a QR-bill.

Show barcodes in Oracle APEX

Each of the 13 formats has its own Oracle APEX Template Component plug-in. In Page Designer, choose the format you need and map its Data attribute to a source column. The plug-in uses the column value to request a PNG from PL/BARCODE and displays it on the page.

Our product demo uses this in two places. The Interactive Report displays PRODUCT_CODE as a Code 128 barcode in each row. Clicking a product ID opens its detail page, where the QR Code plug-in encodes PRODUCT_URL. Scan the code with a phone to open the product link. The same setup can display a shipment identifier in a report or a service link on an equipment detail page.

Because the barcode is generated from the source value, a change to the product URL appears in the QR code the next time the page renders. The link is maintained with the product record, just like the other values on the detail page.

The available settings depend on the format. For Code 128, you can select a code set or let PL/BARCODE choose it automatically. For QR Code, you can set the error correction level and control the image dimensions by changing the number of pixels per module. Configure these options once for the component so they apply to every row it renders.

Generate PNG and vector PDF in PL/SQL

The PL/SQL API works in database jobs and document-generation routines as well as in APEX applications. For example, a call to PL_BARCODE.GENERATE_QR_PNG with a URL produces a PNG BLOB. An application can store the image with a record, stream it to the browser or pass it to a label-generation workflow.

For printing, generate a standalone one-page PDF BLOB. Its bars and modules are drawn as vector shapes, so they stay sharp when resized. If you already use PL/DOC, you can draw the symbol directly inside an invoice, inventory report or packing slip. Place it beside the product number, shipment details or payment instructions that people need to read before scanning.

For a label or document layout, allow room for the quiet zone, the clear margin around the symbol. PL/BARCODE lets you set the margin in modules, so you can account for it when placing the barcode alongside a description or other printed fields.

Try PL/BARCODE with your own data

The product page shows how to encode a URL once in PL/SQL and render it as both PNG and vector PDF. To see how the two outputs fit your workflow, start with a value from an existing record. Display the PNG on screen and print the PDF at the size you use for labels or documents. Scan both versions with the device your users work with.

Explore PL/BARCODE