How to run the cursor

HI
can i knw how to run the cursor from the package. The cursor name is "cursor fet_rec".
procedure update_hdr is
cursor fet_rec is
i rhave the run procdure but i am unable to run the cursor.
procedure update_hdr is
cursor fet_rec is
select status, request_hdr_id
from xxkfupm01.kfupm_mcr_request_header
where status = 'Approved'
for update;
cnt1 NUMBER := 0;
cnt2 NUMBER := 0;
BEGIN
for rec in fet_rec Loop
select count(*)
into cnt1
from XXKFUPM01.kfupm_mcr_request_details
where request_hdr_id = REC.REQUEST_HDR_ID;
select count(*)
into cnt2
from XXKFUPM01.kfupm_mcr_request_details
where request_hdr_id = REC.REQUEST_HDR_ID
and status = 'Complete';
if (cnt1 = cnt2) THEN
update xxkfupm01.kfupm_mcr_request_header
set status = 'Complete'
where current of fet_rec;
END IF;
END LOOP;
Regards
Arif
Edited by: user11309801 on Jan 3, 2011 6:56 AM
Edited by: user11309801 on Jan 3, 2011 7:00 AM

http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html
http://www.oracle.com/pls/db102/homepage
http://www.oracle.com/pls/db112/homepage

Similar Messages

  • How to run the cursor loop once even if it is true for many times - urgent

    Hi,
    Say
    loop
    tdate='12-JAN-2005'
    loop
    cursor.......
    if '10-JAN-2005'<=tdate then
    fetch
    end loop
    tdate=tdate+1 month
    end loop;
    in the above query i want my cursor to run the loop only once at the first true of my condition....in the second run the tdate will be = '12-FEB-2005'....but my cursor loop should not go in..it has to comeout....
    how to do this....plz help very urgent

    in the above query i want my cursor to run the loop only once at the first true of
    my condition....in the second run the tdate will be = '12-FEB-2005'....but my
    cursor loop should not go in..it has to comeout....Simply control has been the cursor processed or not.
    Something like that
    SQL> declare
      2    tdate date := to_date('12-JAN-2005','DD-MON-YYYY');
      3    cursor cr is select * from dual;
      4    rt dual%rowtype;
      5    cursor_has_been_processed boolean := false;
      6  begin
      7   loop
      8     if to_date('10-JAN-2005','DD-MON-YYYY') <=tdate then
      9             if not cursor_has_been_processed then
    10                     open cr;
    11                     loop
    12                     fetch cr into rt;
    13                     exit when cr%notfound;
    14                     end loop;
    15                     close cr;
    16                     cursor_has_been_processed := true;
    17                     dbms_output.put_line('Cursor has been processed');
    18             end if;
    19     --DO something
    20     null;
    21          end if;
    22     dbms_output.put_line(tdate);
    23     tdate := add_months(tdate,1);
    24     exit when tdate >= to_date('12-MAY-2005','DD-MON-YYYY');
    25   end loop;
    26  end;
    27  /
    Cursor has been processed
    12-JAN-05
    12-FEB-05
    12-MAR-05
    12-APR-05
    PL/SQL procedure successfully completed.Rgds.

  • When I run the cursor over a template it shows several pages but when i select the document it only brings up the first two pages to edit. How do I see them all?

    When I run the cursor over a template it shows several pages but when i select the document it only brings up the first two pages to edit. How do I see them all?

    Skimming the templates in the Template Chooser shows you all of the pages available in the template once you open it. You can insert the one(s) you want, even more than one of any of them. Most users don't want or need all of the different pages, especially when they start the document.

  • How to determine the cursor record count before the "open cursor"?

    Is it possible to determine the record count of an explicit cursor without running a count()? Say, my cursor definition is something like this,
    CURSOR cur_vehicle
    IS
    SELECT os.order_id, os.order_item, vs.part_id
    vs.part_num,
    vs.iso_num,
    vs.model_yr
    vs.dealer_cde,
    vs.cust_cde,
    px.plant_cd
    FROM parts_source vs,
    orders_source os,
    plant_tbl_crossref px
    wHERE os.order_id = vs.order_id
    AND vs.part_id = os.part_id
    AND vs.plant_cde = px.plant_cde
    ORDER BY os.order_id;
    I want to log the count of records returned by the above cursor prior to the first fetch, without running a count(1) for the query in cursor select.
    I know adding " Count(1) over(order by null) " in the cursor SELECT will bring it. But that does not help me log the record count to some log file or table before opening the cursor for processing.
    To conclude, my objective is to update the record count of cursor in some table before processing

    sarvan wrote:
    Is it possible to determine the record count of an explicit cursor without running a count()?
    ..snipped..No. The only way to do it correctly is inside that select.
    Each select is a consistent read. Which means that if this is done as 2 select statements, the 1st select can see a different version of the data than the 2nd select statement. does. So if you want a count and that to be consistent and on the same version of the data than the select, it has to be done as part of the select.
    Also consider what a cursor is. It is not a result set of sorts that is created in memory upfront - with a convenient interface that tells you the size/number of rows of that result set.
    A cursor is basically a program that reads database data as input and produce output. A fetch from a cursor is an instruction for this program to execute and output data.
    There's no data set that is created by the cursor from which the count can be determined. The cursor program does have state variables - like +%RowCount+ that specifies how many rows the cursor has thus far output. And you need to run that cursor to the end (no more output) in order to determine the total number of rows output by the cursor.

  • How to run the form that is only installed on a PC and not using a server?

    Hi
    I am new to Oracle and have taken the forms class. But I do not understand how to run the form from my PC using XP windows. (Do not have access to a server).
    I have started the OC4J, made sure the listener was started, compiled the form and then when I run it, it automatically goes to the HTTP:
    ERROR: res://ieframe.dll/acr_depnx_error.htm#,http://kevin:8889/forms/frmservle
    I connected to the database correctly. I can process a report and it does nor try to access the internet. My only issue is running the form. I verified it compiled.
    Sorry for a basic question. Could someone please help, I tried reviewing other questions, but not sure if they are connecting to a server or not.
    I see webutil but is it required if I don't have a server? Thank you in advance.

    Regardless of the version, it appears that you may not have configured the Builder. Do the following:
    1. Open the Builder
    2. From the menu, select Edit > Preferences > Runtime
    3. In the box labeled "Application Server URL:", enter a local URL needed to run a form OR click the button labeled "Reset to Default". If you decide to manually enter a value, it would looks something like this:
    http://localhost:8889/forms/frmservlet
    4. In the field labeled "Web Browser Location:", enter the path and executable to your preferred browser. So for example if IE is your browser of choice the entry would most likely look like this:
    C:\Program Files\Internet Explorer\IEXPLORE.EXE
    5. Click on OK and retest.
    By the way, you can manually enter a URL in the browser. Clicking the RunForm button from the Builder is strictly optional. To run the "test" form directly from the browser enter the following into the browser's address field:
    http://localhost:8889/forms/frmservlet?form=test
    More information about Forms can be found on OTN:
    http://www.oracle.com/technology/products/forms/index.html

  • How to run the ejb project in j2ee server

    How to run the EJB project.
    I give like
    java conveterClient converterClient.jar
    here conveterClient is class file name and converterClient.jar is deployed file
    like wise i give some exception is come
    give some help pls friends

    Navigate to the "DBOrders" module in the catalog, right click on the "ORDERS" database below and click "Export Schema Stucture". That will produce a file containing the DML needed to create the database

  • HOw to run the Applet in dos mode

    how to run the applet in Command Prompt(DOS).
    I have save this in directory D/vijay/javap/A.java and my JDK is in C drive.
    Plz send me reply as soon as possible.
    My code is :-
    import java.applet.*;
    import java.awt.*;
    public class A extends Applet
    private int w, h;
    public void init( )
         w = 45;
         h = 50;
    public void paint(Graphics g)
         g.drawRect(w, h, 20, 80);
    }

    import java.applet.*;
    import java.awt.*;
    public class A extends Applet
    private int w, h;
    public void init( )
    w = 45;
    h = 50;
    public void paint(Graphics g)
    g.drawRect(w, h, 20, 80);
    <applet class="A" height="200" width="200" code="A.class">
    </applet>
    */And in command prompt
    javac A.java
    appletviewer A.java
    Message was edited by:
    passion_for_java

  • How to run the programes in NetBeans

    any body know how to run the java progarm in NetBeans.
    can u please guide me?
    Advance in thanks

    thanks for ur reply.
    this is my code.
    public class sample11 {
    /** Creates a new instance of sample11 */
    public sample11() {
    public static void main(String args[])
    System.out.println("nithya");
    i did watever u told. but i don't have o/p. wat can i do? how to it display the o/p?

  • How to run the query in  screen painter

    i am using the patch 36 in business one so pls give information  about 
       how to run the query in  screen painter 
    regard
      sandip adhav

    Hope u have reached Screen painter interface,
    1. Click 'Add Grid' from tool bar.
    2. Go to 'Collections' tab in 'Properties' window.
    3. Choose 'Data Tables' from the Drop down list.
    4. Click 'New' found at the bottom of the Properties Window(same window)
    5. U'll find the place to insert ur query.
    6. U can rename the table name from 'DT_0'
    7. Choose type as 'Query'
    8. Clear content from box 'Query'
    9. Enter ur query there. Dont forget to Click 'SET'
    10. Go to Preview option from tool bar.
    now ur query will be displayed as table format.
    Note: First try with simple query b4 going for linking option.
    Regards,
    Dhana.

  • How to run the smsserver in xp

    hi friends,
    May i know, how to run the smsserver in windows xp...

    What smsserver?
    Please ask detailed questions.

  • How to run the Invoices in different groups within the batch in AP

    Need to know that how to run the Invoices in different groups within the batch. This will be of very helpful when we deal with lot of lines under one batch. (e.g) like somewhere we issued a Corporate Card to all the employees Via Bank Of America. Every Month they will send the complete details of all the employees who ever swiped the corporate provided BOA. Accordding to Natco all those lines should be loaded as One Invoice so that a Single Payment can be provided to BOA and it will also makes their life easier. This standard program sometimes it works normal sometimes it will run like a TORTOISE. So thats why in the manual they suggested to use GROUP ID to split the Invoice Load.
    So plz tell me how we can run it
    plz give me the solution
    thanks

    can you give me some material or document on that so that i can read actuaaly i need to make doc on it..

  • How to run the application in weblogic

    Hello!
    I have deployed 1 application in Apache Tomcat , it is working fine. Now i want to deploy same application in Weblogic Server. I have already installed "Weblogic 9.1". Now i dont know how to do and what to do next.
    I also dont know where to copy that application folder in weblogic, and how to run & deploy the application?
    I have stuck over here.
    Please if anybody knows how to run the application in weblogic, plz let me know.
    I need your help.
    Thank you.

    hi,
    have you gone through [this link.|http://e-docs.bea.com/wls/docs92/index.html]. i think it may help.

  • How to run the mappings in owb?

    Hi,
    I am new to owb pls say that how to run the already created mappings in owb.My dba have loaded the data in the oracle i neeed to uppend the data in to owb.pls help me.
    Thanks,
    raju
    Edited by: 814740 on Nov 23, 2010 12:49 AM

    You need to make sure that OWB control center service is running . You can check this by show_service.sql (OWB_HOMW\owb\rtp\sql)
    Then logon to OWB designer --- > goto control center ----> select the mapping you want to run .
    Verify that it is deployed successfully . If yes the click on start , your mapping execution will start .
    See the result .
    Thanks,
    Sutirtha

  • How to run the Macro in RTF

    Hi Tim,
    Do you know how to run the WORD macro in RTF?
    Suppose I want to run the macro for Section Break, Is there any way we can call it using WORD Macro.
    Any help is appriciated.
    Thanks,
    Ambadas

    Hi Ambadas
    Now, Im not entirely sure what you mena by:
    'Do you know how to run the WORD macro in RTF?'
    Are you looking to run a macro to create a section break for you during the design of the template? - you can do this.
    Or do you want to embed a macro in the RTF output - you can not do this - RTF does not support macros.
    Please explain further.
    Regards, Tim

  • How to run the report and show the output in excel file

    salam
    how to run the report and show the output in excel file,
    how to run the report and print the o/p via printer
    how to run the report and send the o/p via mail
    thank u all

    Hi,
    There are Parameters DESTTYPE, DESFORMAT and DESNAME. You can set these parameters to get as you want.
    1) Output in Excel File
         ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'FILE');
         ADD_PARAMETER(PL_ID, 'DESFORMAT', TEXT_PARAMETER, 'DELIMITED');
         ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<file_name>.XLS');2) output to printer
         ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'PRINTER');
         ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<printer_name>');3) Email - Have to configure SMTP and all. ( i didn't checked it)
         ADD_PARAMETER(PL_ID, 'DESTYPE', TEXT_PARAMETER, 'MAIL');
         ADD_PARAMETER(PL_ID, 'DESNAME', TEXT_PARAMETER, '<email_id>');Regards,
    Manu.
    If this answer is helpful or correct, please mark it. Thanks.

