Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ORA-01023: Cursor context not found (Invalid cursor number)

Status
Not open for further replies.

hibaba

Programmer
Jan 1, 2002
1
0
0
US
Hi Guys,
I am getting this following error
ORA-01023: Cursor context not found (Invalid cursor number) when I want to try a call Package from asp page.

Bellow is my code.please suggest me the solution
/* package head*/
PACKAGE JUV_T1SEARCH_PKG
AS

cursor c1 is
SELECT 'CaseNumber_byCaseNumber' as Record_Type,
NVL(cs.otcscrtcod,' ') as court_code,
NVL(to_char(dd.otdddefnbr),' ') as id_number,
NVL(cs.otcscasnbr, ' ') as case_number,
NVL(cs.case_type, ' ') as case_type,
NVL(cs.case_category,' ') as case_category,
'0' as name_sequence_number,
NVL(nm.otnmlstnam, ' ') as last_name,
NVL(nm.otnmfirnam, ' ') as first_name,
NVL(nm.otnmmidnam,' ') as middle_name,
NVL(nm.otnmbusind,' ') as business_indicator,
NVL(dd.otddownrsp,' ') as owners_name,
NVL(nm.otnmdefdob,' ') as date_of_birth,
NVL(ds.otdsdefsex,' ') as sex,
NVL(dd.otddwarind,' ') as warrant_indicator,
NVL(cs.otcsfildat,' ') as case_file_date,
NVL(ch.otchchgstt,' ') as count_1_statute,
NVL(ch.otchcharge,' ') as count_1_charge,
NVL(dd.otdddefsta,' ') as defendant_status
from icmsotcs cs, icmsotnm nm , icmsotdd dd , icmsotds ds , icmsotch ch

UNION ALL
SELECT 'CaseNumber_byCaseNumber' as Record_Type,
icmscicr.cicrcrtcod as court_code ,
NVL(to_char(icmscipy.cipyptyuid), ' ') as id_number ,
NVL(icmscipy.cipycasnbr, ' ' ) as case_number ,
NVL(icmscipy.cipycastyp, ' ') as case_type ,
NVL(icmscicr.case_category, ' ') as case_category ,
'0' as name_sequence_number,
NVL(icmscipy.cipylstnam, ' ') as last_name ,
NVL(icmscipy.cipyfirnam, ' ') as first_name,
NVL(icmscipy.cipymidnam , ' ') as middle_name ,
NVL(icmscipy.business_ind, ' ') as business_indicator,
' ' as owners_name,
NVL(icmscipy.date_of_birth, ' ') as date_of_birth ,
NVL(icmscipy.sex , ' ') as sex,
' ' as warrant_indicator ,
NVL(icmscicr.case_file_date, ' ') as case_file_date,
' ' as count_1_statute,
' ' as count_1_charge,
' ' as defendant_status
from icmscicr, icmscipy
where --cicrcrtcod = pCourtCode
--and cicrcasnbr = pCaseNumber
--and cicrcastyp = pCaseType
cipycrtcod = cicrcrtcod
and cipycasnbr = cicrcasnbr
and cipycastyp = cicrcastyp
order by case_number asc;


type CaseSearchCur1 is REF CURSOR RETURN c1%rowtype;


PROCEDURE CaseNumber_byCaseNumber1 (pCourtCode IN Char,
pCaseNumber IN Char,
pCaseType IN Char,
CaseSearchCursor1 IN OUT CaseSearchCur1);


end JUV_T1SEARCH_PKG;
/* package body */


PROCEDURE CaseNumber_byCaseNumber1 (pCourtCode IN Char,
pCaseNumber IN Char,
pCaseType IN Char,
CaseSearchCursor1 IN OUT CaseSearchCur1)
is

table_loc char;

begin

table_loc := CaseNbr_inTable(pCourtCode, pCaseNumber, pCaseType);

if table_loc = 'O' then

