Home » Developer & Programmer » Forms » ORA-01001 invalid cursor error
ORA-01001 invalid cursor error [message #80427] Thu, 19 September 2002 08:44 Go to next message
saritha
Messages: 15
Registered: October 2001
Junior Member
I am getting ORa-01001 Invalid Cursor error. It used to work fine before. some changes were made to the database and platform. Do you think this will have effect?

PROCEDURE post_to_treasury (payin_dt in date,records_processed out number)
IS
cursor cur_post_payins is
select
(p.payin_prefix||'-'||p.pw_payin_no) dept_payin_no,
to_date(p1.tc_tran_date,'DD-MON-YY')pay_date,
p.pw_cr_deb_ind,
(p1.totamtpd-(nvl(p.pw_amount,0))) payin_amount,
p.post_flag,
ltrim(rtrim(substr(tc_line_rev_acct_no,1,5),'-'),'-') gl_Fund_code,
ltrim(rtrim(substr(tc_line_rev_acct_no,7,4),'-'),'-') gl_org_code,
ltrim(rtrim(substr(tc_line_rev_acct_no,12,5),'-'),'-') gl_acct_code,
ltrim(rtrim(substr(tc_line_rev_acct_no,17,3),'-'),'-') gl_prog_code,
'one stop payins-'||(p.payin_prefix||'-'||p.pw_payin_no) payin_comment
from payin_withdrawal p, payin1 p1
where p1.tc_tran_date(+)= p.pw_payin_Date
and p1.tc_line_rev_acct_no(+) = p.pw_rev_Acct_code
and p.post_flag='N'
and to_date(p1.tc_tran_date,'DD-MON-YY')=to_date(payin_dt,'DD-MOn-YY')
for update of post_flag, date_posted,posted_by;
--i number;
payin_line number:=0;
id_time_stamp varchar2(20);
seq_num number:=0;
cnt_rec number;
n_cpt number:=0;
n_step number;
post_by varchar2(80);
cnt number;
BEGIN
id_Time_Stamp := To_Char(To_Date(To_Char(Sysdate,'MMDDYYYY'),'MMDDYYYY'),'YYYYMMDDHH24MISS');
select user into post_by from user_users;
cnt:= cur_post_payins%rowcount;
For i In Cur_post_payins
Loop
message('in then loop.....');
seq_num:= seq_num+1;
payin_line:=payin_line+1;
Insert Into ts_external_payins@tcsh
(dept_payin_no,payin_line_no,payin_Date, cr_dr_flag,
payin_amount, post_flag, gl_fund_code, gl_Org_code,
gl_acct_code,gl_prog_code,payin_comment)
Values
(i.dept_payin_no,payin_line,i.pay_date,i.pw_cr_deb_ind,
abs(i.payin_amount),'N',i.gl_fund_code,
i.gl_Org_code, i.gl_acct_code, i.gl_prog_code,i.payin_comment);

Update payin_withdrawal
Set Post_Flag ='Y', date_posted =id_time_stamp,posted_by =post_by
Where Current Of Cur_post_Payins;

End Loop;
commit;
records_processed:= seq_num;

END;

I need to insert the fetched records into a table directly, I am inserting.

Pls ,let me know ASAP
Re: ORA-01001 invalid cursor error [message #80428 is a reply to message #80427] Thu, 19 September 2002 08:59 Go to previous messageGo to next message
Sameer
Messages: 60
Registered: March 1998
Member
Check if all the objects r valid which r used in the cursor.
Re: ORA-01001 invalid cursor error [message #80431 is a reply to message #80427] Thu, 19 September 2002 11:44 Go to previous messageGo to next message
ram kumar
Messages: 113
Registered: August 2002
Senior Member
hi saritha,
i tired to refer %rowcount before u open cursor so u got error invalid cursor place it in proper palce after u open the cursor.. i mean
any way check u'r mail if u have time
i am sending sample example..
hope u got it
regards
ram
Re: ORA-01001 invalid cursor error [message #80698 is a reply to message #80427] Mon, 04 November 2002 03:39 Go to previous message
karan
Messages: 5
Registered: April 2001
Junior Member
you have not opened cursor.
pls insert a line
"open cur_post_payins;"
before using the cursor
Previous Topic: clob
Next Topic: Exporting Data from EXCEL file into ORACLE TABLE
Goto Forum:
  


Current Time: Sat May 18 18:15:27 CDT 2024