Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UPDATE OPENQUERY mulitiple tables ?!?

Status
Not open for further replies.

saustin

MIS
Feb 19, 2001
336
US
Hi,
Have no problem running the openquery code below.


Declare @query varchar(8000)
Declare @pID varchar(20)
Declare @pLINE varchar(5)
Declare @oDESIREDRCVDATE varchar(10)
Declare @pSTATUSX varchar(1)
Declare @pSTATUSC varchar(1)

Set @pID='NYDELLTEST'
Set @pLINE='1'
Set @oDESIREDRCVDATE='2006-03-25 00:00:00.000'
Set @pSTATUSX='X'
Set @pSTATUSC='C'

set @query = 'UPDATE OPENQUERY(VMFG, ''SELECT DESIRED_RECV_DATE from PURC_ORDER_LINE WHERE PURC_ORDER_ID=''''' + @pID + ''''' AND LINE_NO=''''' + @pLINE + ''''''')'
set @query = @query + 'SET DESIRED_RECV_DATE = '''+@oDESIREDRCVDATE + ''''

exec(@query)

If however you need to include a second table for the update selection criteria (join on a field) what is the syntax or is this not possible ?

Thnaks, Steve.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top