0% found this document useful (0 votes)
31 views2 pages

Working 4

The document declares 5 variables - seller name, VAT number, transaction date, total, and tax. It then generates a QR code by concatenating hex values of the variables and tags. The QR code blob is stored in the variable Y and output.

Uploaded by

Nikhil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

Working 4

The document declares 5 variables - seller name, VAT number, transaction date, total, and tax. It then generates a QR code by concatenating hex values of the variables and tags. The QR code blob is stored in the variable Y and output.

Uploaded by

Nikhil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

--working with 4 values

DECLARE
P_SELLER_NAME VARCHAR2(300) := 'Bobs Records';
P_VAT_REG_NUM VARCHAR2(300) := '310122393500003';
P_TRX_DATE VARCHAR2(300) := '28-12-2021 00:00:00';
P_TRX_TOTAL NUMBER := '1000.98';
P_TAX NUMBER := '150.00';
x VARCHAR2(3200);
y CLOB;
BEGIN
dbms_output.put_line('X :'
|| x);

sELECT to_date('2022-10-12', 'RRRR-MM-DD HH:MI:SS') into P_TRX_DATE FROM DUAL;


/* Select (LTRIM ( TO_CHAR
(P_TRX_TOTAL,'9,999,999,999,999,999,999,999,999.99'))) INTO P_TRX_TOTAL from dual;
dbms_output.put_line('P_TRX_TOTAL :'
|| P_TRX_TOTAL);
*/

SELECT XXAR_INV_PRINT_VLVS_IN_PKG.base64_encode_blob (ZT_QR.f_qr_as_bmp (


(SELECT
(UTL_RAW.cast_to_varchar2 (

UTL_ENCODE.base64_encode (

(SELECT --for Tag =1; CASE has been used to prefix 0 so that 1 converts to 01 in
hex otherwise QR will not be read correctly

(select case when (length(trim(to_char(1,'xx'))) =1) then '0'||


trim(to_char(1,'xx')) else trim(to_char(1,'xx')) end from dual)
--Convert Length of Seller Name to Hex
||(select case when (length(trim(to_char(length(P_SELLER_NAME), 'xx'))) =1) then
'0'||trim(to_char(length(P_SELLER_NAME), 'xx'))
else trim(to_char(length(P_SELLER_NAME), 'xx')) end from dual)
--Convert value to hex
||rawtohex(P_SELLER_NAME)
--
||
(select case when (length(trim(to_char(2,'xx'))) =1) then '0'||
trim(to_char(2,'xx')) else trim(to_char(2,'xx')) end from dual)
--Convert Length of Seller Name to Hex
||(select case when (length(trim(to_char(length(P_VAT_REG_NUM), 'xx'))) =1) then
'0'||trim(to_char(length(P_VAT_REG_NUM), 'xx'))
else trim(to_char(length(P_VAT_REG_NUM), 'xx')) end from dual)
--Convert value to hex
||rawtohex(P_VAT_REG_NUM)
--
/*
||
(select case when (length(trim(to_char(3,'xx'))) =1) then '0'||
trim(to_char(3,'xx')) else trim(to_char(3,'xx')) end from dual)
--Convert Length of Seller Name to Hex
||(select case when (length(trim(to_char(length(P_TRX_DATE), 'xx'))) =1) then
'0'||trim(to_char(length(P_TRX_DATE), 'xx'))
else trim(to_char(length(P_TRX_DATE), 'xx')) end from dual)
--Convert value to hex
||rawtohex(P_TRX_DATE)
--*/
||(select case when (length(trim(to_char(4,'xx'))) =1) then '0'||
trim(to_char(4,'xx')) else trim(to_char(4,'xx')) end from dual)
--
--
||(select case when (length (trim(to_char(length(P_TRX_TOTAL), 'xx'))) =1) then
'0'||trim(to_char(length(P_TRX_TOTAL), 'xx'))
else trim(to_char(length(P_TRX_TOTAL), 'xx')) end from dual)
--||trim(to_char(length('2393014.22'), 'xx'))
||rawtohex(to_char(P_TRX_TOTAL))
--
||(select case when (length(trim(to_char(5,'xx'))) =1) then '0'||
trim(to_char(5,'xx')) else trim(to_char(5,'xx')) end from dual)
--
--
||(select case when (length (trim(to_char(length(P_TAX), 'xx'))) =1) then '0'||
trim(to_char(length(P_TAX), 'xx'))
else trim(to_char(length(P_TAX), 'xx')) end from dual)
--||trim(to_char(length('2393014.22'), 'xx'))
||rawtohex(to_char(P_TAX))
--

FROM DUAL)--

)))

QRDATA
FROM DUAL),
'L'))
QRCODE
INTO Y
FROM DUAL;
dbms_output.put_line('Y :'
|| y);
END;

You might also like