【发布时间】:2013-07-23 09:41:22
【问题描述】:
table A:
col1
_______________________
jack
1200
20
peter
2000
10
robert
300
30
到
table B :
name sal deptno
-----------------------
jack 1200 20
peter 2000 10
robert 300 30
这里我想通过使用过程参数来实现。你能帮我尝试一下,但它给出了错误。
create procedure GetDatafromtable_A(V_1 in varchar2)
as
CURSOR rwdatacursor IS select Raw_Data from table_a where rowid<=3)
T_record rwdatacursor%rowtype;
begin
open rwdatacursor;
loop
fetech rwdatacursor into T_record;
exit when rwdatacursor%NOTFUND;
insert into temp_process;
end loop
close rwdatacursor;
end;
这是我尝试过但显示很多错误的代码
【问题讨论】:
-
向我们展示您的尝试
-
并向我们展示如何关联行。我们怎么知道“jack”是
name?我们如何知道 1200 与jack而不是peter相关联?记住堆组织表中的行本质上是无序的。 -
给定的(如何将一个表中的一列数据作为 PL/SQL 中的不同列获取到另一表中)不是我的问题。更多关于该查询不回答我的问题。
-
答案必须是程序,因为这就是教师想要的。你和this guy同班吗?
标签: sql oracle plsql procedures