Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

how to use LIKE operator in the QUERY in interactive report?

How can I use LIKE operator in oracle apex interactive report QUERY in where condition

I tried this query

SELECT APPT_NO , REQUESTED_OPERATION , CLINICIAN_NAME , CLINICIAN_NAME_AR , STATUS , 
START_DATE  , CREATED_DATE , app_comment,
PRACT_FIRST_NAME_A || ' '|| PRACT_FAMILY_NAME_A as "Doctor"
FROM appt_notify
WHERE   PATIENT_Data LIKE :P39_IDNO

but its not working when I tried static data its working

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

SELECT APPT_NO , REQUESTED_OPERATION , CLINICIAN_NAME , CLINICIAN_NAME_AR , STATUS , START_DATE  , CREATED_DATE , app_comment,
PRACT_FIRST_NAME_A || ' '|| PRACT_FAMILY_NAME_A as "Doctor"
FROM appt_notify
WHERE   PATIENT_Data LIKE '%10280%'

How can I use LIKE with percentage %PAGE_ITEM% in where condition?

>Solution :

Your code will work if you pass :P39_IDNO as the value %10280% with the leading and trailing % to perform wild-card matches.

If you are passing the value 10280 then you want to concatenate the leading and trailing % characters:

SELECT APPT_NO,
       REQUESTED_OPERATION,
       CLINICIAN_NAME,
       CLINICIAN_NAME_AR,
       STATUS, 
       START_DATE,
       CREATED_DATE,
       app_comment,
       PRACT_FIRST_NAME_A || ' '|| PRACT_FAMILY_NAME_A as "Doctor"
FROM   appt_notify
WHERE  PATIENT_Data LIKE '%' || :P39_IDNO || '%'
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading