不用存储过程就可以了
create table t1 as select * from t2;
create table t1 as select * from t2;
解决方案 »
- =================动态sql into 数组=================
- 在Oracle中实现吸血鬼算法
- 问个SQL语句的写法
- LOAD DATA和控制文件的问题
- windows 2003 重装后,oracle恢复,找了好多,没有合适的答案
- 如何导出角色的脚本,急!!!!!!!!
- pl/sql dev 中test window 和 sql window编写脚本有什么差别???
- oracle数据库的用户登陆问题
- 初级问题:如何用sql plus建数据库
- oracle 查詢event的語法錯誤
- ora-01033:oracle initialization or shutdown in progress
- 请问如何在Oracle中的控制台上写这样的查询语句
as
type rec is record(
name t1.name%type,
age t1.age%type);
rec1 rec;
begin
select name, age into rec1 from t1 where name=myname
if sql%found then
begin
insert into t2(name, age)
values (rec1.name, rec1.age);
end;
end if;
exception
when no_data_found then
begin
null ;
end;
end jiaonadyj;
可以根据自己的需求更改一下.
create procedure fromtableinserttotable
(
ID in varchar2 ---表1中已有记录的ID号
)
is
begin
-我要根椐这个ID 号从表1中提取的一条记录插入到表2中,
而且两个表结构不完全相同end
as select b.col1,b.col2,...from table_b b
error:Compilation errors for PROCEDURE HISDICT.SET_ZY_PATIENTINHOS_ADVICEError: Compilation errors for PROCEDURE HISDICT.SET_ZY_PATIENTINHOS_ADVICEError: PLS-00103: 出现符号 "AS"在需要下列之一时:
,;returnreturning
Line: 139
Text: as select z.begin_person, z.advice_propery, z.item_type_name, z.item_type_code,z.item_name,
insert table_a values(b.col1,b.col2,.....)
select b.col1,b.col2,...from table_b b
,;returnreturning
怎么写??
??? --这里怎么写?
from t1
where id = v_id