Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to merge record with SQL statement?

Status
Not open for further replies.

HKNinja

MIS
Nov 17, 2002
148
US
Hi guys,

This is what I'm trying to accomplished. I have an Excel file with about 2000 lines of items. It contains two columns, part_no and location. I want to delete these 2000 items from the database using the following statment.

DELETE FROM xxxx_sq WHERE item_no = 'part_no' and loc = 'location'

Is there any good way to merge the Excel records into the statement instead of typing them? What I'm looking for is kind of like Mail Merge function in Word, but I don't know if there is any SQL developer tools to do that.

Any help will be great! Thanks!
 
I think the easiest solution would be to pull the rows in the Excel file into a temporary table. Then join the table you want to delete from to that temp table and delete as needed.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top