open CaseSearchCursor1 for
SELECT 'CaseNumber_byCaseNumber' as Record_Type,
NVL(cs.otcscrtcod,' ') as court_code,
NVL(to_char(dd.otdddefnbr),' ') as id_number,
NVL(cs.otcscasnbr, ' ') as case_number,
NVL(cs.case_type, ' ') as case_type,
NVL(cs.case_category,' ') as case_category,
NVL(otnmseqnbr, ' ') as name_sequence_number,
NVL(nm.otnmlstnam, ' ') as last_name,
NVL(nm.otnmfirnam, ' ') as first_name,
NVL(nm.otnmmidnam,' ') as middle_name,
NVL(nm.otnmbusind,' ') as business_indicator,
NVL(dd.otddownrsp,' ') as owners_name,
NVL(nm.otnmdefdob,' ') as date_of_birth,
NVL(ds.otdsdefsex,' ') as sex,
decode (otddwarind, 'I', 'Issued', 'S', 'Sent', 'H', 'Held', 'R', 'Requested', 'Q', 'Recall Requested', 'C', 'Recalled', null, ' ') as warrant_indicator,
NVL(cs.otcsfildat,' ') as case_file_date,
NVL(ch.otchchgstt,' ') as count_1_statute,
NVL(ch.otchcharge,' ') as count_1_charge,
decode (otdddefsta, 'A', 'Active', 'P', 'Pending Adjudication', 'S', 'Superior', 'J', 'Juvenile', 'D', 'Diversion', 'O', 'Consolidated', 'H', 'Held To Answer', 'C', 'Closed', 'L', 'Appeal', 'W', 'Warrant', 'R', 'Probation', 'M', 'Remanded', 'I', 'Mental', 'F', 'Fine', null , ' ') as defendant_status
from icmsotcs cs, icmsotnm nm , icmsotdd dd , icmsotds ds , icmsotch ch
where cs.otcscrtcod = pCourtCode
and cs.otcscasnbr = pCaseNumber
and cs.case_type = pCaseType
and
cs.otcscrtcod = otddcrtcod(+)
and cs.otcscasnbr = otddcasnbr(+)
and otddcrtcod = otdscrtcod
and otdddefnbr = otdsdefnbr
and otddcrtcod = otnmcrtcod
and otddcasnbr = otnmcasnbr
and otdddefnbr = otnmdefnbr
and cs.otcscrtcod = otchcrtcod (+)
and cs.otcscasnbr = otchcasnbr (+)
and otchchgcnt = 1
and otchchgtyp='FILED';

else
if table_loc = 'C' then
open CaseSearchCursor1 for
SELECT 'CaseNumber_byCaseNumber' as Record_Type,
icmscicr.cicrcrtcod as court_code ,
NVL(to_char(icmscipy.cipyptyuid), ' ') as id_number ,
NVL(icmscipy.cipycasnbr, ' ' ) as case_number ,
NVL(icmscipy.cipycastyp, ' ') as case_type ,
NVL(icmscicr.case_category, ' ') as case_category ,
'0' as name_sequence_number,
NVL(icmscipy.cipylstnam, ' ') as last_name ,
NVL(icmscipy.cipyfirnam, ' ') as first_name,
NVL(icmscipy.cipymidnam , ' ') as middle_name ,
NVL(icmscipy.business_ind, ' ') as business_indicator,
' ' as owners_name,
NVL(icmscipy.date_of_birth, ' ') as date_of_birth ,
NVL(icmscipy.sex , ' ') as sex,
' ' as warrant_indicator ,
NVL(icmscicr.case_file_date, ' ') as case_file_date,
' ' as count_1_statute,
' ' as count_1_charge,
' ' as defendant_status
from icmscicr, icmscipy
where cicrcrtcod = pCourtCode
and cicrcasnbr = pCaseNumber
and cicrcastyp = pCaseType
and cipycrtcod = cicrcrtcod
and cipycasnbr = cicrcasnbr
and cipycastyp = cicrcastyp
order by case_number asc;
end if;

end if;
end CaseNumber_byCaseNumber1;


end JUV_T1SEARCH_PKG;

/**************************************************/
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top