Please help me to identify unnecessary code in these two procedures

Hi,
Please help me to tune these two procedures.
I think some unnecessary code is existed in these two procedures.
Please help me to identify those lines.
  PROCEDURE InsertIntoScoreTables(pBUID       IN ORDER_SCORE_REASON.BUID%TYPE,
                                  OrderNum    IN ORDER_SCORE_REASON.ORDER_NUM%TYPE,
                                  ReasonCode  IN MASTER_REASON.REASON_CODE%TYPE,
                                  MatchResult IN ORDER_SCORE_REASON.MATCH_RESULT%TYPE,
                                  ScoreType   IN MASTER_REASON.REASON_TYPE%TYPE,
                                  AddressType IN MASTER_REASON.ADDRESS_TYPE%TYPE) IS
    tCount       NUMBER := 0;
    tScoreID     MASTER_REASON.REASON_ID%TYPE := 0;
    tReasonSeq   MASTER_REASON.REASON_SEQ%TYPE := 0;
    tAddressType MASTER_REASON.ADDRESS_TYPE%TYPE := AddressType;
    tExists NUMBER :=0;
  BEGIN
    if AddressType is NULL then
       tAddressType:='';
    end if;
    IF LENGTH(tAddressType) > 0 THEN
      SELECT COUNT(mstr.reason_code)
        INTO tCount
        FROM MASTER_REASON mstr
       WHERE mstr.REASON_CODE = ReasonCode AND mstr.ENABLED_FLAG = 'Y' AND
             mstr.ADDRESS_TYPE = tAddressType AND
             mstr.REASON_TYPE = ScoreType;
    ELSE
      SELECT COUNT(mstr.reason_code)
        INTO tCount
        FROM MASTER_REASON mstr
       WHERE mstr.REASON_CODE = ReasonCode AND mstr.ENABLED_FLAG = 'Y' AND
             mstr.REASON_TYPE = ScoreType;
    END IF;
    IF tCount > 0 THEN
      IF LENGTH(tAddressType) > 0 THEN
        SELECT mstr.REASON_ID, mstr.REASON_SEQ
          INTO tScoreID, tReasonSeq
          FROM MASTER_REASON mstr
         WHERE mstr.REASON_CODE = ReasonCode AND mstr.ENABLED_FLAG = 'Y' AND
               mstr.ADDRESS_TYPE = tAddressType AND
               mstr.REASON_TYPE = ScoreType AND ROWNUM = 1;
      ELSE
        SELECT mstr.REASON_ID, mstr.REASON_SEQ
          INTO tScoreID, tReasonSeq
          FROM MASTER_REASON mstr
         WHERE mstr.REASON_CODE = ReasonCode AND mstr.ENABLED_FLAG = 'Y' AND
               mstr.REASON_TYPE = ScoreType AND ROWNUM = 1;
      END IF;
      /*INSERT INTO SCORE_REASON_CODES (ORDER_NUM, BUID, ADDRESS_TYPE, REASON_CODE, REASON_SEQ, VENDOR_CODE, MATCH_RESULT)
      VALUES (OrderNum, BUID, tAddressType, ReasonCode, tReasonSeq, VendorCode, MatchResult);*/
      SELECT COUNT(*) INTO tExists FROM ORDER_SCORE_REASON WHERE ORDER_NUM = OrderNum AND BUID = pBUID AND REASON_ID = tScoreID;
      IF tExists > 0 THEN
         DELETE FROM ORDER_SCORE_REASON WHERE ORDER_NUM = OrderNum AND BUID = pBUID AND REASON_ID = tScoreID;
      END IF;
      INSERT INTO ORDER_SCORE_REASON
        (ORDER_NUM,
         BUID,
         REASON_ID,
         REASON_SEQ,
         MATCH_RESULT,
         CREATED_BY,
         CREATED_DATE)
      VALUES
        (OrderNum,
         pBUID,
         tScoreID,
         tReasonSeq,
         MatchResult,
         'ISR',
         SYSDATE);
      --todo: comment below line when done
      --COMMIT;
    END IF;
  END InsertIntoScoreTables;
  PROCEDURE InsertNegScoringtoTable(pBUID         IN ORDER_SCORE_REASON.BUID%TYPE,
                                    OrderNum      IN ORDER_SCORE_REASON.ORDER_NUM%TYPE,
                                    ReasonCode    IN MASTER_REASON.REASON_CODE%TYPE,
                                    MatchResult   IN ORDER_SCORE_REASON.MATCH_RESULT%TYPE,
                                    ScoreType     IN MASTER_REASON.REASON_TYPE%TYPE,
                                    AddressType   IN MASTER_REASON.ADDRESS_TYPE%TYPE,
                                    MatchingBUIDs IN Varchar2) IS
    tCount            NUMBER := 0;
    tScoreReasonCount NUMBER := 0;
    tScoreID          MASTER_REASON.REASON_ID%TYPE := 0;
    tReasonSeq        MASTER_REASON.REASON_SEQ%TYPE := 0;
    tAddressType      MASTER_REASON.ADDRESS_TYPE%TYPE := AddressType;
  BEGIN
    if AddressType is NULL then
       tAddressType:='';
    end if;
    IF LENGTH(tAddressType) > 0 THEN
      SELECT COUNT(mstr.reason_code)
        INTO tCount
        FROM MASTER_REASON mstr
       WHERE mstr.REASON_CODE = ReasonCode AND mstr.ENABLED_FLAG = 'Y' AND
             trim(mstr.ADDRESS_TYPE) = tAddressType AND
             mstr.REASON_TYPE = ScoreType;
    ELSE
      SELECT COUNT(mstr.reason_code)
        INTO tCount
        FROM MASTER_REASON mstr
       WHERE mstr.REASON_CODE = ReasonCode AND mstr.ENABLED_FLAG = 'Y' AND
             mstr.REASON_TYPE = ScoreType;
    END IF;
    IF tCount > 0 THEN
      IF LENGTH(tAddressType) > 0 THEN
        SELECT mstr.REASON_ID, mstr.REASON_SEQ
          INTO tScoreID, tReasonSeq
          FROM MASTER_REASON mstr
         WHERE mstr.REASON_CODE = ReasonCode AND mstr.ENABLED_FLAG = 'Y' AND
               mstr.ADDRESS_TYPE = tAddressType AND
               mstr.REASON_TYPE = ScoreType AND ROWNUM = 1;
      ELSE
        SELECT mstr.REASON_ID, mstr.REASON_SEQ
          INTO tScoreID, tReasonSeq
          FROM MASTER_REASON mstr
         WHERE mstr.REASON_CODE = ReasonCode AND mstr.ENABLED_FLAG = 'Y' AND
               mstr.REASON_TYPE = ScoreType AND ROWNUM = 1;
      END IF;
      /*INSERT INTO SCORE_REASON_CODES (ORDER_NUM, BUID, ADDRESS_TYPE, REASON_CODE, REASON_SEQ, VENDOR_CODE, MATCH_RESULT)
      VALUES (OrderNum, BUID, tAddressType, ReasonCode, tReasonSeq, VendorCode, MatchResult);*/
      If tScoreID is not Null Then
        SELECT COUNT(REASON_ID)
          INTO tScoreReasonCount
          FROM ORDER_SCORE_REASON
         WHERE BUID = pBUID AND ORDER_NUM = OrderNum AND
               REASON_ID = tScoreID;
        If tScoreReasonCount = 0 Then
          INSERT INTO ORDER_SCORE_REASON
            (ORDER_NUM,
             BUID,
             REASON_ID,
             REASON_SEQ,
             MATCH_RESULT,
             CREATED_BY,
             CREATED_DATE,
             MATCH_BUIDS)
          VALUES
            (OrderNum,
             pBUID,
             tScoreID,
             tReasonSeq,
             MatchResult,
             'ISR',
             SYSDATE,
             MatchingBUIDs);
        End If;
      End If;
      --todo: comment below line when done
      --COMMIT;
    END IF;
  END InsertNegScoringtoTable;Thanks in advance.

PROCEDURE insertintoscoretables (
   pbuid         IN   order_score_reason.buid%TYPE,
   ordernum      IN   order_score_reason.order_num%TYPE,
   reasoncode    IN   master_reason.reason_code%TYPE,
   matchresult   IN   order_score_reason.match_result%TYPE,
   scoretype     IN   master_reason.reason_type%TYPE,
   addresstype   IN   master_reason.address_type%TYPE
IS
   tcount         NUMBER                            := 0;
   tscoreid       master_reason.reason_id%TYPE      := 0;
   treasonseq     master_reason.reason_seq%TYPE     := 0;
   taddresstype   master_reason.address_type%TYPE   := addresstype;
   texists        NUMBER                            := 0;
BEGIN
   IF addresstype IS NULL
   THEN
      taddresstype := NULL;
   END IF;
--   IF LENGTH (taddresstype) > 0
--   THEN
   BEGIN
      SELECT COUNT (mstr.reason_code)
        INTO tcount
        FROM master_reason mstr
       WHERE mstr.reason_code = reasoncode
         AND   mstr.enabled_flag = 'Y'
              AND (  LENGTH (taddresstype) > 0
              AND mstr.address_type = taddresstype
         AND mstr.reason_type = scoretype;
   EXCEPTION
      WHEN NO_DATA_FOUND
      THEN
         tscoreid := NULL;
         treasonseq := NULL;
      WHEN OTHERS
      THEN
         raise_application_error (-20223, 'others');
   END;
--   ELSE
--      SELECT COUNT (mstr.reason_code)
--        INTO tcount
--        FROM master_reason mstr
--       WHERE mstr.reason_code = reasoncode
--         AND mstr.enabled_flag = 'Y'
--         AND mstr.reason_type = scoretype;
--   END IF;
   IF tcount > 0
   THEN
      BEGIN
         SELECT mstr.reason_id, mstr.reason_seq
           INTO tscoreid, treasonseq
           FROM master_reason mstr
          WHERE mstr.reason_code = reasoncode
            AND mstr.enabled_flag = 'Y'
            AND (LENGTH (taddresstype) > 0
                 AND mstr.address_type = taddresstype
            AND mstr.reason_type = scoretype
            AND ROWNUM = 1;
      EXCEPTION
         WHEN NO_DATA_FOUND
         THEN
            tscoreid := NULL;
            treasonseq := NULL;
         WHEN OTHERS
         THEN
            raise_application_error (-20223, 'others');
      END;
      /*INSERT INTO SCORE_REASON_CODES (ORDER_NUM, BUID, ADDRESS_TYPE, REASON_CODE, REASON_SEQ, VENDOR_CODE, MATCH_RESULT)
      VALUES (OrderNum, BUID, tAddressType, ReasonCode, tReasonSeq, VendorCode, MatchResult);*/
      BEGIN
         SELECT 'Y'
           INTO texists
           FROM order_score_reason
          WHERE order_num = ordernum AND buid = pbuid AND reason_id = tscoreid;
         IF SQL%ROWCOUNT = 0
         THEN
            BEGIN
               INSERT INTO order_score_reason
                           (order_num, buid, reason_id, reason_seq,
                            match_result, created_by, created_date
                    VALUES (ordernum, pbuid, tscoreid, treasonseq,
                            matchresult, 'ISR', SYSDATE
            EXCEPTION
               WHEN OTHERS
               THEN
                  raise_application_error (-20223, 'others');
            END;
         ELSE
            BEGIN
               DELETE FROM order_score_reason
                     WHERE order_num = ordernum
                       AND buid = pbuid
                       AND reason_id = tscoreid;
            EXCEPTION
               WHEN OTHERS
               THEN
                  raise_application_error (-20223, 'others');
            END;
         END IF;
      END;
--      IF texists > 0
--      THEN
--         DELETE FROM order_score_reason
--               WHERE order_num = ordernum
--                 AND buid = pbuid
--                 AND reason_id = tscoreid;
--      END IF;
   -- INSERT INTO order_score_reason
--                  (order_num, buid, reason_id, reason_seq, match_result,
--                   created_by, created_date
--           VALUES (ordernum, pbuid, tscoreid, treasonseq, matchresult,
--                   'ISR', SYSDATE
   --todo: comment below line when done
   --COMMIT;
   END IF;
END insertintoscoretables;
PROCEDURE insertnegscoringtotable (
   pbuid           IN   order_score_reason.buid%TYPE,
   ordernum        IN   order_score_reason.order_num%TYPE,
   reasoncode      IN   master_reason.reason_code%TYPE,
   matchresult     IN   order_score_reason.match_result%TYPE,
   scoretype       IN   master_reason.reason_type%TYPE,
   addresstype     IN   master_reason.address_type%TYPE,
   matchingbuids   IN   VARCHAR2
IS
   tcount              NUMBER                            := 0;
   tscorereasoncount   NUMBER                            := 0;
   tscoreid            master_reason.reason_id%TYPE      := 0;
   treasonseq          master_reason.reason_seq%TYPE     := 0;
   taddresstype        master_reason.address_type%TYPE   := addresstype;
BEGIN
   IF addresstype IS NULL
   THEN
      taddresstype := '';
   END IF;
   BEGIN
      SELECT COUNT (mstr.reason_code)
        INTO tcount
        FROM master_reason mstr
       WHERE mstr.reason_code = reasoncode
         AND mstr.enabled_flag = 'Y'
              AND  (   LENGTH (taddresstype) > 0
              AND mstr.address_type = taddresstype
         AND mstr.reason_type = scoretype;
   EXCEPTION
      WHEN NO_DATA_FOUND
      THEN
         tscoreid := NULL;
         treasonseq := NULL;
      WHEN OTHERS
      THEN
         raise_application_error (-20223, 'others');
   END;
   IF tcount > 0
   THEN
      BEGIN
         SELECT mstr.reason_id, mstr.reason_seq
           INTO tscoreid, treasonseq
           FROM master_reason mstr
          WHERE mstr.reason_code = reasoncode
            AND mstr.enabled_flag = 'Y'
            AND (LENGTH (taddresstype) > 0
                 AND mstr.address_type = taddresstype
            AND mstr.reason_type = scoretype
            AND ROWNUM = 1;
      EXCEPTION
         WHEN NO_DATA_FOUND
         THEN
            tscoreid := NULL;
            treasonseq := NULL;
         WHEN OTHERS
         THEN
            raise_application_error (-20223, 'others');
      END;
      /*INSERT INTO SCORE_REASON_CODES (ORDER_NUM, BUID, ADDRESS_TYPE, REASON_CODE, REASON_SEQ, VENDOR_CODE, MATCH_RESULT)
      VALUES (OrderNum, BUID, tAddressType, ReasonCode, tReasonSeq, VendorCode, MatchResult);*/
      IF tscoreid IS NOT NULL
      THEN
         SELECT 'Y'
           INTO tscorereasoncount
           FROM order_score_reason
          WHERE buid = pbuid AND order_num = ordernum AND reason_id = tscoreid;
         IF SQL%ROWCOUNT = 0                           --tscorereasoncount = 0
         THEN
            BEGIN
               INSERT INTO order_score_reason
                           (order_num, buid, reason_id, reason_seq,
                            match_result, created_by, created_date,
                            match_buids
                    VALUES (ordernum, pbuid, tscoreid, treasonseq,
                            matchresult, 'ISR', SYSDATE,
                            matchingbuids
            EXCEPTION
               WHEN OTHERS
               THEN
                  raise_application_error (-20223, 'others');
            END;
         END IF;
      END IF;
   --todo: comment below line when done
   --COMMIT;
   END IF;
END insertnegscoringtotable;regards,
friend
Edited by: most wanted!!!! on Apr 22, 2013 3:49 AM

Similar Messages

  • Please help me transform this C++ code to java code....

    guys...please help me transform this C++ code to java code....please try to explain the code..thanks
    [program]
    #include <stdio.h>
    #define ALIVE 1
    #define DEAD 0
    #define SZ 33
    int stschk (int ,int );
    main()
    int s[SZ][SZ], i, j;
    for (i=0; i<sz; i++ ) s[0] = DEAD;
    for (j=0; j<sz; j++ ) s[0][j] = DEAD;
    s[0][1] = ALIVE;
    for (i=0; i<sz-1; i++) {
    for ( j=1;j<sz;j++ ) {
    s[i][j] = stschk(s[i][j-1],s[i+1][j];
    if(s[i][j-1]==ALIVE) printf("*");
    else printf(" ");
    printf("\n");
    int stschk(int s1,int s2)
    if(((s1==DEAD)&&(s2==ALIVE))||
    ((s1==ALIVE)&&(s2==DEAD))) return ALIVE;
    else return DEAD;

    Being picky, that's not C++, that's C. Standard headers in C++ dont' have .h after them, loop variables are scoped with the for, you use constants rather than #defines, etc..
    C and C++ both don't initialise arrays by default; you'd have to write an initialiser to get it to zero out the array:
        int s[sz][sz] = {};gcc will insert a call to memset to zero the array.
    If the author was assuming that the array was zeroed out, there would be no point zeroing the first row and column.
    The code reads values which haven't been initialised. If you mark such values explicitly undefined, and change the program to report an error when undefined, then you get several cases where the program makes such report.
    So either it' s a primitive random number generator (some random number generators use uninitialised memory as a source of randomness), or it's buggy, or it's processing undefined data and throwing away the result. Either way, it cannot be directly be ported to Java if the undefined values (which are limited to a small area of the ouput) are significant.

  • I forgot restrictions cod in ipad air1 and don't off it , please help me for recovery this cod

    i forgot restrictions cod in ipad air1 and don't off it , please help me for recovery this cod...

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
    A
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    7. iOS - Unable to update or restore
    Forgotten Restrictions Passcode Help
                iPad,iPod,iPod Touch Recovery Mode
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    You can restore from a backup if you have one from BEFORE you set the restrictions passcode.
    Also, see iTunes- Restoring iOS software.
    And also see How to Recover Forgotten iPhone, iPad Restrictions Passcode.

  • Please help me to complete this code

    import java.security.MessageDigest;
    import java.util.Map;
    import java.util.Scanner;
    public class PasswordService
       //The hash is to be formed using the SHA algorithm
       //to create a MessageDigest
       private final String algorithmName = "SHA";
       //Use a message digest to create hashed passwords
       private MessageDigest md = null;
       //We simulate a database of users using who have a login and password
       //as a key and value pair in a Map
       private Map<String, byte[]> userData;
       //complete the constructor
       public PasswordService()
         //TODO - intialize the class instance data
          //some dummy data - do not alter these lines
          addUser("daddy", "cool");
          addUser("nightflight", "topChat");
          addUser("boney", "2E5sxuSRg6A");
       public void showProvider()
          //TODO
       //Get the hash value for the provided string password.
         public byte[] getHash(String password)
          //TODO
          return null;
       public void addUser(String login, String password)
          //TODO
       public byte[] getPassword(String login)
          //TODO
          return null;
       public boolean checkLogin(String login, String password)
         // TODO
          return false;
       //This method is provided to perform a login from the command line
       public boolean doLogin()
          Scanner sc = new Scanner(System.in);
          System.out.println("Enter login please");
          String login = sc.next();
          System.out.println("Your password please");
          String password = sc.next();
          return checkLogin(login, password);
       public static void main(String[] args)
          int attempts = 0;
          showProvider();
          while(attempts < 4)
             boolean match = doLogin(); //request login and password
             System.out.println("match? " + match);
             attempts++;
    }

    please help me to complete this code
    void completeCode(Code code,Properties options) throws CodeCompletingException
    CodeCompleterFactory cf = CodeCompleterFactory.newInstance();
    CodeCompleter cc = cf.newCodeCompleter();
    cc.complete(code,options);
    }

  • HT4061 HI... i want to replace my front screen of 4S. Please help me to identify original screen with fakes?

    i want to replace my front screen of 4S. Please help me to identify original screen with fakes?

    Apple does not sell parts.
    Either get the entire device replaced under Out of Warranty exchange or take your chances with non-oem parts.

  • I ordered mac OS and I got the email for License and I didnt get the attachement for content code. Please help me getting the content code.

    I ordered mac OS and I got the email for License and I didnt get the attachement for content code. Please help me getting the content code.

    It's a two email process, one email has a locked pdf with the redemption code. The second email has the password to unlock the pdf. They come separetly, so you may have to wait for the 2nd to arrive.

  • PLEASE HELP! Photoshop CS3 Error code

    My photoshop out of the blue just stopped working. It goes go to the loading part, then it finishes loading. Stays there for like 5 seconds then it crashes.
    Adobe Fireworks works perfect, however photoshop doesn't anymore.
    Please help, this is urgent as I use photoshop daily.
    I deleted the preferences. Held shift, del and ctrl and deleted the settings. but still nothing. I renamed the "twain32" and still nothing.
    This is the error information
    Problem signature:
      Problem Event Name:    APPCRASH
      Application Name:    Photoshop.exe
      Application Version:    10.0.0.0
      Application Timestamp:    4601eae8
      Fault Module Name:    StackHash_1703
      Fault Module Version:    0.0.0.0
      Fault Module Timestamp:    00000000
      Exception Code:    c0000005
      Exception Offset:    00000000
      OS Version:    6.0.6000.2.0.0.256.1
      Locale ID:    1033
      Additional Information 1:    1703
      Additional Information 2:    2264db07e74365624c50317d7b856ae9
      Additional Information 3:    1344
      Additional Information 4:    875fa2ef9d2bdca96466e8af55d1ae6e
    PLEASE HELP!

    A quick google returned:
    The problem is that there's no such module as "StackHash_1703", so this  appears to be some special case in Windows. I tried turning off  antivirus and enabling compatibility mode, but the application still  would not work.
    The problem was that I had DEP (Data Execution Protection) enabled. For  whatever reason, the error message gave me the AppCrash error above  instead of the standard message about "DEP has closed the program."
    To solve the problem, I added the application to the DEP exclusion list and everything worked again.

  • Please help me find out my code..I am using msg ACCept and Reject

    Please anyone help me...
    I am using MSG ACCEPT and REJECT...
    but my code when I execute it...it keep show out MSG REJECT...
    Please help me...Thanks a lot....
    public class Addmission
    public static void main(String[] args) throws Exception
    char Message;
    double GPA = 3.0;
    int ATS = 60;
    int ATScore = 80;
    System.out.println("Enter your Grade Point Average");
    GPA = (char)System.in.read();
    System.out.println("Enter your Addmission Test Score");
    ATS =(char)System.in.read();
    System.in.read(); System.in.read();
         if(GPA >= 3.0 && ATS == 60)
    System.out.println("Accept");
    if(GPA <= 3.0 && ATScore == 80)
    System.out.println("Accept");
    else
    System.out.println("Reject");

    I need to do like... but my code doens't show msg "Accept" it keep going to show "REJECT"
    Could anyone help me out?
    Print the msg "Accept" if the student has any of the following:
    * A grade point average of 3.0 or above and admission test score of at least 60
    * A grade point average of below 3.0 and an admission test score of at least 80.If the student doesn't meet either of the qualification criteria, print "Reject"
    public class Addmission
    public static void main(String[] args) throws Exception
    char Message;
    double GPA = 3.0;
    int ATS = 60;
    int ATScore = 80;
    System.out.println("Enter your Grade Point Average");
    GPA = (char)System.in.read();
    System.out.println("Enter your Addmission Test Score");
    ATS =(char)System.in.read();
    System.in.read(); System.in.read();
    if(GPA >= 3.0 && ATS == 60)
    System.out.println("Accept");
    if(GPA <= 3.0 && ATScore == 80)
    System.out.println("Accept");
    else
    System.out.println("Reject");

  • Please help me out with my code I am writing MSG ACCEPT & REJECT

    Please anyone help me...
    I am using MSG ACCEPT and REJECT...
    but my code when I execute it...it keep show out MSG REJECT...
    Please help me...Thanks a lot....
    public class Addmission
    public static void main(String[] args) throws Exception
    char Message;
    double GPA = 3.0;
    int ATS = 60;
    int ATScore = 80;
    System.out.println("Enter your Grade Point Average");
    GPA = (char)System.in.read();
    System.out.println("Enter your Addmission Test Score");
    ATS =(char)System.in.read();
    System.in.read(); System.in.read();
         if(GPA >= 3.0 && ATS == 60)
    System.out.println("Accept");
    if(GPA <= 3.0 && ATScore == 80)
    System.out.println("Accept");
    else
    System.out.println("Reject");

    see the implementaiton of readAFloat() ...
    implementation of readAnInt() is left as an exercise to you.
    cheers
    public class Addmission
    public static void main(String[] args) throws Exception
    char Message;
    double GPA = 3.0;
    int ATS = 60;
    int ATScore = 80;
    System.out.println("Enter your Grade Point Average");
    GPA = readAFloat();
    System.out.println("Enter your Addmission Test Score");
    ATS = readAnInt();
    System.out.println(" Your GPA ["+GPA+"]");
    System.out.println(" Your ATS ["+ATS+"]");
    if(GPA >= 3.0 && ATS == 60)
    System.out.println("Accept");
    if(GPA <= 3.0 && ATScore == 80)
    System.out.println("Accept");
    else
    System.out.println("Reject");
    public static float readAFloat() throws Exception {
         byte ba[]=new byte[10];
         int len;
         len=System.in.read(ba, 0, ba.length);
         String s = new String(ba, 0, len);
         float f=Float.parseFloat(s);
         return(f);
    public static int readAnInt() throws Exception {
         return 80;

  • Please help me on inter-company code configuration steps

    Hi FICO Gurus,
    Please can you help me on inter-company code configuration steps and accounting entries for the same.
    Thanks for your help!!...
    Thanks & Regards,
    Kiran

    guys I still need help on this one...Thanks!

  • Please help - how to Identify if I received anothe...

    Hi All, 
    I am New for Nokia Lumia and using 730 model. The issues is, I am unable to identify if anyone is calling or not when I am in Call. ( It means, If I am in discussion with Person 'A', before close this call if Person 'B' called then I have to notify that... Usually, previous mobile given a beep sound, but in this LUmia it is not showing anything..) Did I missed any setup.. Please help me on this.  Thanks, Schoda. 

    @Schoda are you about the network feature ‘call waiting’?
    Lumia » menu » settings » network+ » button ‘set’ » call waiting: What is your current status there?

  • PLEASE HELP ME TO MODIFY THE CODE !

    DATA:BEGIN OF I_PARTNER OCCURS 0,
           VBELN LIKE VBPA-VBELN,
           adrnr like vbpa-adrnr,
           kunnr LIKE vbpa-kunnr,
           PARVW LIKE VBPA-PARVW,
           post_code1 LIKE adrc-post_code1,
           po_box LIKE adrc-po_box,
           name1 LIKE adrc-name1,
           name2 LIKE adrc-name2,
           city1 LIKE adrc-city1,
           city2 LIKE adrc-city2,
           country LIKE adrc-country,
           street LIKE adrc-street,
           str_suppl1 LIKE adrc-str_suppl1,
           str_suppl2 LIKE adrc-str_suppl2,
           str_suppl3 LIKE adrc-str_suppl3,
           vtext like tpart-vtext,
           ADRNP LIKE VBPA-ADRNP,
          SMTP_ADDR LIKE ADR6-SMTP_ADDR,
         END OF I_PARTNER.
    SELECT
    VBPA~VBELN
    vbpa~adrnr
    VBPA~PARVW
    VBPA~KUNNR
    VBPA~ADRNP
    TPART~VTEXT
    FROM VBPA AS VBPA
    INNER JOIN TPART AS TPART
    ON VBPAPARVW EQ TPARTPARVW
    AND SPRAS = SY-LANGU
    INTO CORRESPONDING FIELDS OF TABLE I_PARTNER
    WHERE
    VBPA~VBELN EQ S_VBELN.
    WRITE:/
      i_partner-adrnr         under         'ADDRESS NUMBER',
      i_partner-vbeln         UNDER         'Order-No',
      i_partner-parvw         UNDER         'Partner-Type',
      I_PARTNER-VTEXT         UNDER         'Partner-Type description',
      I_PARTNER-KUNNR         UNDER         'Partner-no'.
      ULINE.
    endloop.
    HERE I AM GETTING ALL THE POSSIBLE PARTNER TYPES.
    I WANT TO GET THE OUT PUT ONLY WHEN THE PARTNER TYPE S ARE  'SP'  'BP' AND 'SH'.
    PLEASE HELP.....

    Hi,
    Both the answers are correct... iam just writing the code u needed..
    ranges : gr_partner for tablename-fieldname.
    initialization.
    gr_partner-sign = 'I'.
    gr_partner-option = 'EQ'
    gr_partner-low = 'SP'
    append gr_partner.
    gr_partner-sign = 'I'.
    gr_partner-option = 'EQ'
    gr_partner-low = 'BP'
    append gr_partner.
    gr_partner-sign = 'I'.
    gr_partner-option = 'EQ'
    gr_partner-low = 'SH'
    append gr_partner.
    SELECT
    VBPA~VBELN
    vbpa~adrnr
    VBPA~PARVW
    VBPA~KUNNR
    VBPA~ADRNP
    TPART~VTEXT
    FROM VBPA AS VBPA
    INNER JOIN TPART AS TPART
    ON VBPAPARVW EQ TPARTPARVW
    AND SPRAS = SY-LANGU
    INTO CORRESPONDING FIELDS OF TABLE I_PARTNER
    WHERE
    VBPA~VBELN EQ S_VBELN
    and vbpa~parvw in gr_partner.
    Regards,
    Nagaraj

  • Please help regarding a PL/SQL Code for padding of digits

    I have a table named as EWT_POL_AGT_REL. There is column named PDT_AGENT_NBR present in this table. The data type of this column is
    VARCHAR2(8 byte). There are some records in with pdt_agent_nbr having 8 spaces and some starting with zero such as “08400”. So I want
    to do following things 1.)left-append a '0' in front of the existing 5 digit PDT_AGENT_NBR and make it to 8 digits 2) if the existing PDT_AGENT_NBR is already 8 digits, do nothing 3.) if it contains leading spaces then replace them by zero.
    Sceanrios
    if PDT_AGENT_NBR is " 12345" then i should get "00012345"
    if PDT_AGENT_NBR is "1234" then i should get "00001234"
    This table has nearly 180 million records hence an update query will not work. Instead a PL/SQL procedure needs to be developed.
    Please help me on this. Please

    This table has nearly 180 million records hence an update query will not work. Because..................?
    Instead a PL/SQL procedure needs to be developed.So you want it to be slower?

  • Please help, i am having trouble figuring it out- two sided dice

    In the game of Craps, a "Pass Line" bet proceeds as follows. Using two six-sided dice, the first roll of the dice in a craps round is called the "Come Out Roll." The bet immediately wins when the come out roll is 7 or 11, and loses when the come out roll is 2, 3, or 12. If 4, 5, 6, 8, 9, or 10 is rolled on the come out roll, that number becomes "the point." The player keeps rolling the dice until either 7 or the point is rolled. If the point is rolled first, then the player wins the bet. If the player rolls a 7 first, then the player loses.
    Write a program that plays the game of Craps using the rules stated above so that it simulates a game without human input. Instead of asking for a wager, the program should just calculate if the player would win or lose. The program should simulate rolling the two dice and calculate the sum. Add a loop so that the program plays 10,000 games. Add counters that count how many times the player wins, and how many times the player loses. At the end of the 10,000 games, compute the probability of winning, i.e. Wins / (Wins + Losses) and output this value. Over the long run, who is going to win the most games of Craps, you or the house?
    please help me in this project
    public class Kharel_Ch3_2 {
    public static int NUM_GAMES = 10000;
    public static void main(String[] args) {
    int numWins = 0;
    int numLosses = 0;
    int x;
    int y;
    x = (int)(Math.random()*6) + 1;
    y = (int)(Math.random()*6) + 1;
    System.out.println("The roll of first Dice is " + x);
    System.out.println("The roll of Second Dice is " + y);
    int roll = (x + y);
    System.out.println("The sum of two dice is " + (roll));
    int point = (4 & 5 & 6 & 8 & 9 & 10);
    for (int i = 1; i<=10000; i++)
    if (roll == 7 || roll == 11)
    System.out.println("You win!");
    numWins = numWins +1;
    else if (roll==2 || roll==3 || roll==12)
    System.out.println("You Lose!");
    numLosses = numLosses + 1;
    else
    System.out.println("Roll Dice again!!!");
    x = (int)(Math.random()*6) + 1;
    y = (int)(Math.random()*6) + 1;
    roll = (x + y);
    if (roll == point);
    while (roll !=7 || roll !=point)
    x=(int)(Math.random()*6);
    y=(int)(Math.random()*6);
    roll = (x + y);
    int sum = roll;
    if (roll== point)
    numWins = numWins+1;
    else numLosses=numLosses+1;
    // Output probability of winning
    System.out.println("In the simulation, we won " + numWins +
    " times and lost " + numLosses + " times, ");
    System.out.println("for a probability of " +
    (double)(numWins)/(double)(numWins + numLosses));
    }

    { public static int NUM_GAMES = 10000;
    public static void main(String[] args) {
    int numWins = 0;
    int numLosses = 0;
    int x;
    int y;
    x = (int)(Math.random()*6) + 1;
    y = (int)(Math.random()*6) + 1;
    System.out.println("The roll of first Dice is " + x);
    System.out.println("The roll of Second Dice is " + y);
    int roll = (x + y);
    System.out.println("The sum of two dice is " + (roll));
    int point = (4 & 5 & 6 & 8 & 9 & 10);
    for (int i = 1; i<=10000; i++)
    if (roll == 7 || roll == 11)
    System.out.println("You win!");
    numWins = numWins +1;
    else if (roll==2 || roll==3 || roll==12)
    System.out.println("You Lose!");
    numLosses = numLosses + 1;
    else
    System.out.println("Roll Dice again!!!");
    x = (int)(Math.random()*6) + 1;
    y = (int)(Math.random()*6) + 1;
    roll = (x + y);
    if (roll == point);
    while (roll !=7 || roll !=point)
    x=(int)(Math.random()*6);
    y=(int)(Math.random()*6);
    roll = (x + y);
    int sum = roll;
    if (roll== point)
    numWins = numWins+1;
    else numLosses=numLosses+1;
    // Output probability of winning
    System.out.println("In the simulation, we won " + numWins +
    " times and lost " + numLosses + " times, ");
    System.out.println("for a probability of " +
    (double)(numWins)/(double)(numWins + numLosses));
    }}

  • Please help in my first jdbc code

    hi,
    in this code i want to get author book name from my database
    but the problem that : the compiler give error on these lines :
    statement= connection.createStatement();
    ResultSet resultset = statement.executeQuery("");
    statement.close();
    please see my code and help me
    import java.awt.Container;
    import java.beans.Statement;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.ResultSetMetaData;
    import java.sql.SQLException;
    import javax.swing.JFrame;
    import javax.swing.JOptionPane;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    public class DisplayAuthors extends JFrame {
        static final String JDBC_DRIVER = "";
        static final String DATABASE_URL="JDBC:db2j:library";
        private Connection connection;
        private Statement statement;
        public DisplayAuthors(){
            try{
                System.setProperty("db2j.system.home", "C:/Documents and Settings/beshoy/My Documents/NetBeansProjects/JDBC");
                Class.forName(JDBC_DRIVER);
                connection=DriverManager.getConnection(DATABASE_URL);
                statement=  (Statement) connection.createStatement();
                ResultSet resultset/*=statement.executeQuery("")*/;
                StringBuffer results= new StringBuffer();
                ResultSetMetaData metadata=resultset.getMetaData();
                int numberofcol=metadata.getColumnCount();
                for(int i=0;i<numberofcol;++i){
                    results.append(metadata.getCatalogName(i)+"\t");
                results.append("\n");
                while(resultset.next()){
                    for(int i=1;i<=numberofcol;++i){
                        results.append(resultset.getObject(i)+"\t");
                    results.append("\n");
                JTextArea area=new JTextArea(results.toString());
                Container container=getContentPane();
                container.add(new JScrollPane(area));
                setSize(300,100);
                setVisible(true);
            catch(ClassNotFoundException classnotfound){
                JOptionPane.showMessageDialog(null,classnotfound.getMessage(),"Database error",JOptionPane.ERROR_MESSAGE);
                System.exit(1);
            catch(ClassNotFoundException classnotfound){
                JOptionPane.showMessageDialog(null,classnotfound.getMessage(),"Driver not found", JOptionPane.ERROR_MESSAGE);
                System.exit(1);
            finally{
                try{
                    statement.close();
                    connection.close();
                catch(SQLException sqlexception){
                    JOptionPane.showMessageDialog(null, sqlexception.getMessage(),"Database error",JOptionPane.ERROR_MESSAGE);
                    System.exit(1);
        public static void main(String[]args){
            DisplayAuthors window=new DisplayAuthors();
            window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }thanks in advance

    beshoy wrote:
    Compiling 1 source file to C:\Documents and Settings\beshoy\My Documents\NetBeansProjects\JDBC\build\classes
    C:\Documents and Settings\beshoy\My Documents\NetBeansProjects\JDBC\src\project\DisplayAuthors.java:30: incompatible types
    found : java.sql.Statement
    required: java.beans.Statement
    statement= connection.createStatement();You declared 'statement' as java.beans.Statement instead of java.sql.Statement. The Connection#createStatement() returns java.sql.Statement, not java.beans.Statement.
    How did you miss this one in the JDBC tutorial? [http://java.sun.com/docs/books/tutorial/jdbc/index.html]
    C:\Documents and Settings\beshoy\My Documents\NetBeansProjects\JDBC\src\project\DisplayAuthors.java:31: cannot find symbol
    symbol : method executeQuery(java.lang.String)
    location: class java.beans.Statement
    ResultSet resultset = statement.executeQuery("");This one will solve itself if you fix the first error.
    C:\Documents and Settings\beshoy\My Documents\NetBeansProjects\JDBC\src\project\DisplayAuthors.java:68: cannot find symbol
    symbol : method close()
    location: class java.beans.Statement
    statement.close();This one will solve itself if you fix the first error.

Maybe you are looking for