anonymous block completed [message #505105] |
Fri, 29 April 2011 07:47  |
pverma
Messages: 16 Registered: August 2010
|
Junior Member |
|
|
Hi Guru,
I am trying to run the following script but some how i am getting message: anonymous block completed. Please advise me where i am doing wrong and also please advise me how can i display the values with their column names.
set serveroutput on size 1000000
Declare
v_pr_nbr document.document_nbr%type:= ' ' ;
cursor c1 is
SELECT pr.document_dt,
pr.status_cd,
pr.document_nbr PR_Number,
da.document_nbr_dsp Award_Document_Nbr,
fi.fi_trans_amount,
decode (fi.fi_trans_type_cd, 9, 'Closeout', 5, 'Obligated', 'Not Obligated') trans_type,
vfs.fi_trans_status_message,
fi.fi_trans_post_dt,
decode (fi.fi_trans_status_cd, 2, 'Y', 'N') success
from document pr,
proc_doc_related p,
document da,
fi_trans_status fi,
Val_fi_trans_type vft,
val_fi_Trans_status vfs
where PR.OBJECT_TYPE_CD = 'PR' and
pr.document_dt >= 20071001 and
pr.document_dt <= 20110930 and
p.pr_objct_id = pr.object_id and
da.object_id = p.awd_objct_id and
fi.object_id(+) = p.awd_objct_id and
vft.fi_trans_type_cd(+) = fi.fi_trans_type_cd and
vfs.fi_trans_status_cd(+) = fi.fi_trans_status_cd
order by PR_Number;
begin
for v_rec in c1
loop
if v_pr_nbr != v_rec.PR_Number then
dbms_output.put_line( 'Document_dt'||v_rec.document_dt);
v_pr_nbr:=v_rec.PR_NUMBER ;
end if;
end loop;
end;
/
Thanks in advace.
[mod-edit: code tags added by bb; next time please add them yourself]
[Updated on: Fri, 29 April 2011 14:10] by Moderator Report message to a moderator
|
|
|
|
|
|
Re: anonymous block completed [message #505133 is a reply to message #505105] |
Fri, 29 April 2011 11:24   |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
What tool are you using, since "anonymous block completed" is not an Oracle message that I have ever seen in SQL*Plus.
Also, if your fields and columns ending in NBR/NUMBER are truly numbers, then your first declaration is invalid.
|
|
|
|
|
|