473,383 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Import specific colums

Hi,

I have a DB table called 'OPERATOR' that has several columns. Two of those columns are called OPERATOR_ID and WINDOWS_USERID.

I am trying to take an external csv file that contains only these two fields and import them into the table setting the windows_userid in my table equal to the windows_userid in my csv.

I've also created a temporary table with the csv data, which contains the two columns, but can't seem to figure out how to take the two columns from that table and import it into the other.
Mar 3 '10 #1

✓ answered by wrangler2004

OK, I figured it out.

I guess I could have used DB2 merge, but I opted for the simpler approach with an update statement:

DB2 UPDATE TARGETTABLE.OPERATOR A SET WINDOWS_USERID=
(SELECT EMP_ID FROM SOURCETABLE B WHERE A.OPERATOR_ID=B.ID)

2 3758
@wrangler2004
I'm sure I need to use an 'update' statement on the target table, but can't seem to figure out how.

The following select statement does pull in the information i need...if I can only merge the data:

SELECT TABLE1.OPERATOR_ID, TTABLE1.WINDOWS_USERID, USERLIST1.ID, USERLIST1.EMP_ID
FROM MYSCHEMA.TABLE1 AS OPERATOR, MYSCHEMA.USERLIST1 AS USERLIST1
WHERE TABLE1.OPERATOR_ID = USERLIST1.ID
Mar 3 '10 #2
OK, I figured it out.

I guess I could have used DB2 merge, but I opted for the simpler approach with an update statement:

DB2 UPDATE TARGETTABLE.OPERATOR A SET WINDOWS_USERID=
(SELECT EMP_ID FROM SOURCETABLE B WHERE A.OPERATOR_ID=B.ID)
Mar 4 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: BUSHII | last post by:
I have big problem. In database MyDB.mdb I have table for example: ORDERS with colums: - Id int - Name varchar(20) Also I create same table in SQL Server 2k. I can manualy export this data...
0
by: Bernard Dhooghe | last post by:
In http://www-1.ibm.com/partnerworld/pwhome.nsf/weblook/eac_a_webcast_052504.html the writer says (page 50, Multidimensional Clustering Advisor): " The MDC Advisor feature of the DB2 Design...
4
by: mibispam | last post by:
Hello, I'm trying to import a textfile into an Access table. I want to write a macro to do all the work automatically. My textfile looks like that: artNr;description;sellingValue...
1
by: basulasz | last post by:
May be it is a bit easy question but i don't know the way to display data in bounded colums. I get data from DB with a datareader, and I want to display them on bounded colums. I dont want to...
2
by: flamingmo | last post by:
Hi Everyone, it's my first post, so please be kind... :-) I've had a look through the board and although CSS importing has been covered in quite a few topics, I have what I think is a unique...
0
by: Eran.Yasso | last post by:
Hello all, This is my first time using listview. I was looking in google for a way to write to a specific column. I have 3 columns in my list view. I want to be able to write to a specific...
2
by: Quique | last post by:
Hello, I've got a problem importing a worksheet Excel into a temporary table in access. All the information is imported but the table is not ordered as it is originally in excel. I'm using a...
0
by: zafar | last post by:
I don't know what property should be used for hiding colums in Data Grid, whereas in Data Grid View we have DataGridView1.Colums(index).Visible = False , But how can I hide Colums in Data Grid.....
1
by: arshigill | last post by:
I want to import data from excel file inot mysql database table but unable to solve this problem. I have searched google and find an example of importing of CSV excel file. But when I modify it...
3
by: arvinder | last post by:
HI All, I am new to .net, I got a project in which i need to import dynamically excel file into sql table. Like user will select the excel file and the sql table, then all the columns from excel...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.