Updating query

rebounder

New member
Local time
Today, 11:39
Joined
Jan 15, 2007
Messages
2
Hi all,
I have been trying to make 2 tables join (the end goal is to overwrite some data in one table, with data in another). The table layouts are as follows

Table: dbo_device
dev_name (prim key)
dev_ip_address
dev_memory

Table: firmware
name (prim key)
fware

All data types are matching, so that shouldnt be the problem. I want to grab the value fware from the firmware table and put it into the dbo_device 'dev_memory' field, where the dev_name & name are the same. Here is my query...

------------------SQL---------------------------------

UPDATE dbo_device
SET dev_memory = f.fware
FROM firmware f
INNER JOIN dbo_device d ON d.dev_name = f.name

------------------/SQL---------------------------------
I am getting the error 'Syntax error (missing operator) in query expression 'f.fware FROM firmware f
INNER join dbo_device d ON d.dev_name = f.name'

Any help would be greatly appreciated!
Thanks
 
Try this:
FROM dbo_device d
INNER JOIN firmware f ON d.dev_name = f.name
 
Thanks for your help FoFa. Unfortunately though, I still receive the same error :confused:. Simplifying the query makes the query view work (it lists all the results I want to combine - but whenever I try to overwrite values with the new ones, the errors start). Is this type of query possible to accomplish? I dont understand what the missing operator is (syntax error).
Thanks again
 
rebounder said:
Thanks for your help FoFa. Unfortunately though, I still receive the same error :confused:. Simplifying the query makes the query view work (it lists all the results I want to combine - but whenever I try to overwrite values with the new ones, the errors start). Is this type of query possible to accomplish? I dont understand what the missing operator is (syntax error).
Thanks again

I don't understand the error myself, but would the query work if you wrote it this way?

Code:
UPDATE dbo_device
SET dev_memory = (SELECT fware FROM f)
WHERE EXISTS (dbo_device.name = f.name)
 
Sorry, try qualifying your update field
SET d.dev_memory = f.fware
 

Users who are viewing this thread

Back
Top Bottom