I appreciate your response. I have my password set to my email address 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, formats an excel worksheet, and auto emails reports to the field by id group (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 sent to that specific individual. So, I have a test process that queries the database and loads a list of distinct id's into an array. The email addresses are id@...com. So 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 the title of the file to the correct id and emails it to the correct address. I want to have the select * from table where id = id. ...Where 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 selects 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 emails 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 search at home and found this posting. I know the prepare statement should probably should not be done in a while loop or a loop for that matter. 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 pass 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 placeholder and updated each time the array index incremented. But is looks like that is a bad idea. Please help!!!! i.e. @id = ('A01','B55') Thank you for your advice.