By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 816 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

SQL question... batch query...

P: n/a
I have a problem that probably has a simple solution but I don't have
much SQL experience...
My company's database is pretty crummy, based on Access97 .MDB files
with a VB front-end. My company sends updates to our clients every
month via e-mail, over the past 7 years a lot of the addresses have
gone out of use and we get more and more bounce-backs. We are looking
to update our contact database but our old database does not allow us
to search by email address. However, I can query the database for an
address and spit back the info we need.

Anyway, I've taken all of the bounce back emails and wrote a TCL script
to extract the addresses (670 in all) and have them listed (1 addresses
per line) in a text file.

I am using Excell 2003 with Microsoft Query and had TCl generate SQL
code to Query my dB for every address and spit them back. I get the
'Query too complex' error because I have 670 'OR' clauses. I understand
that this is probably not the best way to do this.

Finally, my question is... is there a way to create a SQL loop to
extract a line from a file at a time, query the database for that text,
return what is necessary, then process the next line in the file. I'm
looking to do batch querying on a database, returning a lot of data
based upon roughly 670 individual queries. Possible?

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

Link to the text file.
Join the text file to your query.

No need for the OR statements.

br***@powercareers.com wrote:
Anyway, I've taken all of the bounce back emails and wrote a TCL script
to extract the addresses (670 in all) and have them listed (1 addresses
per line) in a text file.
I am using Excell 2003 with Microsoft Query and had TCl generate SQL
code to Query my dB for every address and spit them back. I get the
'Query too complex' error because I have 670 'OR' clauses. I understand
that this is probably not the best way to do this.
Finally, my question is... is there a way to create a SQL loop to
extract a line from a file at a time, query the database for that text,
return what is necessary, then process the next line in the file. I'm
looking to do batch querying on a database, returning a lot of data
based upon roughly 670 individual queries. Possible?


Nov 13 '05 #2

P: n/a
Can you show me an example of this? Thank-you

Nov 13 '05 #3

P: n/a
An example of what? The SQL query?

UPDATE [myTable]
INNER JOIN [myTextFile] ON [myTable].[email] = [myTextFile].[email]
SET [myTable].[email] = Null
br***@powercareers.com wrote:
Can you show me an example of this? Thank-you


Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.