Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

connection error with oracle

$
0
0
hi,
friend,

i have created a procedure, the code is given below..

create or replace procedure emp_history_rec
(
gpfaccno OUT varchar2,
name OUT Varchar2,
designation OUT varchar2,
total OUT NUMBER,
total2 OUT NUMBER,
total3 OUT NUMBER)
is
StoO_selcnt INTEGER;
StoO_error INTEGER;
StoO_rowcnt INTEGER;
StoO_crowcnt INTEGER := 0;
StoO_fetchstatus INTEGER := 0;
StoO_errmsg VARCHAR2(255);
StoO_sqlstatus INTEGER;
emcode varchar2(20);
date1 date;

gpfaccno_query varchar2(20);
code_query varchar2(20);
name_query varchar2(20);
designation_query varchar2(20);
total_query number;

gpfaccno_query1 varchar2(20);
code_query1 varchar2(20);
name_query1 varchar2(20);
designation_query1 varchar2(20);
total_query1 number;


g_account varchar2(20);
c_code varchar2(20);
n_name varchar2(20);
d_designation varchar2(20);
t_total number;
t_total2 number;
t_total3 number;
--cursor
cursor c1 is
select distinct(code) from pms_employee_rec where INSTITUTECODE='09';
begin
for emp in c1
loop
--dbms_output.put_line('vishwas' ||emp.code);

select decode(max(emptnfrcntpstldate),'',to_date('01/01/2001','mm-dd-YYYY'),max(emptnfrcntpstldate)) into date1 from
(select e.* from pms_employee_rec e where e.INSTITUTECODE='09' and code=emp.code and emptnfrcntpstldate<=to_date('December-2011','month-YYYY ')) sa ;
--dbms_output.put_line('vishwas' ||date1);

with a as
(SELECT pm.gpfaccno,pm.code,pm.name,pm.designation,SUM(pe. VALUE) as total into gpfaccno_query,code_query,name_query,designation_q uery,total_query
FROM PMS_EMP_SALITEM_DET pe join pms_employee_rec pm on pe.EMPID=pm.id
WHERE pe.SALARYITEMID IN (5) AND pe.EMPID IN (SELECT pi.id from pms_employee_rec pi
where pi.INSTITUTECODE='09' and emptnfrcntpstldate=date1) AND PAYROLLID IN (SELECT pp.ID FROM PMS_PAYROLL pp
WHERE (pp.YEAR=(to_char(to_date('December-2011','mm-YYYY'),'YYYY')) and
(pp.month=(to_char(to_date('December-2011','mm-YYYY'),'mm'))))

) group by pm.name,pm.gpfaccno,pm.designation,pe.empid,pm.cod e
),
b as
(SELECT pm.gpfaccno,pm.code,pm.name,pm.designation,SUM(pe. VALUE) as total2 into gpfaccno_query1,code_query1,name_query1,designatio n_query1,total_query1
FROM PMS_EMP_SALITEM_DET pe join pms_employee_rec pm on pe.EMPID=pm.id
WHERE pe.SALARYITEMID IN (78) AND (pe.EMPID IN (SELECT pi.id from pms_employee_rec pi
where pi.INSTITUTECODE='09' and emptnfrcntpstldate=date1)) AND PAYROLLID IN (SELECT pp.ID FROM PMS_PAYROLL pp
WHERE (pp.YEAR=(to_char(to_date('December-2011','mm-YYYY'),'YYYY')) and
(pp.month=(to_char(to_date('December-2011','mm-YYYY'),'mm'))))

) group by pm.name,pm.gpfaccno,pm.designation,pe.empid,pm.cod e
)
select a.gpfaccno,a.name,a.designation,a.total,b.total2,( a.total+b.total2) into g_account,n_name,d_designation,t_total,t_total2,t_ total3
from a
inner join b on a.code=b.code order by name_query
;

end loop;
end;

and when i compile it the connection is break(i.e session is out).i want to know that my procedure is wrong or (with query is not supported in oracle 10 g).i check my log file in oracle the error msg is "ORA:07445"
can u tell me what is the problem?

Viewing all articles
Browse latest Browse all 13329