I'm not sure what you mean.
Do you want a simple stored procedure with no parameters that executes that single insert statement?
--------------------------
--set up test
drop table tab1;
create table tab1(col1 char(1));
drop table tab2;
create table tab2(col1 char(1));
insert into tab1 values('a');
commit;
--create procedure
create or replace procedure junk as
begin
insert into tab2 (col1) (select col1 from tab1 );
commit;
end;
/
show errors
--test it
select * from tab2;
exec junk;
select * from tab2;
Main Topics
Browse All Topics





by: YANN0SPosted on 2007-08-03 at 08:48:32ID: 19626035
I don't know if I'm missing something, but it is simple. The following is a PL/SQL block:
OVS',1,'ZL A',2,99), j_date),'D D'),
BEGIN
INSERT INTO MONTHLY_VOLUMES_CBW
(pid, api14, api12, api10, name, ptype, prod_inj_date, scenario, DSSSOURCE, daysinmonth, days_prod)
SELECT DISTINCT TRIM(w.PID),
substr(w.pid,1,14),
substr(w.pid,1,12),
substr(w.pid,1,10),
w.NAME,
'COMP',
m.prod_inj_date,
'SCHEDULER',
decode(m.source,'TOW',1,'C
to_char(last_day(m.prod_in
nvl(m.days_prod,0),
FROM ods.monthly_volumes m, compmaster w
WHERE w.PID = m.API_NO14 AND m.prod_inj_date is not null;
COMMIT;
END;
/