INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Copy data from one server to another

Copy data from one server to another

(OP)
Is there any way to copy data from one DB2 server to another using SQL?

Basically, I want to have an insert statement in this vein...

CODE

INSERT INTO Server1.Database1.TableA
(Column1,
Column2,
Column3)
SELECT Data1,Data2,Data3
FROM Server2.Database2.TableA

Any ideas?

RE: Copy data from one server to another

khsaunderson,
I've not tried this, and I think you may have to look into what Frederico says above, but I've read that you can create a nickname for a remote table. The command takes the format:
CREATE NICKNAME remotename FOR unixserver.database.table

If you are able to issue such a command, then you would theoretically be able to insert straight into whatever you used as your 'remotename'.

Let us know how you get on.

Marc

RE: Copy data from one server to another

(OP)
Thanks for your responses.  I've tried the CREATE NICKNAME remotename FOR unixserver.database.table statement and I got an error

SQL0104 - Token NICKNAME was not valid. Valid tokens: VIEW ALIAS TABLE SCHEMA UNIQUE ENCODED.

I've tried googling this and nothing comes up for it, which is strange.

Ta
Kate  

RE: Copy data from one server to another

(OP)
Oh, and I forgot to say - yes, the OS and version are the same on both systems.  It's just a move from test to prod.

Thanks

RE: Copy data from one server to another

What is the OS and version?

RE: Copy data from one server to another

(OP)
V5R3M0...
 

RE: Copy data from one server to another

And what platform are you? Mainframe, Unix, Windows etc.

RE: Copy data from one server to another

(OP)
I'm going to sound thick now, but how would I know?  Sorry, am not sat with the dev team...

I have tried running it in SqlDbx from my PC and then I have also tried it directly on the AS400 SQL screens.   

RE: Copy data from one server to another

My fault I think as I didn't really understand the format of your previous answer.

So, I think that what you are saying is that it is a AS400 DB2 system that you access from an app on your windows PC.

Have you tried accessing it with the apps that you've got? We've got DB2 subsystems here called DB2T and DB2P and from either of those systems I can access data on the other by adding the subsystem to the table qualifier e.g. when in DB2T I issues the select:
SELECT * FROM DB2P.SYSIBM.SYSDUMMY1

Not sure if I can help further as I have no knowledge of AS400 systems.

Marc

RE: Copy data from one server to another

(OP)
"So, I think that what you are saying is that it is a AS400 DB2 system that you access from an app on your windows PC."

Yep, that's right.

I've tried accessing it through the app, which is basically directly through the AS400 system...

Thanks for trying :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close