Skip to main content
Participant
July 31, 2008
Question

Coldfusion Script

  • July 31, 2008
  • 3 replies
  • 719 views
Hey everyone, I am on a month long project on a coldfusion script I have to work on. Bare with my noobness here 😛 Basically here is the jist of it.

-- I have a huge sql database filled with various random people information, such as their phone #"s, email addresses, name, etc...this database it might be going off from could be anywhere from 8,000-15,000 users on it that it will be going off from.

--From time to time I will get a list of say 200-300 email addresses sometimes it can go up to 3000 email addresses from the database whose emails are bounced.

--Now what I am trying to do here is ..making a script where when you input this large list of email addresses, whether it be .txt or just copying it and pasting it into a form with all the bad email addresses...you hit submit..and the system automatically would search the user from its main database to see if it finds the email address, and if it does it retrieves the phone # for that specific person that's stored on the database and outputs it back into the page so every email that's been submitted returns back with a email address and phone # right next to each other...

How complicated would this be to make such a script? ANY help / suggestions / advice / or the jist of what I'm going to be dealing with would be MUCH appreciated.


Thanks
This topic has been closed for replies.

3 replies

Inspiring
August 1, 2008
RedDem0n wrote:
> I will get a list of ... email addresses sometimes it can go
> up to 3000 email addresses

I do not know if performance is a consideration here. But using a large IN clause may have a significant impact on query performance. Of course that is assuming your database will even allow that many values in an IN clause.

You might also investigate your database's capabilities with text files. Some databases like ms sql, et.al. can query text files or load data from text files into a table. Then you could use a JOIN approach as opposed to an IN clause. Just something to consider..

Inspiring
August 3, 2008
@RedDem0n - I sent you a private message.
Inspiring
August 1, 2008
You use the sql keyword "in". If you don't know how to do that, I've heard good things about the book, Teach Yourself SQL in 10 Minutes by Ben Forta.
Inspiring
July 31, 2008
My approach would be to present a textarea for the email addresses.

Then on the action page.
Step 1 - create a workable list from the form submission. Start by changing all the carraige returns to commas. Then get rid of the empty fields and any white space that might mess you up.

Step 2 - loop through this list and create a new list that contains only items that look like a proper e-mail address.

Step 3 - run a query that gets the phone numbers.

Step 4 - output your query results
RedDem0nAuthor
Participant
August 1, 2008
Right now basically heres what i have done so far
I am able to enter one email address in, it queries the database..and outputs the email with the matched phone # from the database in a table on a webpage

so my question is...how do i make it so i can add multiple email addresses in the form submission and have it so it queries multiple entries and outputs it all on the table? (this is all being done on a webpage)