Maybe you are looking for

  • Do I really need an optical drive (external) for my MacBook Air to install Win 7  with Bootcamp?

    I have a Macbook Air (11" if it matters, the tiny one) that was purchased late last year, new.  I would like to install Bootcamp and be able to boot into Windows 7, 64 bit.  I have a Windows 7 Professional disk, which I would have to find an optical

  • Problem with iOS 6 new app banner

    In IOS 6, new download apps will have a banner saying new. I have this blue banner too, its just that I do not have the new button. Is this a bug or something?

  • Where my items have gone !! DesignTab not showing any items

    Hi, I hv been working on a Form with 35 data items and hv spent a considerable amount of time. When nearing completion suddenly I found that the Design tab is not displaying any thing. I am able to see the full source code in the source tab. On tryin

  • Custom sign in page OBIEE 11g

    Hello all, I have almost did it :D I followed the instructions of rittman mead --> http://www.rittmanmead.com/2010/12/oracle-bi-ee-11g-styles-skins-custom-xml-messages/ But the last step is missing :/ I have a folder with sk_pageaccuei, s_pageaccueil

  • Error in transferring - Proc. type does not exist

    Hi Experts, I have created a Shopping Cart in SRM portal expecting to create a PO in R/3 Back-end. But Shopping Cart ended up with "Error in-process". I went to BBP_PD and got the GUID. Then the GUID is given in FM "BBP_PD_SC_TRANSFER" and done debug