-
December 7th, 2011, 12:00 AM
#1
debuggin pl/sql procedure
Please help me understand what is the error in the below procedure. I get error during compiling. Following 3 error arises-
1) PL/SQL: ORA-00942: table or view does not exist
2) PLS-00364: loop index variable 'X' use is invalid
3) PL/SQL: ORA-00984: column not allowed here
create or replace
procedure test_parallel( p_size in number )
is
l_job number;
job_size number;
begin
--DBMS_OUTPUT.put_line (tracepkg.enbl_trace);
job_size:=p_size;
for x in (
select dbms_rowid.rowid_create
( 1, data_object_id, lo_fno, lo_block, 0 ) min_rid,
dbms_rowid.rowid_create
( 1, data_object_id, hi_fno, hi_block, 10000 ) max_rid
from (
select distinct grp,
first_value(relative_fno)
over (partition by grp order by relative_fno, block_id
rows between unbounded preceding and unbounded following) lo_fno,
first_value(block_id )
over (partition by grp order by relative_fno, block_id
rows between unbounded preceding and unbounded following) lo_block,
last_value(relative_fno)
over (partition by grp order by relative_fno, block_id
rows between unbounded preceding and unbounded following) hi_fno,
last_value(block_id+blocks-1)
over (partition by grp order by relative_fno, block_id
rows between unbounded preceding and unbounded following) hi_block,
sum(blocks) over (partition by grp) sum_blocks
from (
select relative_fno,
block_id,
blocks,
TRUNC ( (sum(blocks) over (order by relative_fno, block_id)-0.01) / (sum(blocks) over ()/job_size) ) grp
from dba_extents
where segment_name = upper('source')
and owner = user order by block_id
)
),
(select data_object_id
from user_objects where object_name = upper('source') )
)
loop
dbms_job.submit( l_job, 'test_direct(JOB);' );
insert into parameter(job, lo_rid, hi_rid) values ( l_job, x.min_rid, x.max_rid );
commit;
end loop;
end test_parallel;
--execute test_parallel(4);
-
December 7th, 2011, 01:14 AM
#2
Re: debuggin pl/sql procedure
You'll have better luck with this question over on the database forum. Also please use [code] and [/code] tags around your code segments to preserve formatting and make it more readable.
Best Regards,
BioPhysEngr
http://blog.biophysengr.net
--
All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|