Create QR Code in Oracle Database. Pure PLSQL code.





To View how we generate a qr code from db and shown in the report, look here.

In this blog, we will be Generating QR code from our Oracle database. 
Thanks to zorantica for the awesome package which generates the QR code using a PL/SQL. Visit his profile to say thanks if this helps you out.

Let’s do it.


  1. Download the package from github ( https://github.com/zorantica/plsql-qr-code )
  2. Extract and Install the package in database
  3. Generate the qr code samples.


As always , let’s do it with some screenshots.


Open the plsql-qr-code repository by zorantica  from https://github.com/zorantica/plsql-qr-code




Download the repository as ZIP


Extract Files


Go to the folder which have the oracle database package files.



PKS file is the package specification and PKB is package body. Execute the package in database PKS first and PKB second. I am doing it in Toad for oracle. you can use your own editors.



Package is created in our database.


Functions to return qr code are

  1. HTML code CLOB- f_qr_as_html_table
  2. BMP image as BLOB – f_qr_as_bmp
  3. BMP image as long row – f_qr_as_long_raw
  4. SVG resizable as CLOB – f_qr_as_svg

you can check the PKS file for the detailed parameter descriptions and usage.



Let me show a bmp qr code generated through the package.


select ZT_QR.f_qr_as_bmp ( p_data => 'https://oraclescribble.blogspot.com/', -- varchar2, --data going to be encoded into QR code p_error_correction => 'L', -- varchar2, --L, M, Q or H p_margines => 'N' -- varchar2 default 'N' --margines around QR code (4 modules) - values Y or N ) as blob_qr From Dual;


Save as BMP to check the qr code.


In the downloaded package, there is an APEX plugin too. If you are using Apex, you can use the same.


If you have any queries, please let me know through the comments.


Next Post Previous Post
No Comment
Add Comment
comment url