怎样实现。。。。功能 (100分)

  • 主题发起人 主题发起人 dxd0222
  • 开始时间 开始时间
D

dxd0222

Unregistered / Unconfirmed
GUEST, unregistred user!
在sql plus中(pl/sql)怎样访问ODBC连接??????????



在oracle中实现sql server的类似功能:
UPDATE titles
SET price = price * 2
FROM titles INNER JOIN publishers ON titles.pub_id = publishers.pub_id
AND pub_name = 'New Moon Books'

tab1:
1 a
1 b
2 c
3 d

tab2:
1 aa
2 bb
3 cc

我想update语句实现修改tab1为下面的结果:
tab1:
1 aa
1 aa
2 bb
3 cc

请大虾帮忙

 
可以这样:
UPDATE titles
SET price = price * 2
FROM titles where titles.pub_id in (select publishers.pub_id
from publishers where pub_name = 'New Moon Books')
或者
UPDATE titles
SET price = price * 2
FROM titles where exists (select 'x'
from publishers where pub_id = titles.pub_id and pub_name = 'New Moon Books')
 
UPDATE titles
SET price = price * 2
FROM titles INNER JOIN (select pub_id from publishers where pub_name = 'New Moon Books') publishers ON titles.pub_id = publishers.pub_id
 
tab1:
1 a
1 b
2 c
3 d

tab2:
1 aa
2 bb
3 cc

我想update语句实现修改tab1为下面的结果:
tab1:
1 aa
1 aa
2 bb
3 cc

请大虾帮忙
 
UPDATE titles
SET pub_name= publishers.pub_name
FROM titles,publishers
where publishers.pub_id = pub_name.pub_id
 
FROM titles,publishers
*
ERROR 位于第 3 行:
ORA-00933: SQL 命令未正确结束
 
UPDATE titles
SET pub_name= select publishers.pub_name
FROM titles,publishers
where publishers.pub_id = pub_name.pub_id
 
update tab1
set name = (select name from tab2 where tab2.id = tab1.id)
 
在sql plus中(pl/sql)怎样访问ODBC连接??????????
 
应该只能通过用C或Java写DLL,DLL访问ODBC连接,再DLL给PL/SQL调用了吧
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部