Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Updating AS/400 Linked Server Tables from SQL Server Expand / Collapse
Author
Message
Posted Sunday, March 12, 2006 5:50 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, June 01, 2011 12:38 PM
Points: 44, Visits: 25
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/bHullur/updatingas400linkedservertablesfromsqlserver.asp
Post #265107
Posted Wednesday, April 05, 2006 3:26 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, August 04, 2008 10:26 AM
Points: 4, Visits: 2

I am using Linked Server to update AS/400 tables since a lot.
The only problem I found is that the Table on AS/400 has to be "journaled".

You can achieve this with the STRJRNPF command onto the AS/400

Marco

 

Post #271170
Posted Wednesday, April 05, 2006 3:36 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, July 08, 2008 2:37 AM
Points: 1, Visits: 4

Marco - What do you mean by "Journaled"

 

Martin

Post #271172
Posted Wednesday, April 05, 2006 6:43 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, June 01, 2011 12:38 PM
Points: 44, Visits: 25

Hi Martin:

In the scenario described in the article, journaling was not turned on. The AS400 person did not want to turn it on for some reason and I had to work within that constraint. I did read about it and tried my best to get it turned on.

Thanks,

Basu

Post #271214
Posted Wednesday, April 05, 2006 9:46 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, January 09, 2013 5:52 AM
Points: 4, Visits: 10

Hi.

I use Microsoft OLE DB Provider for DB2  (DB2OLEDB) for linking to AS/400 from SQL-Server 2000

I use OpenQuery for all reading (best performance)

Have no problem with updating the way described in the article, exept for performance on large tables.

Anyone know how to process a pass-through update query ?

That should be fast even in large/huge tables !

/PG

Post #271321
Posted Wednesday, April 05, 2006 9:54 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 9:28 AM
Points: 902, Visits: 972

Journaling is how the AS/400 tracks activity against a table.  The journal then can be used in recovering a table by either applying activities or removing them.  If a table is not journaled, then you only have the backups to recover from.  I guess you could compare this to Simple versus Full recovery mode on SQL Server.

It's been a while since I've worked on the AS/400 so IBM may have changed how this works.

David




Post #271324
Posted Wednesday, April 05, 2006 10:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, October 03, 2008 3:55 PM
Points: 8, Visits: 3

Journaling is required for a table to be updated/deleted in AS400.  Effectively if journaling is off for the table it is read-only through DB2. 

One other problem I've run across when updating to the AS400 had to do with the setup of the ODBC driver itself.  For the iSeries ODBC driver verision 9.00.00.00 there are settings that can cause diffculty and seem to work for updating or selection, but not both.  In the Performance tab, under the Advanced button, these are the settings:

Open All Cursors as updateable --Set ON for update, Off for select

Retrieve extended column information --set ON for update, Off for select

I've had to set up 2 different datasources, one for read, and another for write.  If anyone else has run into this and solved it, or if there's a version up that's fixed this I'd love to know.

-Larry Smith

Post #271329
Posted Wednesday, April 05, 2006 12:38 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Yesterday @ 7:19 AM
Points: 36, Visits: 203
where it is true that Journaling needs to be enabled on the table for it to be updated, it is not correct to say that table is read-only.

I have the very same issue with as400 and after some searching had made several discoveries.

1. You can update the table in as400 even if Journaling is not turn on , but ony if you are sing ADO recordset object.
I do not remember the settings that need to configured for it to work , but I know it's possible.

2. the reason you have an issues with updating table in t-SQL is becouse of the SQL server ways of executing the queries.

SQL server when executing queries against linked tables and/or ODBC connected tables in as400 DB require the query to be logged and commited in specific way, and it's requires a proper response from query engine , the as400 engine dose not send the proper response back if the table is not Journaled, thus making the SQL server think that query is not successfull becouse the talbe is read-only.

I have found no other way to make this work but to enable Journaling on the table.
Post #271367
Posted Monday, April 10, 2006 2:05 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, February 24, 2014 1:52 AM
Points: 21, Visits: 268

We are using Linked Server to update AS/400 tables since a lot. We have "Jornaling" for all updateble AS/400 tables


The only problem we found is to implement DISTRIBUTED TRANSACTION between SQL Server 2000/2005  and AS/400. If anyone else has run into this and solved it ?

Oleg




Post #272142
Posted Wednesday, May 17, 2006 1:44 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, January 09, 2013 5:52 AM
Points: 4, Visits: 10

Hi.

I have problem when updating large tables (> million rows) using traditional

4 level naming in update like:
UPDATE  AS400.S1019865.NSCDEVDATA.WSZZP100
SET ZZSSRV = '2006-02-08 09:00:19'

It works but is very slow.

It seems like all data first is retrieved to SQL-Server, updated at SQL-Server and then finally sent back to the AS/400 and comitted.

Do any one know a working pass-through-method for updating ?

I've tried using openquery like:
Select * from OPENQUERY(AS400, '
UPDATE  AS400.S1019865.NSCDEVDATA.WSZZP100
SET ZZSSRV = ''2006-02-08 09:00:19'' ')

It does not work.

Any suggestions ?

Post #280613
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse