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

Problem updating remote table using linked server and 4 part naming Expand / Collapse
Author
Message
Posted Wednesday, May 21, 2008 1:02 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, June 26, 2008 4:15 PM
Points: 1, Visits: 14
I have a linked server setup to an informix database. When I use 4 part naming to update an informix table, the wrong row is getting updated in a specific scenerio.

update ERP_TRNG.fms441.informix.csta_user_whse
set whse_code = '2323'
where csta_user_whse_id = 'gfdsa'

csta_user_whse_id is the primary key on the table and is defined as char(10).

If the row with the key 'gfdsa' is the last row in the table, the update statement will alter the first row in the table. If I use a key that is not the last row, then the update works fine.

If I run the above statement, the first row (the csta_user_whse_id value is '5') will be updated. If I then insert another row to the table:

INSERT INTO ERP_TRNG.fms441.informix.csta_user_whse
VALUES ('asdfg', '0500')

and then do my update on 'gfdsa', the correct row is updated.

If I didn't see it for myself, I'd think this is all just crazy talk.

Thanks
Post #504768
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse