Quote:
Originally Posted by meanSpleen
What I tried was
Code:
UPDATE micros.dev_def
SET d.lan_node_seq = l.lan_node_seq
FROM micros.dev_def d JOIN micros.lan_node_def l
WHERE d.obj_num = 100;
Which failed because I didn't specify the ip address
and
Code:
UPDATE micros.dev_def
SET d.lan_node_seq = l.lan_node_seq
FROM micros.dev_def d JOIN micros.lan_node_def l
WHERE d.obj_num = 100 and l.ip_addr = '192.168.100.100';
Which failed for some reason
I'm not really sure if the following would even work, because I have no idea how to format it to SQL's liking
Code:
UPDATE micros.dev_def
SET lan_node_seq = (FROM micros.lan_node_def WHERE ip_addr = '192.168.100.100')
WHERE obj_num = 100;
Any thoughts out there? I can do simple updates and insert, but when it comes to cross referencing tables I get horribly lost.
|
I haven't worked with Sybase before, so I'm not exactly sure what type of SQL statements you can use. However, I'm pretty sure an UPDATE statement can't include a FROM clause regardless of what database system you're using, so I think your SQL statements are failing because of a syntax error.