title: concatenate the output values in oracle plsql
body: <pre><code>create table item_value_tab
  as
  select 1110 Item_value,000394 bb_to_no, 55555 order_number, 'ABC' cust_no from dual
  union all
  select 1110 Item_value,000394 bb_to_no, 66666 order_number, 'ABC' cust_no from dual
  union all
  select 1110 Item_value,000394 bb_to_no, 77777 order_number, 'ABC' cust_no from dual
  union all
  select 1110 Item_value,000123 bb_to_no, 1111 order_number, 'ABC' cust_no from dual
  union all
  select 1110 Item_value,000124 bb_to_no, 2222 order_number, 'ABC' cust_no from dual
  union all
  select 1110 Item_value,000124 bb_to_no, 3333 order_number, 'ABC' cust_no from dual
  union all
  select 1110 Item_value,000011 bb_to_no, 75257 order_number, 'ABC' cust_no from dual
  union all
  select 1110 Item_value,000011 bb_to_no, 65257 order_number, 'ABC' cust_no from dual;
  </code></pre>
  
  <p>Take below code in Cursor 1</p>
  
  <pre><code>SELECT DISTINCT DECODE(nvl(Item_value,0),bb_to_no,null,'Item  Value '||nvl(bb_to_no,0)||' Is not correct for order number '||order_number||' FOR Customer  '||cust_no) vmsg
  from item_value_tab;
  </code></pre>
  
  <p>Getting Output</p>
  
  <pre><code>Item Value 000394 Is not correct for order number 55555 FOR Customer  ABC
  Item Value 000394 Is not correct for order number 66666 FOR Customer  ABC
  Item Value 000394 Is not correct for order number 77777 FOR Customer  ABC
  
  Item Value 000123 Is not correct for order number 1111 FOR Customer  ABC
  Item Value 000124 Is not correct for order number 2222 FOR Customer  ABC
  Item Value 000124 Is not correct for order number 3333 FOR Customer  ABC
  
  Item Value 000011 Is not correct for order number 75257 FOR Customer  ABC
  Item Value 000011 Is not correct for order number 65257 FOR Customer  ABC
  -------------------------------------------------------------------------------
  create table item_not_tab
  as
  select 0 item_id,53555 bb_to_no,1052 order_number,'AAA' cust_no from dual
  union all
  select 0 item_id,53655 bb_to_no,1138 order_number,'AAA' cust_no from dual;
  
  Need to take the below code in cursor 2
  select DECODE(nvl(item_id,0),0,'items not created for  '||bb_to_no||'order number '||order_number||' FOR Customer  '||cust_no,NULL) vmsg
  from item_not_tab;
  </code></pre>
  
  <p>Getting Output</p>
  
  <pre><code>items not created for 53555 order number 1052 FOR Customer  AAA
  items not created for 53655 order number 1052 FOR Customer  AAA
  </code></pre>
  
  <p>Expected output</p>
  
  <pre><code>Item Value Problems
  Item Value 000394 Is not correct for order number 55555,66666,77777 FOR Customer  ABC
  Item Value 000123,000124 Is not correct for order number 1111 FOR Customer  ABC
  Item Value 000124 Is not correct for order number 2222,3333 FOR Customer  ABC
  Item Value 000011 Is not correct for order number 75257,65257 FOR Customer  ABC
  
  Items not found Problems
  items not created for 53555,53655 order number 1052 FOR Customer  AAA
  </code></pre>
  
  <p>note: please don't joins both tables in one cursor, I need to take 2 cursors. Both tables are same actually, but test case purpose I have as 2 d/f tables</p>
  
  <p>oracle 11g 1.1 and 1.2 </p>