Solved

using openquery to update AS400 table

Posted on 2002-05-22
5
952 Views
Last Modified: 2008-02-01
Is there a way to using openquery to update a specific record in AS400?

Or anyway using T-SQL to update an individual record in AS400?

Any help will be greatly appreciated.
0
Comment
Question by:shirlng
[X]
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
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
johan_brohn earned 50 total points
ID: 7032330
You should be able to use OpenQuery and/or OpenRowset
to update the AS400 if you can access the AS400 with ODBC.
0
 
LVL 1

Author Comment

by:shirlng
ID: 7046978
how?
Any Code you can provide to help?
0
 
LVL 1

Expert Comment

by:johan_brohn
ID: 7047127
Step 1.
Create an ODBC System DSN for the AS 400 on your machine.
U must have the ODBC drivers installed.

Step2.
Add linked server. Choose 'OLE DB Provider for ODBC' and
enter the default database name in the 'Catalog:' field.
Enter the name of the DSN in the 'Data source field:'.

Select the Security tab for the linked server and check the lowest radio button ('be made using ....') and enter username and password.

Step 3.
Test the linked server.

Step 4
UPDATE OPENQUERY(NameOfLinkedServer,
'SELECT Field FROM DB.Schema.Table')
SET FIELD = Value

OR JUST USE

UPDATE NameOfLinkedServer.DB.Schema.Table
SET FIELD = Value
0
 
LVL 1

Expert Comment

by:johan_brohn
ID: 7047137
0
 
LVL 1

Author Comment

by:shirlng
ID: 7074144
thanks so mucn, sorry for the delay.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

734 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