Code not getting executed:

The requirement if comm+salary is >=3000 then all the details laong with emp info have to be inserted into emp table and comm+sal between 10000 and 20000 the same have to be inserted into emp table. PLZ CHECKOUT AND SPECIFIY THE RIGHT CODE TO DO IT.
create or replace procedure pps is
ccsal number;
cursor comm is
select salary+nvl(commission_pct,0)from employees;
begin
open comm;
loop
exit when comm%notfound;
fetch comm into ccsal;
if ccsal>=3000 then
ccsal:=ccsal*10/100;
insert into emp(employee_id,last_name,salary,commission_pct,totsal) values(employees.employee_id,employees.last_name,employees.salary,employees.commission_pct,ccsal)
elsif ccsal between 10000 and 2000 then
ccsal:=ccsal*5/100;
insert into empinsert into emp(employee_id,last_name,salary,commission_pct,totsal) values(employees.employee_id,employees.last_name,employees.salary,employees.commission_pct,ccsal)
end if;
end loop;
close comm;
end;
Edited by: 987184 on May 3, 2013 9:25 PM

You try this and let me know if it helped you .. I have made some changes ..
CREATE OR REPLACE PROCEDURE pps
IS
-- ccsal NUMBER;
-- empid employees.employee_id%TYPE;
-- lname employees.last_name%TYPE;
-- sal employees.salary%TYPE;
-- cpt employees.commission_pct%TYPE;
BEGIN
FOR i IN (SELECT employee_id, last_name, salary, commission_pct,
salary + NVL (commission_pct, 0) ccsal
FROM employees)
LOOP
IF i.ccsal >= 3000
THEN
i.ccsal := i.ccsal * 10 / 100;
INSERT INTO emp
(employee_id, last_name, salary,
commission_pct, totsal
VALUES (i.employee_id, i.last_name, i.salary,
i.commission_pct, i.ccsal
ELSIF i.ccsal BETWEEN 10000 AND 20000
THEN
i.ccsal := i.ccsal * 5 / 100;
INSERT INTO emp
(employee_id, last_name, salary,
commission_pct, totsal
VALUES (i.employee_id, i.last_name, i.salary,
i.commission_pct, i.ccsal
END IF;
END LOOP;
END;
Regards..

Similar Messages

  • ABAP Code not getting executed through process chain

    Hi Friends,
      I have program which when executed with respective varient Popup system message (SM02 Messages).  This program work fine when executed in forground or in background.
       However same program when i added in process chain with respective varient. The output is not genertaed as expected (i.e the program is not populating SM02 message)
      The process chain work's fine without giving any error.
    Does any setting we need to do ???
    i have followed the procedure given in "How to…
    Integrate an ABAP program in a process chain" document from OSS.
    Regards,
    Jayant.

    Hi,
    you will not see in the log of the process chain if your program failed or not. You only receive a message that the programm has been triggered successfully.
    Your program is then started in a new background process with a new log - try to find it via the job overview (transaction SM37) via date and time selection. (Of course you can only find there what your program writes to the log).
    Another idea would be to check the profile of user ALEREMOTE (Transaction SU01 or SU01D) if there is an authorization for transaction SM02.
    Stephan

  • CommandButton code does not get executed with partialSubmit=false

    Following code in Jdev11g
    <input type="text" value="#{myBacking.text}"/>
    <af:commandButton text="Click" action="#{myBacking.doSomething}"/>
    <af:commandButton text="Click" actionListener="#{myBacking.doSomethingElse}"/>
    public void setText(String value)
       System.out.println("Setting value");
    public String doSomething()
       System.out.println("Clicked");
        return "";
    public String doSomethingElse(ActionEvent e)
       System.out.println("Clicked with event");
    } I always get following output:
    Setting valueI never see the output from my commandButton. It seems that my button does not executes it's code but just notifies the components to call their setters.
    I notice that when i set the partialSubmit to true, de code do get executed.
    Why is that and what is causing this behaviour? How can i use my own code in the buttons without setting the partialSubmit to true? I do need a complete refresh of the page and can not use the partialSubmit but when it's set to false, it ignores my code...

    They are inside an af:form
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=windows-1252"/>
      <f:view>
        <af:document id="doc1">
          <af:messages id="m1"/>
          <af:form id="frm1">
               //MY buttons are here
          </af:form>

  • Queries are not getting executed in the EJB

    Hi,
    I am using Stateless EJB for database transactions. I have one getConnection() method in it which I am calling in every method for connection. I have created one more method in that I am executing one simple query for count(*) from one table and returning the count in the Web dynpro application. But I am not getting the count. It seems the query is not getting executed. I have added classes12 jar externally to the EJB and also to the WebDynpro application. Is there anything I am missing????
    Thanks,
    Swati Gaur

    Hi Swati Gaur,
    Did you print any logs in the your code to print the count after executing the query?
    For debugging purpose you can try
    System.err.println("Count after executing the query "+count);
    count is the variable which contains the count after executing the sql query.
    Check for the above statement in default trace. If count is printing in default trace then the problem is in your webdynpro code.
    Hope this helps!
    Regards,
    Jaya.

  • In PO Release "PO release effected" is not getting executed

    Hi All,
               I am working on PO Release WorkFlow.
    when I execute the WF of PO release, its executing the first task "please release PO" but when I relase the PO from my work place the second step "PO release effected" is not getting executed. I could not found why this is happening.
    Please help me in this issue.
    Thanks.
    Ranganadh.

    Thank You Adithya,
                                     I have copied the standard one i.e. WS20000075. I am executing the workflow directly from the Workflow builde by giving the PO number and release code.
    with this in my business workplace I can able to find the workitem.
             I am releaseing the PO from the Workplace. After releasing the PO also I am getting the status of the workitem as "Inprocess".
             In workflow log I found that only first task (PO Released) has been executed the subsequent steps are not getting executed.
             Would be there any settings are missed out??
    Thanks.
    Ranganadh.

  • Java Dynpro - Consumed Java WebService - Not getting executed

    I have consumed a Java Web Service ( EJB ) in my Java Web dynpro code ( using Import Web service Model ( Not adaptive ))
    Successfully consumed.
    But the Web Service Model is not getting executed by this code -
    Request_CreatePortalUsrWebServiceViDocument_createUsr createPrtUsr = new Request_CreatePortalUsrWebServiceViDocument_createUsr();
         wdContext.nodeREQUEST_CREATEPORTALUSRWEBSERVICEVIDOCUMENT_CREATEUSR().bind( createPrtUsr );
    try {
         wdContext.currentREQUEST_CREATEPORTALUSRWEBSERVICEVIDOCUMENT_CREATEUSRElement().modelObject().execute();
              wdContext.nodeResponse().invalidate();
         } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
    This Web Service resides on the local portal server.
    Thanks,

    Hi,
    First, have you tested that the web service works if you run it directly in the WS Navigator?
    Here is a snippet of how I usually call web services:
    public void getUserControlTable( )
        //@@begin getUserControlTable()
              //     Clear down existing context
              wdContext.nodeGetUserControlTable().invalidate();
              // Create model object
              DBMaint_ConfigServicesFactoryWS model = new DBMaint_ConfigServicesFactoryWS();
              // Create context elements
              Request_GetUserControlTable request = new Request_GetUserControlTable(model);
              GetUserControlTable method = new GetUserControlTable(model);
              request.setGetUserControlTable(method);
              // Bind to context
              wdContext.nodeGetUserControlTable().bind(request);
              // Call service
              try {
                   wdContext.nodeGetUserControlTable().currentGetUserControlTableElement().modelObject().execute();
              } catch (Exception ex) {
                   wdThis.wdFireEventDisplayDebugMessage(
                        "Error calling CanUserConfigureApp service - " + ex.getCause().toString());
                   wdThis.wdFireEventDisplayErrorMessage(
                        "Unable to read User Control table - configuration not currently possible",
                        null,
                        null);
                   return;
        //@@end
    I'm not sure why you aren't creating a model object as I cannot instantiate my objects without it - maybe it is because you are using a non-adaptive WS model.  Why aren't you using the adaptive WS Model?
    Also, I don't see where you are creating a method/operation object, you only seem to create the top level Request object.  I'd expect you to need to create the operation level object too and add that into the request, as I do above.
    There is little point in outputting the stack trace like that - I always use the message manager object to display errors and debug message on screen.  I think you should at least add some debug messages to try and pinpoint what is going wrong.
    Gareth.

  • Model object is not getting executed

    hi,
       I have created a model and iam getting values from back end using RFC.The values are not retrieved in front end and found that my model object is not getting executed.how to rectify this problem.please help me out.
                                                                                    regards
                                                                                    Sharanya.R

    Hi,
    Please psot your code for analysing, and also check whether it conforms to following coding:
    // Create a new instance of the Bapi_Flight_Getlist_Input model object
    bapiInput =Bapi_Flight_Getlist_Input();
    // Create the structured input parameters required for this RFM
    Bapisfldst destTo = new Bapisfldst();
    Bapi_Flight_Getlist_Input bapiInput;
    Bapisfldst destFrom = new Bapisfldst();
    // Add the DESTINATION_TO and DESTINATION_FROM parameter objects to the
    // model object representing the input side of the BAPI interface
    bapiInput.setDestination_To(destTo);
    bapiInput.setDestination_From(destFrom);
    // Bind the model object instance to context model node
    wdContext.nodeBapi_Flight_Getlist_Input().bind(bapiInput);
    bapiInput.execute();
    // If the execution is successful, then invalidate
    // the corresponding output node
    wdContext.nodeOutput().invalidate();

  • Deadline branch not getting executed

    Hi
    In my BPM i have an infinite loop and also the deadline branch with inerval as 1 minute (for testing purpose) but when i send the message my deadline branch does not get executed after 1 minute and it keeps on waiting.
    in the bpm monitoring it shows wait step created.
    i have verified my design with the standard pattern available, and it is almost similar.
    i am not able to find out the reason behind this strange behavior.
    Regards
    Dheeraj

    Hi Saravana
    i did exactly the same, i have my deadline branch, in it i have my control step which trows exception, which is catched by my exception branch and does nothing, so ideally it should continue the processing after that.
    but the problem is the exception is never thrown.
    my deadline has been configured as
    Reference Date/Time: Creating the step
    Duration: 1
    Unit: Minutes
    control step in deadline branch
    Action: Throw Exception
    Exception: Time_out
    Exception branch
    Exception Handler: Time_Out
    and outside this block i have transformation and other steps... which shoul get excuted after 1 minute deadline.
    Regards
    Dheeraj

  • Tasks not getting executed as per schedule

    Hello Gurus,
    my query is with respect to tuxedo 7.1 / singleview 4.02.17.01.
    I am facing some new issues these days with singleview.
    Whenever we submit any task in singleview, it is not getting executed on its scheduled time.
    this has been happening from past few days.
    worstly,nothing has been found in logs.
    Interestingly, twice it happened that i took down the application & after the app was brought up,these "NOT" executed tasks started automatically.
    Why this could be happening?
    unix file " stdout" <standard output> is getting written heavily & reaching its MAX size ( 2 GB) in less than 24 hrs.
    i have changed its schedule as of now,but has it got anything with above problem?
    Finally,i have generated a new "ubbconfig" for tuxedo which will help in maximising billing performance.
    reason for this is in recent times i have observed that memory usage has increased .so this "ubb" contains maximum billing servers & rest minimum.if you have any idea on this,pls let me know.
    your suggestions & corrections are welcome.
    Thanks & Regards
    Abhijeet K

    Some follow up questions:
    - How did you migrate (dsmig ldif or binary import)
    - Did the accounts in .x have any custom password policies set?
    For a "new" and a migrated entry, can you check if a passwordpolicysubentry is configured?
    (search as directory manager and fetch the attribute)

  • Scheduled job not getting executed on a logical standby

    Hello,
    We have created a job(through dbms_scheduler API). The job is enabled and shows up in the SCHEDULERJOBS view also.
    However the job does not get executed. I looked into the following tables there was no relevant entry found for the aforesaid job:
    select * from all_scheduler_job_log
    select * from dba_scheduler_running_jobs
    select * from DBA_SCHEDULER_JOB_RUN_DETAILS order by log_date desc
    Is there any limitation that we cannot execute scheduled jobs on a logical standby database. If i execute the relevant program (that is configured to be run as job in this scenario) as an individual procedure from SQL plus, it gets executed successfully implying there is no errors/problem in the subprogram that the job is going to invoke.
    Appreciate your thoughts in this regard.
    Thanks.

    Hi Justin,
    Thanks for your response.
    As per the app design, the job invokes a stored program(that maps to a stored procedure present in standby db itself) that reads the data from standby and populates the relevant tables/entities in another database(third db, not primary or standby) which acts as a repository. No write operations are to be performed on standby.
    So, i have two doubts:
    -- Can scheduled jobs execute on logical standby db[Oracle release 10g(R2)]
    I was going through few of the oracle docs and it is mentioned that this is a known limitation in 10g
    R2 release and has been corrected in 11g. Now we have something called database_role
    attribute that needs to be set to 'LOGICAL STANDBY' if you need to execute a job on
    standby. However it is available in 11g onwards.
    -- If there is no workaround for the above mentioned problem in 10g-R2 release.
    Then we may have to schedule a job from third db instance that shall invoke the program(residing on the standby db). Can we have a scheduled job which executes a program that maps to a remote stored procedure instead of local stored procedure?
    Appreciate your thoughts.
    Thanks

  • Fault policies not getting executed for called BPEL process

    Hi,
    I am facing one issue in execution of fault policy for a called BPEL Process.
    I have two BPEL Processes - BPELProcess1 and BPELProcess2.
    We have fault-policies and fault-bindings file.
    Case1 - BPELProcess2 is synchronous :-
    BPELProcess2 throws a fault of selectionFailure.
    Now this fault is defined in fault-policies and fault policy is bound to BPELProcess2 component in fault-bindings.xml file.
    But this fault policy is NOT getting executed.
    This selectionFailure fault from BPELProcess2 goes unhandled and in BPELProcess1, invoke activity gets this unhandled fault and raises a fault "remoteFault".
    This remotefault is also defined in fault-bindings and bound to BPELProcess1 component. Here fault policy bound to BPELProcess1 is working fine.
    So problem is that for called process, fault policies are not getting executed while for calling process, they are getting executed.
    Case1 - BPELProcess2 is Asynchronous
    BPELProcess2 is asynchronous. So same situation happening here. Fault policy for BPELProcess2 is not getting executed on throwing selectionFailure.
    But now here, since BPELProcess2 is async in nature, BPELProcess1 is not getting response and it is always waiting for response which is wrong.
    So how can we use fault policies in this case?
    Please suggest.
    Thanks & Regards,
    Parshant

    So that means - only fault originating from invoke activity in BPEL can be associated with a fault policy. No other fault can be associated. Even if I throw a selectionFault from throw activity, that will not be captured. Only fault from invoke activity can be associated with a fault policy.
    Please confirm.
    Thanks,
    Edited by: 833944 on Feb 24, 2011 9:36 PM

  • BADI is not getting executed in Portal (Front end)

    Hello Portal Gurus
    We have developed a new enhancement recently and it is not getting executed in Portal...what will be reason...?
    Can someone please help me out in this...

    Hi Vijay,
    It'll be a bit easier to point out some probable solutions if you can give some details regarding the error that you are getting... Also if you can mention the EP version it'll be great..
    Thanks,
    Pinac

  • Workflow not getting executed

    Hello friends.
    I am new to workflows. i  have created a sample workflow to cteate a material and then to display it. i have created all the std tasks successfully, and also in the workflow builder all is fine. but when i try to test it by executing the workflow, it is not getting executed, it gives a status message saying "Current status in process". please tell me the solution for this.
    Thanks and Regards.
    Vishal VH.

    Go and check what is happening in the workflow log.
    After executing the workflow, run transaction SWIA and check the log. You can also check the containers there along with the graphical runtime display
    Cheers
    Anirban

  • Infopackage not getting executed through Process Chain

    Hi All,
    I am facing a strange issue in BW Process Chain. Sometimes 3 Infopakages in my Process Chain is not getting executed and the variants get stucked in Yellow state. I checked the status of variants in RSPCPROCESSLOG table and they went in Undefined State.
    Can anyone tell why this happening and how to resolve that issue permanently.
    Thanks,
    Javed

    Hi Javed,
    When you trigger the process manually, it might work.
    But, as Raman told - some times due to huge number of loads running at the same time, the Back ground processes will be heavily occupied and loads will stuck. By the time, you trigger them manually; they will be successful due to some of the back ground processes which becomes free by that time.
    Though this will not happen all the time. But this can also be the reason. Try checking, if the loads are getting stuck in yellow with "Target event" "with parameter" getting generated in display messages --> chain tab or not.
    Thanks,
    Vikranth.

  • SQL not getting executed

    Hi,
    My sql below is not getting executed.There are no errors but even after long time it is not producing any thing (error or result).
    I am getting results till the statement SELECT D.budeptmap_v88_dept_id ,
    but when I right the last statement on top of this nothing is coming.
    select u.dw_code_skey,u.dw_code from dw.agg_inscope_top_nodes t, dw.dw_codes u
    where
    t.TOP_NODE_TR_HDR_SKEY = u.DW_CODE_TR_HDR_SKEY
    and u.DW_CODE_SUPERTYPE_CODE = 'DEPT'
    and u.DW_CODE_DW_CUR_IND = 'Y'
    and u.DW_CODE_DW_DEL_IND = 'N'
    and u.DW_CODE in(
    SELECT D.budeptmap_v88_dept_id
    from DW.CLIENT_ACCOUNTS C,DW.AON_V75_V88_BU_DEPT_MAP_SDO D
    WHERE D.budeptmap_v75_dept_id = '-1'
    AND D.budeptmap_v75_bu_id IN(C.cli_acct_producing_offICE_code)
    AND C.CLI_ACCT_DW_CUR_IND='Y'
    AND CLI_ACCT_SKEY IN (
    SELECT A.CLI_SUM_CLI_ACCT_SKEY
    FROM PROFIT.FACT_CLIENT_SUMMARIES A
    WHERE A.CLI_SUM_PERIOD_SKEY = 3
    AND A.DM1_TOT_ADJUSTED_REV_AMT =
    (SELECT MAX(DM1_TOT_ADJUSTED_REV_AMT)
    FROM PROFIT.FACT_CLIENT_SUMMARIES B
    WHERE B.CLI_SUM_ENTITY_SKEY =A.CLI_SUM_ENTITY_SKEY
    AND B.CLI_SUM_PERIOD_SKEY =3)))
    any help in tunning is highly appreciated.
    Thanks in advance

    how long does this query takes to complete?
            SELECT D.budeptmap_v88_dept_id
              from DW.CLIENT_ACCOUNTS C,
                   DW.AON_V75_V88_BU_DEPT_MAP_SDO D
             WHERE D.budeptmap_v75_dept_id = '-1'
               AND D.budeptmap_v75_bu_id IN (C.cli_acct_producing_offICE_code)
               AND C.CLI_ACCT_DW_CUR_IND = 'Y'
               AND CLI_ACCT_SKEY IN (SELECT A.CLI_SUM_CLI_ACCT_SKEY
                                       FROM PROFIT.FACT_CLIENT_SUMMARIES A
                                      WHERE A.CLI_SUM_PERIOD_SKEY = 3
                                        AND A.DM1_TOT_ADJUSTED_REV_AMT =
                                            (SELECT MAX(DM1_TOT_ADJUSTED_REV_AMT)
                                               FROM PROFIT.FACT_CLIENT_SUMMARIES B
                                              WHERE B.CLI_SUM_ENTITY_SKEY =A.CLI_SUM_ENTITY_SKEY
                                                AND B.CLI_SUM_PERIOD_SKEY =3))

Maybe you are looking for

  • I have no audio when using chrome

    I have no audio when using chrome. I have audio when using Internet explorer and when playing from my pc. I have tried uninstalling chrome and flash player then reinstalling them. have tried FAQ on chromes site and Adobe's site. did not work.

  • Jiggling iCal causes content display to scroll

    Okay, it isn't a show stopper but it is interesting and I wonder if anyone else can replicate it... 1 - open iCal making sure it is displayed about half way down the screen 2 - make sure that the scroll bar is about half way down 3 - grab the grey bi

  • RMAN job failed

    HI, I am having issue during databaseFUll backup through RMAN. Below is error msg. RMAN> RMAN> new incarnation of database registered in recovery catalog starting full resync of recovery catalog sql statement: alter system checkpoint global Edited by

  • Need help changing query

    There has been change to requirements and i'm not sure how to change my query to handle the changes. The table basically has entries for each end point of a connection and the query combines the from/to row. Now the requirement change is that the con

  • Cameras compatible with FCP

    Hello everyone. I'm curious to find out if there is a list that apple or FCP puts out that has all the cameras that are compatible with FCP and if it stays current. About a month ago I was at the beach and my home video camera was left unattended, an