Unix Technical Forum

trying to insert data to an AS/400 linked server

This is a discussion on trying to insert data to an AS/400 linked server within the SQL Server Data Warehousing forums, part of the Microsoft SQL Server category; --> Hi! I'm trying to insert data to an AS/400 linked server... Presently I'm able to get data from the ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server Data Warehousing

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 06:16 PM
Jean-François Mador
 
Posts: n/a
Default trying to insert data to an AS/400 linked server

Hi!

I'm trying to insert data to an AS/400 linked server... Presently I'm able
to get data from the AS/400 but unable to insert, update. There is some
T-SQL that I already try:

INSERT INTO AS400.S7828389.SYSCOSDTA.CPDBREP VALUES('03','MF','Mec
Fil.','Mécanique Filliale','TEST',1031020,' ',' ',' ');
Server: Msg 7399, Level 16, State 1, Line 1
OLE DB provider 'MSDASQL' reported an error.
[OLE/DB provider returned message: Query cannot be updated because it
contains no searchable columns to use as a key.]

SELECT * FROM OPENQUERY(AS400,'UPDATE GLMEREP SET MEEMMB = ''A'' WHERE
MEAAGL = ''03'' AND MESBMB = ''120''')
Server: Msg 7357, Level 16, State 2, Line 3
Could not process object 'UPDATE GLMEREP SET MEEMMB = 'A' WHERE MEAAGL =
'03' AND MESBMB = '120''. The OLE DB provider 'MSDASQL' indicates that the
object has no columns.

UPDATE AS400.S7828389.SYSCOSDTA.GLMEREP SET
AS400.S7828389.SYSCOSDTA.GLMEREP.MEEMMB = 'A' WHERE MEAAGL = '03' AND MESBMB
= '120';
Server: Msg 7344, Level 16, State 2, Line 4
OLE DB provider 'MSDASQL' could not UPDATE table
'[AS400].[S7828389].[SYSCOSDTA].[GLMEREP]' because of column 'MEEMMB'. The
data value violated the schema for the column.
[OLE/DB provider returned message: Multiple-step operation generated
errors. Check each status value.]

UPDATE openquery(AS400, 'select * FROM GLMEREP WHERE MEAAGL = ''03'' AND
MESBMB = ''120''') SET MEEMMB = 'A';
Server: Msg 7344, Level 16, State 2, Line 5
OLE DB provider 'MSDASQL' could not UPDATE table '[MSDASQL]' because of
column 'MEEMMB'. The data value violated the schema for the column.
[OLE/DB provider returned message: Multiple-step operation generated
errors. Check each status value.]

(MEEMMB is a 1character long field)

As you can see I tried almost any combination of UPDATE statement for a
linked server.

Thanks in advance!
Jeff





Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:46 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com