Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

apex_string: apex_t_varchar2 and apex_t_number

SmithJohn45Jun 7 2024 — edited Jun 7 2024

during my search for Apex_String i read that there are 2 types apex_t_varchar2 and apex_t_number types, i saw these first time

ref: https://docs.oracle.com/database/apex-18.1/AEAPI/APEX_STRING.htm#AEAPI-GUID-CAFD987C-7382-4F0F-8CB9-1D3BD05F054A

when i searched for these 2 types i found a link where Author: Philipp Hartenfeller showed some examples, i tried to follow on livesql.oracle.com , the first one is showing no data found but 2nd is showing data as expected. only difference in both SQL statement is apex_string.split and apex_string.split_numbers

so, what's wrong with first which shows no data found?

first sql statement which is not showing data:

with emp as (Select '101, 102, 116' val from dual)
select employee_id, first_name||' '||last_name emp_name, hire_date, salary from hr.employees e, emp m 
where e.employee_id member of (
   apex_string.split(m.val, ','));

2nd sql statement which works fine:

with emp as (Select '101, 102, 116' val from dual)
select employee_id, first_name||' '||last_name emp_name, hire_date, salary from hr.employees e, emp m 
where e.employee_id member of (
   apex_string.split_numbers(m.val, ','));

please help to understand.

regards

Comments
Post Details
Added on Jun 7 2024
3 comments
1,510 views