Handling no_Data_found and handling the cursor context not found exceptions

hi all,
when the value is not there in table, we will get the no_data_found exception.
im sending the sample procedure.
check that one.
create or replace procedure registration.P_GetPatientDetails(in_UHID in Patient.Uhid%Type,
ocursor_Component1 OUT SYS_REFCURSOR,
---ocursor_Component2 OUT SYS_REFCURSOR,
ocursor_Component3 OUT SYS_REFCURSOR,
ocursor_Component4 OUT SYS_REFCURSOR
AS
in_RegistrationID varchar2(50);
ln_genderLovID NUMBER(10);
ln_rhfactorLovID NUMBER(10);
BEGIN
SELECT RegistrationId
into in_RegistrationID
from Patient
where (Upper(UHID) = Upper(in_UHID)) ;
/* COMMIT;*/
/*dbms_output.put_line(in_RegistrationID);*/
OPEN ocursor_Component1 FOR
SELECT RegistrationID,PreRegistrationNo,EmergencyNo,UHID
FROM patient p LEFT OUTER JOIN EHIS.Titlemaster TM ON p.title = tm.titlecode LEFT OUTER JOIN EHIS.SuffixMaster SM on p.sufix = SM.SUFFIXCODE LEFT OUTER JOIN EHIS.Maritalstatusmaster MSM ON MSM.MARITALSTATUSID = p.maritalstatus LEFT OUTER JOIN EHIS.Bloodgroupmaster BGM ON BGM.BLOODGROUPID = p.bloodgroup LEFT OUTER JOIN EHIS.LovDetail LD ON(LD.LOVDETAILID = p.gender AND LD.LOVID = ln_genderLovID) LEFT OUTER JOIN EHIS.LovDetail rf ON(rf.LOVDETAILID = p.rhfactor AND rf.LOVID = ln_rhfactorLovID)
WHERE RegistrationID = in_RegistrationID AND p.Status = 1 ;
OPEN ocursor_Component3 FOR
SELECT RegistrationID,ResidenceNumber,MobileNumber,PrimaryEmail
FROM AddressMaster
WHERE UPPER(RegistrationID) = UPPER(in_RegistrationID) AND Status = 1 AND
AddressTypeID =
(SELECT AddressTypeID
FROM AddressTypeMaster
WHERE AddressTypeName = 'PermanentAddress');
/* COMMIT;*/
OPEN ocursor_Component4 FOR
SELECT ResidenceNumber, MobileNumber,EmergencyNumber,PrimaryEmail
FROM AddressMaster am LEFT OUTER JOIN EHIS.Countrymaster CM ON CM.COUNTRYID = am.country LEFT OUTER JOIN EHIS.Statemaster SM ON SM.STATEID = am.state LEFT OUTER JOIN EHIS.Districtmaster DM ON DM.DISTRICTID = am.district LEFT OUTER JOIN EHIS.Citymaster CM1 ON CM1.CITYID = am.city
WHERE UPPER(RegistrationID) = UPPER(in_RegistrationID) AND Status = 1 AND
AddressTypeID =
(SELECT AddressTypeID
FROM AddressTypeMaster
WHERE AddressTypeName = 'CurrentAddress');
/* COMMIT;*/
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(TO_CHAR(SQLCODE) || SQLERRM);
END;
if the data is not there for teh given uhid,
we are displaying the err msg in exception block
but from .net environment ,
they will define the cursors as out params.
if they wont get the data,
in .net environment, the exception is raised.
how to handle these situations.

Implicit cursors are prone to both the NO_DATA_FOUND and TOO_MANY_ROWS errors. They MUST return precisely one row or you get to do extra coding in the form of exception handlers. Using explicit cursors (declared in the DECLARE SECTION) will avoid both errors, though they have their own considerations. When an explict cursor doesn't find something it doens't put NULL into the destination variable(s); it leaves them alone so its a good idea to null out variables and records before fetching into them.

Similar Messages

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

    hello guys.
    when i'm trying to make a regular recover, i get this error:
    RMAN> run
    2> {
    3> restore database;
    4> recover database;
    5> alter database open;
    6> }
    Starting restore at 09-MAR-07
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 03/09/2007 10:23:41
    ORA-01023: Cursor context not found (Invalid cursor number)
    what am i doing wrong and how could i open this cursor?
    sorry, that i'm clueless.
    thank you.

    TAF is not supported with RMAN according to Metalink note

  • FAST Search - The object was not found exception.

    Hi all - I am getting "The object was not found exception" error for one of my site collection I checked the permissions  they are there. Please let
    me know how to find more details about error with Item id specified in crawl log.
    Also let me know what could be issue for this error. Only one line of error is not helping me to troubleshoot.

    Hi Satish,
    Do you have alternate access mappings configured for your web application or an incorrect IIS binding? Have you seen these posts?
    http://sharepoint.stackexchange.com/questions/22844/object-not-found-error-in-search-service-crawl-logs
    http://serverfault.com/questions/130663/sharepoint-server-search-not-crawling
    Please remember to click Mark as Answer on the answer if it helps you

  • I tried to access PSE Organizer and received the message"catalog not found"

    Why did this occur?  How do I find my catalog?
    judcol57

    Usually this happens when you accidentally move your catalog file.
    What version of PSE?

  • Error in Oracle Load Tester --- Variable Not Found Exception

    Hi Team
    While running the iterations through oracle load tester we are getting the error "Variable not found exception" and the iterations are going through the infinite loop. PLease find attached the detailed document regarding the setup and the iterations we are running. Please find the link where i have shared the document.
    https://docs.google.com/document/d/1Fc4ZY7oC-cEpDSYBhJLb1lNdtNl8-uXmcDkiNakaNpk/edit?usp=sharing
    Thanks in advance for your help.
    Regards
    Pavan
    Message was edited by: user11266214

    In 'Set Up Autopilot' tab, under 'Stop the load test' you have to select 'Iteration played by each user 1'

  • The select function in Pages and other apps gets stuck and the cursor will not move. What do I do?

    The select function in Pages and other apps gets stuck when I touch a word and the cursor will not move. What is the answer for this problem?

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • Hi my trackpad is frozen and I also could not get force quit to work, I closed the top down and now I cannot get past the login and the cursor will not move, does anyone have any ideas

    Hi my trackpad is frozen and I also could not get force quit to work, I closed the top down and now I cannot get past the login and the cursor will not move, does anyone have any ideas

    Try these two steps:
    Intel-based Macs: Resetting the System Management Controller (SMC)
    Resetting your Mac's PRAM and NVRAM

  • Problem in SQL with CURSOR( ) ,Why the CURSOR did not work?

    hi All:
    I have a problem in SQL with CURSOR.
    The data is as the attachments.
    Here is the SQL statement as follow:
    SELECT A.WADCTO,A.WADOCO,B.IGCOST,CURSOR (SELECT X.IGLITM
    FROM F3102 X
    WHERE X.IGDOCO=A.WADOCO
    AND X.IGCOST IN ('B1','D1','C3')) AS DETAIL
    FROM F4801 A INNER JOIN F3102 B ON A.WADOCO=B.IGDOCO AND A.WADCTO=B.IGDCTO AND B.IGCOST>' '
    WHERE A.WADOCO='10004'
    The statement above returns records as follow:
    WADC WADOCO IGCOST DETAIL
    WO 10004 A1 CURSOR STATEMENT : 4
    CURSOR STATEMENT : 4
    IGLITM
    1KV90CPG2
    1KV90CPG2
    1KV90CPG2
    But, after I add one statement in the subquery, there is no record returned from CURSOR.
    Here is the SQL statement:
    SELECT A.WADCTO,A.WADOCO,B.IGCOST,CURSOR (SELECT X.IGLITM
    FROM F3102 X
    WHERE X.IGDOCO=A.WADOCO
    AND X.IGCOST=B.IGCOST
    AND X.IGCOST IN ('B1','D1','C3')) AS DETAIL
    FROM F4801 A INNER JOIN F3102 B ON A.WADOCO=B.IGDOCO AND A.WADCTO=B.IGDCTO AND B.IGCOST>' '
    WHERE A.WADOCO='10004'
    The statement above returns records as follow:
    WADC WADOCO IGCOST DETAIL
    WO 10004 A1 CURSOR STATEMENT : 4
    CURSOR STATEMENT : 4
    no rows selected
    Why the CURSOR did not work?
    The database version is Oracle Database 10g Release 10.2.0.4.0 - 64bit Production.
    F3102 DATA:
    IGDOCO     IGDCTO     IGLITM     IGCOST
    10004     WO     1KV90CPG2      A1
    10004     WO     1KV90CPG2      B1
    10004     WO     1KV90CPG2      C3
    10004     WO     1KV90CPG2      D1
    F4801 DATA:
    WADCTO     WADOCO
    WO     10004
    Edited by: user2319139 on 2010/3/2 上午 1:17
    Edited by: user2319139 on 2010/3/2 上午 1:20

    Why this structure and not a join?
    The cursor() function returns a cursor handle that needs to be processed - in other words, the client needs to fetch data from it. The Oracle® Database SQL Reference+ (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/expressions005.htm#i1035107) describes it as being equivalent to a ref cursor handle.
    Thus why are you creating ref cursor handles as a column in a SQL projection - where each row will have a "+nested+" ref cursor handle to process. What problem are you attempting to hack solve this way?

  • When watching youtube the video randomly jumps to the start of the video even if the cursor is not on the video.

    When watching youtube the video randomly jumps to the start of the video even if the cursor is not on the video. This happens randomly and does not seem to be a problem with the videos as they run fine. what is going on?

    Several times every day YouTube shuts down some of their servers to update stuff. Be patient if YouTube is slow, stuck or mangled. Transmissions from YouTube to your computer are done in multiple tiny packets of data and flash at a time. That's why sometimes you may get any of these scenarios: bits and pieces of text/thumbnails in weird places; sluggish loading/buffering; the spinning circle going on forever; or the player being blank. This problem could fix itself within a few hours or by the next day.
    If your YouTube continues to behave slow, stuck or strange, it's very possible that your directories of "temporary internet files" and RAM (sometimes known as "cache") are close to the maximum and just cannot take anymore, the end result being any of the above scenarios or videos that: A) come to a complete freeze; B) start/stop/start/stop in a choppy way; or C) never even make it onto your screen.
    "Temporary internet files" are tiny bits of webpages that get permanently put on your hard-drive. They will remain forever on your computer, gradually plugging it up like hair stuck in a sink drain, until you finally get rid of them once and for all. Thus, exit out of YouTube, then clear your "cache" of all its "temporary internet files", "cookies" and "history". It is best if you shutdown and reboot afterwards. You'll be amazed at how "fresh" and "new" your YouTube will be.

  • Robot class and positioning the cursor

    I have an application where I have a number of panels on the screen and using an editable field wish to enter coordinates to position the Cursor to on another panel.
    ie, using grid coordinates on a map. Using the robot class I am able to position the cursor on the other panel but as soon as I move the mouse the cursor jumps back to the original position on the screen where the first panel with the editable field was. It is like only a picture of the cursor was drawn at the new coordinates and the real cursor is still at the old podition. It is important to this application that if the cursor is moved it stays where it has been moved to and actually is there and not just appearing to be there. I am using jdk 1.3 on Intel Solaris 2.8. Any help on this issue would be helpful and appreciated

    Maybe you can use the mouse move event to position the mouse to where you had moved the cursor to.
    for example
    1.the mouse is at point 100,100
    2. you move the cursor from your code to point 0,0
    3. the user starts to move the mouse
    4. you code gets that event and repositions the cursor to the last place where it was, that is at 0,0

  • HT4113 My daughters iPod touch asks for her pass code but when she types it in the cursor does not move or input any characters so,she cannot get into the iPod. This has suddenly happened for no apparent reason

    My daughters iPod touch asks for her pass code but when she types it in the cursor does not move or input any characters so,she cannot get into the iPod. This has suddenly happened for no apparent reason, what can we do? Can anyone help please?

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • HT3737 Why does the Safari toolbar disappear when the cursor is not on it ?

    Why does the Safari tool bar disappear when the cursor is not pointed to it?
    How can I fix it ,Please.

    It sounds like Safari is displaying in 'full-screen'. To reveal the tool bar move the mouse pointer to the top right-hand corner of the screen. You should see two blue arrows, click on those and it should take it out of full-screen mode and leave the menu bar, tool bar, etc. permanently on view.

  • AFTER SUBJECT IS TYPED IN THE CURSOR WILL NOT LET ME WRITE THE MESSAGE

    WHEN SENDING AN E-MAIL, I CAN TYPE IN THE CONTACT PERSON AND THE SUBJECT, BUT THE CURSOR WILL NOT GO ANY FURTHER - THEREFORE, I CANNOT TYPE MY MESSAGE
    == This happened ==
    Every time Firefox opened
    == I TRIED TO SEND A MESSAGE TODAY

    1) Firefox 2.0.0.20 is no longer supported, and since you are using Windows Vista there are 3 newer versions of Firefox you can install - 2 of which are still supported.
    2) Which '''web mail''' service are you using with Firefox?
    Yesterdays Hotmail upgrade seems to have broken many things for Firefox users, regardless of which Firefox version is used. It's up to Microsoft to fix the problems they created with that update.

  • CUIC, Handled Calls and Handled Time problem

    Hello,
    Our costumer uses Outboud Predictive Dialer, UCCE. Everthing works fine but in CUIC reports we do not have almost any information about Handled calls and Handled Time (example in attach).
    Any hints are much appreciated!
    Dusan

    Hi,
    alright.
    One day you will outgrow CUIC anyway, so if I were you I would start thinking about creating a custom reporting solution (if you are a Microsoft shop, it's SRSS, if Java, then perhaps BIRT).
    G.

  • Hi Guys,  I am using the full width video widget on a site. The widget was working perfectly however I have just added additional content to the site and re-uploaded and now the video is not working! Please help I have tried everything and am freaking out

    Hi Guys,
    I am using the full width video widget on a site. The widget was working perfectly however I have just added additional content to the site and re-uploaded and now the video is not working! Please help I have tried everything and am freaking out as this web-site has been payed for by my client.
    Alex

    Many thanks.
    With those symptoms, I'd try the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.)

Maybe you are looking for