08-30-2005, 07:21 AM
I've got a | delimited file that I am using to import into a sql table. The problem is that there are three fields (UPC, Location & QOH) that I am concerned with. The table that I need to update, I have to first convert the UPC in the file to an id located in another table and then convert the Location into another id located in a third table and then update the QOH based on the two ids in the first table. I know how to do a straight import from a text file into a single table, but I can't figure out how to look up the values in the other two tables for the reference fields. Any help would be greatly appreciated.
08-30-2005, 08:23 PM
I don't think you can do that without using a language of some kind, whether PL/SQL/equivalent or something higher-level, like PHP. Not just a straight import.
Personally, I'd throw together a quick script in Perl, PHP, ASP, or whatever I had available.
What DBMS are you using? You didn't say. (unless DTS is a db...?)
08-30-2005, 09:07 PM
It's a SQL 2000 db. The project that I am working on the client wants to automate the upload of the file into the database. But with the fields not matching up and having to look up the ids from other tables, I don't know excatly how to do this.
08-31-2005, 06:08 PM
I'd use ASP.net or PHP or something to process the file, personally.
Whatcha got on the server? Even perl or regular ASP...
They upload the file, the server-side script parses it out and uploads it. Otherwise I don't know if you can do that with fields not matching and all. At the very least you'd need a stored procedure that executes to do the lookups.