title: How to insert SELECT LISTAGG values to varchar variable
body: <p>I am writing an Oracle user defined function. How can I insert listtagg values Pears, Oranges, Bananas, Apples into a variable products and return in function. </p>
  
  <pre><code>products VARCHAR2(4000);
  BEGIN
  SELECT LISTAGG(product_name, ', ') WITHIN GROUP (ORDER BY product_name DESC) "Product_Listing"
  FROM products;
  RETURN products;
  </code></pre>