today:
25,672
yesterday:
36,697
Total:
9,616,905

Oracle APEX SQL

You could do a count(*) instead

declare
  l_cnt integer;
begin
  select count(*)
    into l_cnt
    from items
   where id_referencia = :P2_REFERENCIA;

  if( l_cnt >= 1 )
  then
    return true;
  else 
    return false;
  end if;
end;

If you really wanted to do an exists, you'd do something like this. I don't know why you'd want to do this assuming that id_referencia is the primary key of the table. But you could

declare
  l_exists integer;
begin
  begin
    select 1
      into l_exists
      from dual
     where exists( select 1
                     from items
                    where id_referencia = :P2_REFERENCIA );
  exception
    when no_data_found
    then
      l_exists := 0;
  end;

  if( l_exists = 1 )
  then 
    return true;
  else
    return false;
  end if;
end;
No. Subject Author Date Views
92 SELECT last_name FROM admin 2018.12.12 1969
91 IMP admin 2018.10.08 1927
90 CREATE TABLE admin 2018.09.25 1652
89 Change Admin PASSWORD admin 2018.07.31 1353
88 VERY IMPORTANT admin 2018.06.26 1310
87 IF/ELSE ... CASE WHEN admin 2018.06.25 943
86 MISSIONARY_SUB admin 2018.06.25 1207
85 eeeeee admin 2018.06.21 1173
84 TABLE PRINT admin 2018.06.18 1357
83 GP PRINT admin 2018.05.31 2257
82 How to convert DATE to NUMBER admin 2018.05.27 1341
81 DATE Compare admin 2018.05.22 1514
80 If you want to use EXISTS in a PL/SQL function returning BOOLEAN admin 2018.05.19 1242
» use a validation function for an element in apex 5.0 admin 2018.05.19 1221
78 Validation to detect text in numeric field admin 2018.05.19 1388
77 All Data DELETE from Table admin 2018.05.10 1265
76 Process admin 2018.05.05 1231
75 Oracle SQL Developer: Online Migration 3.1 admin 2018.04.25 1441
74 How to Update Oracle XE admin 2018.04.25 1226
73 Oracle APEX 5.1.4 Installation admin 2018.04.17 1209