Solved

using openquery to update AS400 table

Posted on 2002-05-22
5
928 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
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
johan_brohn earned 50 total points
Comment Utility
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
Comment Utility
how?
Any Code you can provide to help?
0
 
LVL 1

Expert Comment

by:johan_brohn
Comment Utility
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
Comment Utility
0
 
LVL 1

Author Comment

by:shirlng
Comment Utility
thanks so mucn, sorry for the delay.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

772 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now