0

Hi,

I'm getting the following error "" for the query as shown below. Any help is very much appreciated.

SET SERVEROUTPUT ON;

DECLARE
       v_CARE_COUNT NUMBER := 0;
       v_PHONE VARCHAr2(40) := NULL;
BEGIN
      select  count(distinct care_level) 
         into v_CARE_COUNT
      from Table1 
       where user_id = '100';

      IF(v_CARE_COUNT > 0) THEN

         select phone into v_PHONE 
         from Table2 
         where care_level in 
           (select distinct care_level from Table1 where user_id = '100')
         and rownum = 1;
      ELSE
         select phone into v_PHONE
          from Table2
         where care_level = 'default'
      END IF;
      DBMS_OUTPUT.PUT_LINE('PHONE is <'||v_PHONE||'>');
 EXCEPTION
 WHEN OTHERS THEN
      DBMS_OUTPUT.PUT_LINE('Exception : '||SQLERRM);
 END;
2
Contributors
1
Reply
13
Views
3 Years
Discussion Span
Last Post by dev90
0

provide your table structure and values and input value.And expected output.
OR
You can try to search error from error log also.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.