title: Dynamicly Fill Array From Table at PL/SQL?
body: <p>i need to pass array values dynamic at this PL/SQL CODE But the Array Just See The First Value the code  : Hint( The code is big so i cut it at the issue part)please </p>
  
  <p>if you need more information Kindly Ask me,Here is my try to pass it Dynamic.</p>
  
  <p>Variable fill code:</p>
  
  <pre><code>FOR ET IN (SELECT   EMAIL
                 FROM   XX_INTERCO_SYS_CON
                WHERE   ACC_NO = Q.ACC_NO AND TYPE = 'TO')
    LOOP
       IF P_TO IS NOT NULL
       THEN
          P_TO := P_TO || ',''' || ET.EMAIL||'''';
       ELSE
          P_TO := ''''||ET.EMAIL||'''';
       END IF;
    END LOOP;
  
    FOR EC IN (SELECT   EMAIL
                 FROM   XX_INTERCO_SYS_CON
                WHERE   ACC_NO = Q.ACC_NO AND TYPE = 'CC')
    LOOP
       IF P_CC IS NOT NULL
       THEN
          P_CC := P_CC || ',''' || EC.EMAIL||'''';
       ELSE
          P_CC := ''''||EC.EMAIL||'''';
       END IF;
    END LOOP;
  </code></pre>
  
  <p>The Array fill part :</p>
  
  <pre><code>XX_MAIL_PKG.SEND (P_FROM        =&gt; P_FROM,
                      P_TO          =&gt; XX_MAIL_PKG.ARRAY ( P_TO),
                      P_CC          =&gt; XX_MAIL_PKG.ARRAY (P_CC),
                      P_SUBJECT     =&gt; 'test',
                      P_HTML_MSG    =&gt; P_HTML_OUTPUT,
                      P_SMTP_HOST   =&gt; P_SMTP_HOST,
                      P_SMTP_PORT   =&gt; P_SMTP_PORT,
                      P_TEXT_MSG    =&gt; NULL,
                      X_ERR_MSG     =&gt; X_ERR_MSG);
    COMMIT;
    DBMS_OUTPUT.PUT_LINE (X_ERR_MSG); 
  </code></pre>