x
login about faq Site discussion (meta-askssc)

Cannot delete from table in DB2 using openquery

Hi all, Can someone please help???

I am trying to delete all data from table in DB2 using openquery in SP: EXEC(' DELETE FROM OPENQUERY(DMFRC1,'' SELECT * FROM USRMNT.UNIQ_AH_ACCT '') ')

Receiving the following error: Cannot execute the query " SELECT * FROM USRMNT.UNIQ_AH_ACCT

" against OLE DB provider "IBMDADB2.DB2COPY1" for linked server "DMFRC1". The provider could not support an interface required for the UPDATE/DELETE/INSERT statements.The provider indicates that conflicts occurred with other properties or requirements.The provider could not support deletion on this table.The provider indicates that conflicts occurred with other properties or requirements.

more ▼

asked Dec 27 '10 at 09:36 AM in Default

FlexAZ gravatar image

FlexAZ
11 1 1 1

(comments are locked)
10|1200 characters needed characters left

1 answer: sort voted first

You probably want to do this using a pass-through query against DB2 instead.

Have a look at EXECUTE AT (http://msdn.microsoft.com/en-us/library/ms188332.aspx ) which is a way to use EXECUTE with a DELETE-statement, passing the name of a linked server as a parameter.

Like this:

EXECUTE('DELETE FROM USRMNT.UNIQ_AH_ACCT') AT DMFRC1
more ▼

answered Dec 27 '10 at 10:39 AM

Magnus Ahlkvist gravatar image

Magnus Ahlkvist
13.7k 13 17 30

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x26
x16

asked: Dec 27 '10 at 09:36 AM

Seen: 1474 times

Last Updated: Dec 27 '10 at 09:36 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.