I appreciate your response. I have my password set to my email addres +s at work. I also left my laptop at work. So therefore, I can't get + to it. Secondly, I already have a process that works great and the +syntax is correct. I will post it on Monday. I apologize. Here is +what I am doing...I have a process that pulls data from oracle, forma +ts an excel worksheet, and auto emails reports to the field by id gro +up (District Manager, Regional Manager, VP, etc…). Currently, all of + the email addresses are hard coded and they are sent by group. The +business owner wants the reports to be tailored to individuals and se +nt to that specific individual. So, I have a test process that queries the database and loads a list o +f distinct id's into an array. The email addresses are id@...com. S +o that part is easy. By using a loop, I can successfully pass the id + to the Perl code and update the correct email heading and changes th +e title of the file to the correct id and emails it to the correct ad +dress. I want to have the select * from table where id = id. ...Whe +re the id is specific to the array index. I don’t want to use an IN +‘id’ for all id’s that match. Currently, the test sql process select +s the first array index for the id, but no data returns for the next +ids. So, only id 1 (array index '0') has data. The rest of the emai +ls return no data. I just need help dynamically selecting info for a + specific id. The current process works, but I need it to be dynamic +. I hope this helps you understand. I will send the code. Will you + help me? I have worked on this all week. I just happen to do a sea +rch at home and found this posting. I know the prepare statement sho +uld probably should not be done in a while loop or a loop for that ma +tter. But I am not sure how to approach the loop. I basically took +the current process that works and tried to wrap it into a loop and p +ass the new id from the distinct list to the sql statement and email. + The email process works, but the prepare sql statement only returns + the first index. I thought that the $value could be used with a pla +ceholder and updated each time the array index incremented. But is l +ooks like that is a bad idea. Please help!!!! i.e. @id = ('A01','B55') Thank you for your advice.

In reply to Re^4: SQL queries using dynamic array by Anonymous Monk
in thread SQL queries using dynamic array by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.