表sms 字段有 id,name 历史表sms_his 字段有id,name,record_date
所有字段都是varchar2类型create or replace procedure a
is
V_a sms%rowtype;
begin
select * into V_a from sms where id='1';
insert into sms_his values(V_a.id,V_a.name,to_char(sysdate,'yyyymmddhh24miss'));
end;
存储过程这个插入语句有没有更简便的写法呢?
所有字段都是varchar2类型create or replace procedure a
is
V_a sms%rowtype;
begin
select * into V_a from sms where id='1';
insert into sms_his values(V_a.id,V_a.name,to_char(sysdate,'yyyymmddhh24miss'));
end;
存储过程这个插入语句有没有更简便的写法呢?
is
begin
insert into sms_his
select id,name,to_char(sysdate,'yyyymmddhh24miss') from v_a where id=1;
commit;
end;
select id,name,to_char(sysdate,'yyyymmddhh24miss') from v_a where id=1;
没有v_a这个表