Home » SQL & PL/SQL » SQL & PL/SQL » Getting Errors in PL/SQL Collections code Execution
Getting Errors in PL/SQL Collections code Execution [message #238859] Sun, 20 May 2007 11:02 Go to next message
world.apps
Messages: 70
Registered: January 2007
Location: Hyderabad
Member
Hi,

I am trying to execute the fallowing two programs but i am getting errors. Could anybody help me in this?

Program:1


SQL> DECLARE
  2  TYPE clientele IS TABLE OF VARCHAR2 (64);
  3  client_list_12 clientele := clientele('Customer1', 'Customer 2');
  4  BEGIN
  5  IF 'Customer 1' MEMBER OF client_list_12 THEN
  6  DBMS_OUTPUT.put_line ('Customer 1 is in the 12 list');
  7  END IF;
  8  IF 'Customer 3' NOT MEMBER OF client_list_12 THEN
  9  DBMS_OUTPUT.put_line ('Customer 3 is not in the 12 list');
 10  END IF;
 11  END;
 12  /
DECLARE
*
ERROR at line 1:
ORA-06550: line 5, column 17:
PLS-00103: Encountered the symbol "MEMBER" when expecting one of the following:
. ( * @ % & = - + < / > at in is mod not rem then
<an exponent (**)> <> or != or ~= >= <= <> and or like
between ||



Program:2


  1  DECLARE
  2     TYPE NumList IS TABLE OF NUMBER;
  3     depts NumList := NumList(10, 20, 50);
  4  BEGIN
  5     FORALL j IN depts.FIRST..depts.LAST
  6     IF DEPTS(j)=50 then
  7        UPDATE emp SET sal = sal * 1.10 WHERE deptno = depts(j);
  8     END IF;
  9     --IF SQL%BULK_ROWCOUNT(3) = 0 THEN
 10       --exit;
 11     --END IF;
 12* END;
SQL> /
DECLARE
*
ERROR at line 1:
ORA-06550: line 6, column 2:
PLS-00103: Encountered the symbol "IF" when expecting one of the following:
. ( * @ % & - + / at mod rem select update with
<an exponent (**)> delete insert || execute save merge
ORA-06550: line 13, column 0:
PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following:
end not pragma final instantiable order overriding static
member constructor map



Thanks in advance
Re: Getting Errors in PL/SQL Collections code Execution [message #238861 is a reply to message #238859] Sun, 20 May 2007 11:40 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Oracle version (4 decimals) is a prerequisite for any question.

1. Only available in 10g.
2. Don't use FORALL use FOR ... LOOP ... END LOOP;

Regards
Michel
Previous Topic: junk characters passed over db link
Next Topic: Nested Queries Type I and II
Goto Forum:
  


Current Time: Sat Dec 10 14:54:36 CST 2016

Total time taken to generate the page: 0.05380 seconds