title: LISTAGG function in SQLPLUS on ORACLE 11g error
body: <p>I currently have these tables, my main aim is to automatically populate the event_item_exhibited column, by concatenating category and item_number from TABLE "ITEMS" . 
  I attempted using the LISTAGG function after much research, but I am getting ERROR at line 2:
  ORA-00909: invalid number of arguments</p>
  
  <pre><code>CREATE TABLE ITEMOWNERS (itemOwner_number INT NOT NULL CHECK(itemOwner_number &gt;= 1000 AND itemOwner_number &lt;= 2999), 
            itemOwner_name VARCHAR(30) NOT NULL,                         
            itemOwner_address VARCHAR(100) NOT NULL,
            first_contact TIMESTAMP NOT NULL,                                                         
            PRIMARY KEY (itemOwner_number));
  
  
  
  CREATE TABLE ITEMS (lent_by_itemOwner_number INT NOT NULL,
                      category CHAR (3) NOT NULL CONSTRAINT chk_category_input CHECK (category IN ('LDN','STH', 'MNC','SCT')),    
                      item_number NCHAR(3) NOT NULL UNIQUE,
                      item_name VARCHAR(30) NOT NULL UNIQUE,               
                      item_value NUMBER NOT NULL ,    
                      item_description VARCHAR(1000) NOT NULL,            
                      FOREIGN KEY (lent_by_itemOwner_number) REFERENCES ITEMOWNERS(itemOwner_number)); 
  
  CREATE TABLE EVENTS (event_number INT NOT NULL CHECK(event_number &gt;= 3000 AND event_number &lt;= 3999),
                   event_item_exhibited VARCHAR(6) ,                                      
                   title  VARCHAR(100) NOT NULL UNIQUE,                            
                   event_description VARCHAR(1000) NOT NULL,                  
                   PRIMARY KEY (event_number));
  </code></pre>
  
  <p><strong>The function I created is the following;</strong></p>
  
  <pre><code>SELECT event_number,
     LISTAGG(category, '/',item_number,',') WITHIN GROUP (ORDER BY category AND item_number) AS event_item_exhibited  
  FROM (
     SELECT UNIQUE
            event_number,
       FROM EVENTS
     )
   GROUP BY event_number;
  </code></pre>
  
  <p>I have attached a example of my aim for the output.
  <a href="http://oi44.tinypic.com/2ur2dn4.jpg" rel="nofollow">http://oi44.tinypic.com/2ur2dn4.jpg</a></p>
  
  <p><strong>Here is what I have done after your recommendation;</strong></p>
  
  <pre><code>CREATE TABLE ITEMOWNERS (itemOwner_number INT NOT NULL CHECK(itemOwner_number &gt;= 1000 AND itemOwner_number &lt;= 2999), 
            itemOwner_name VARCHAR(30) NOT NULL,                         
            itemOwner_address VARCHAR(100) NOT NULL,
            first_contact TIMESTAMP NOT NULL,                                                         
            PRIMARY KEY (itemOwner_number));
  
  
  
  CREATE TABLE ITEMS (lent_by_itemOwner_number INT NOT NULL,
                      category CHAR (3) NOT NULL CONSTRAINT chk_category_input CHECK (category IN ('LDN','STH', 'MNC','SCT')),    
                      item_number NCHAR(3) NOT NULL UNIQUE,
                      item_name VARCHAR(30) NOT NULL UNIQUE,               
                      item_value NUMBER NOT NULL ,    
                      item_description VARCHAR(1000) NOT NULL,            
                      FOREIGN KEY (lent_by_itemOwner_number) REFERENCES ITEMOWNERS(itemOwner_number)); 
  
  CREATE TABLE EVENTS (event_number INT NOT NULL CHECK(event_number &gt;= 3000 AND event_number &lt;= 3999),
                   event_item_exhibited VARCHAR(7) ,                                      
                   title  VARCHAR(100) NOT NULL UNIQUE,                            
                   event_description VARCHAR(1000) NOT NULL,                  
                   PRIMARY KEY (event_number));
  
  
  INSERT INTO ITEMOWNERS VALUES ('1001','Edward','London',CURRENT_TIMESTAMP);
  INSERT INTO ITEMOWNERS VALUES ('1002','Michael','Nottingham',CURRENT_TIMESTAMP);
  
  
  
  INSERT into ITEMS VALUES ('1001','LDN','121','Penmate','500','Unique pen');
  INSERT into ITEMS VALUES ('1002','MNC','131','Trampoline','1500','Professional equipment');
  
  
  INSERT INTO EVENTS VALUES ('3001','LDN/121','PEN SHOW', 'Exclusive show of unique pens');
  INSERT INTO EVENTS VALUES ('3002','MNC/131','Jump Club', 'Enjoy a session of tampolining');
  </code></pre>
  
  <p>Final required output is this.
  <a href="http://oi39.tinypic.com/35a80on.jpg" rel="nofollow">http://oi39.tinypic.com/35a80on.jpg</a></p>
  
  <pre><code>ITEMOWNER_NUMBER  ITEMOWNER_NAME     ITEMOWNER_ADDRESS  FIRST_CONTACT                                            
          1001      Edward             London             27-NOV-13 15.14.43.899677                                                                          
          1002      Michael            Nottingham         27-NOV-13 15.14.43.930465                                                                           
  
  
  
  LENT_BY_ITEMOWNER_NUMBER CATEGORY ITEM_NUMBER ITEM_NAME  ITEM_VALUE ITEM_DESCRIPTION
  
   1001                     LDN     121         Penmate    500        Unique pen
   1002                     MNC     131         Trampoline 1500       Professional equipment
  
  
  
     EVENT_NUMBER EVENT_ITEM  TITLE      EVENT_DESCRIPTION                                                                                               
  
             3001 LDN/121     PEN SHOW   Exclusive show of unique pens                                                                                           
             3002 MNC/131     Jump Club  Enjoy a session of tampolining                                                                                     
  </code></pre>
  
  <p>Now my whole entire question is based solely on how can I have the database populate EVENT_ITEM by it's self by merging CATEGORY &amp; ITEM_NUMBER from TABLE ITEMS into the coloumn EVENT_ITEM as shown above.</p>