Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

New to using OPENQUERY. Need a small example of how to grab, convert, pass data to SQL.

Posted on 2008-09-30
4
655 Views
Last Modified: 2012-08-13
I'm very new to using IBM Syntax, specifically a need for OPENQUERY.
I would appreciate it if someone could show me a small example of how to grab, convert, pass data to SQL.
I listed exactly what I'm trying to do below. Many thanks to whoever could help. :)
Wally
---------------------------------------------------------
SOURCE IBM DB2 DATABASE I want to convert/pull data from:
---------------------------------------------------------
IBM DB = SD0D1, Two Tablenames = Dist_State & Dist_State_Nodes. 
Two Columns (data I want to convert/import). Column 1 = Dist_State.LABEL (Unicode String, Length = 32) Values contained here are just application names (i.e. MSOFFICE). Column 2 = Dist_State_Nodes.Node_Name (Unicode String, Length = 251). Values contained here are Computer Name (i.e. JOESPC).
 
---------------------------------------------------------
DESTINATION SQL DATABASE I want to Convert/Import data to:
---------------------------------------------------------
SQL DB Name = DMS, Two Tablenames = Dms.dbo.Node.Name (Varchar(75), not null) &  Dms.dbo.Packages.Name (Varchar(251), not null). 
Both of these columns will need to have an PK/Identity Seed.
 
I need to figure out how to use OPENQUERY to convert/import data by getting data from
(DB2) Dist_State.LABEL --> (SQL) Dms.dbo.Packages.Name db/table/column AND
(DB2) Dist_State_Nodes.Node_Name --> (SQL) Dms.dbo.Nodes.Name.

Open in new window

0
Comment
Question by:wally_davis
  • 2
  • 2
4 Comments
 
LVL 37

Expert Comment

by:momi_sabag
ID: 22606956
what do you mean by the identity seed?
0
 

Author Comment

by:wally_davis
ID: 22607011
By Identity Seed I mean Auto Row numbering.
0
 
LVL 37

Accepted Solution

by:
momi_sabag earned 500 total points
ID: 22607754
take a look here
http://www.mcpressonline.com/database/db2/db2-integration-with-sql-server-2005-part-i-linked-server-enhancements.html

regarding the identity columns, just define them as you would with any other table
0
 

Author Closing Comment

by:wally_davis
ID: 31501614
Momi, Thank you for the link. It gives a a nice place to start.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
grant user read only access to DB2 V 8.02 10 1,046
AS400 Forms 9 134
Continuously query a database in Java 10 163
CATALOG A DB2 TCPIP NODE with AN ALIAS 2 134
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question