Go Back   CodingForums.com > :: Server side development > MySQL > Other Databases

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-30-2005, 06:21 AM   PM User | #1
neocool00
Regular Coder

 
Join Date: Sep 2004
Posts: 152
Thanks: 0
Thanked 0 Times in 0 Posts
neocool00 is an unknown quantity at this point
DTS Help

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.

Thanks,
Neo
neocool00 is offline   Reply With Quote
Old 08-30-2005, 07:23 PM   PM User | #2
nikkiH
Senior Coder

 
nikkiH's Avatar
 
Join Date: Jun 2005
Location: Near Chicago, IL, USA
Posts: 1,973
Thanks: 1
Thanked 32 Times in 31 Posts
nikkiH is on a distinguished road
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...?)
__________________

If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit
http://www.kaelisspace.com/
nikkiH is offline   Reply With Quote
Old 08-30-2005, 08:07 PM   PM User | #3
neocool00
Regular Coder

 
Join Date: Sep 2004
Posts: 152
Thanks: 0
Thanked 0 Times in 0 Posts
neocool00 is an unknown quantity at this point
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.
neocool00 is offline   Reply With Quote
Old 08-31-2005, 05:08 PM   PM User | #4
nikkiH
Senior Coder

 
nikkiH's Avatar
 
Join Date: Jun 2005
Location: Near Chicago, IL, USA
Posts: 1,973
Thanks: 1
Thanked 32 Times in 31 Posts
nikkiH is on a distinguished road
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.
__________________

If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
Bored? Visit
http://www.kaelisspace.com/
nikkiH is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:45 PM.


Advertisement
Log in to turn off these ads.