Trying to end an application using a while statement

I'm writing a program for a java class where you enter an employee name or stop to end app. but i can't find the right syntax to end the app. here is that section of code:
// loop until sentinel value read from user
          while ( employeeName != Stop )
               ends application;
} // end while
Please some one help!!!!!

let me give the entire code it might be of help
// Payroll.java
// Create and manipulate a payroll program
import java.util.Scanner;
import java.text.DecimalFormat;
public class Payroll
// Main method begins execution of Java Application
public static void main( String args[] )
// create Scanner to obtain input from command window
Scanner input = new Scanner( System.in );
String employeeName; // employee name read by user
double hourlyPay; // hourly pay read by user
double hoursWorked; // hours worked read by user
double totalPay; //
String Stop; // ends program
System.out.print( "Enter Employee Name or Stop to quit:" ); // prompt
employeeName = input.nextLine(); // obtain user input
System.out.print( "Enter Hourly Pay:" ); // prompt
while ( hourlyPay < 0 )
System.out.print( "Enter Positive Number" );
          } // end while
     hourlyPay = input.nextDouble(); // obtain user input
System.out.print( "Enter Hours Worked:" ); // prompt
while (hoursWorked < 0 )
System.out.print( "Enter Positive Number" );
          } // end while
          hoursWorked = input.nextDouble(); // obtain user input
totalPay = hourlyPay*hoursWorked; //multiply variables
// loop until sentinel value read from user
          while ( employeeName != Stop )
               ends application;
} // end while
// create decimalFormat
DecimalFormat money = new DecimalFormat( "$0.00" );
// display total
System.out.print( "Total Pay For Employee Is: " );
System.out.println(money.format ( totalPay ) );
} // end main
} // end class Payroll

Similar Messages

  • How Do You "Unload" Using a "While" statement?

    How do you "Unload" or "Exit" using a "While" statement?
    Sample: The console displays "Press Enter to continue".
    Description: It a User press the Enter key, then the application would start over. On the other hand, if a User presses the "0" key, the application ends, exits. What code would be used?
    THANKS ... signed ... VERY NEW at JAVA ...

      input=readInput();
      while (input!=yourExitKey)
        // do stuff here
        input=readInput();
      // End of code

  • Error while trying to deploy the application using Enterprise manager website

    Hi,
    I am trying to deploy a huge ear file using enterprise manager website of Oracle 9iAs Rel 2.
    The deployment fails with the following error.
    Deployment failed: Nested exception Root Cause: null; nested exception is: java.lang.OutOfMemoryError. null; nested exception is: java.lang.OutOfMemoryError
    We are able to deploy the same ear file using stand-alone container.
    We are planning for deployment in few days to go it live.
    Pls suggest what could be the problem.
    Hardware Used:-
    DellServer Intel P3 dual processor 1.2GHz
    1GB RAM
    2GB virtual memory,
    40GB free hard-drive.
    Apart from 9ias enterprise edition, this system has Oracle database also on it. But the database is not being used at all by anyone.
    No other software is installed on the system
    Software:-
    Windows 2000 Server sp2
    Oracle 9ias Release 2 Enterprise Edition (Installed J2EE and Webcache)
    Oracle 8i Database 8.1.6.0.0
    Size of application:-
    130 EJBs (107 CMP + remaining Session Beans)
    1700 JSPs
    3 servlets
    Packaged properly into jar,war,ear structure.
    the size of ear file is about 13MB.
    Thanks
    Srinath

    Hi,
    I tried using dcmctl but still got the following error.
    Oracle 8i database is running but noone is using it except that this application uses it.
    Pls help
    D:\oraJ2EE\dcm\bin>dcmctl deployapplication -f d:\oraJ2ee\j2ee\elink\applications\advecto.ear -
    a myapp
    ADMN-300075
    D:\oraJ2EE\dcm\bin>dcmctl getError -v -d
    ADMN-300075
    Nested exception
    Base Exception:
    java.rmi.RemoteException:null; nested exception is:
    java.lang.OutOfMemoryError
    Nested exception
    Root Cause: null; nested exception is:
    java.lang.OutOfMemoryError
    java.rmi.RemoteException: null; nested exception is:
    java.lang.OutOfMemoryError
    java.lang.OutOfMemoryError
    <<no stack trace available>>
    Thanks
    Srinath

  • Error ,while trying to deploy an application using DB adapter

    Hi ,
    I am getting the below error while deploying the SOA application using DB adapter
    [11:46:00 AM] Sending archive - sca_DataBAdapter_rev2.jar
    [11:46:12 AM] Received HTTP response from the server, response code=500
    [11:46:12 AM] Error deploying archive sca_DataBAdapter_rev2.jar to partition "default" on server soa_server1 [http://computer:8001]
    [11:46:12 AM] HTTP error code returned [500]
    [11:46:12 AM] Error message from server:
    *There was an error deploying the composite on soa_server1: [JCABinding] [DataBAdapter.DBAdapter/2]Unable to complete unload due to: Cannot locate Java class oracle.tip.adapter.db.DBWriteInteractionSpec: Cannot locate Java class oracle.tip.adapter.db.DBWriteInteractionSpec.*
    [11:46:12 AM] Check server log for more details.
    [11:46:12 AM] Error deploying archive sca_DataBAdapter_rev2.jar to partition "default" on server soa_server1 [http://computer:8001]
    [11:46:12 AM] #### Deployment incomplete. ####
    [11:46:12 AM] Error deploying archive file:/C:/JDeveloper/mywork/DataBAdapter/DataBAdapter/deploy/sca_DataBAdapter_rev2.jar
    (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)
    Pls let me know if anyone has already faced the same!!!!!!!
    Edited by: 934914 on Jun 19, 2012 5:45 AM

    Hi Vijay,
    Data Base is up ,what am doing ..I have deployed the my DataBAadapter SOA app it was not working so I undeployed the DataBAadapter app ..now I am deploying it again and getting the below error.
    [12:52:33 AM] Sending internal deployment descriptor
    [12:52:33 AM] Sending archive - sca_DataBAdapter_rev2.jar
    [12:52:34 AM] Received HTTP response from the server, response code=500
    [12:52:34 AM] Error deploying archive sca_DataBAdapter_rev2.jar to partition "default" on server soa_server1 [http://192.168.0.105:8001]
    *[12:52:34 AM] HTTP error code returned [500]*
    *[12:52:34 AM] Error message from server:*
    *There was an error deploying the composite on soa_server1: [JCABinding] [DataBAdapter.DBAdapter/2]Unable to complete unload due to: Cannot locate Java class oracle.tip.adapter.db.DBWriteInteractionSpec: Cannot locate Java class oracle.tip.adapter.db.DBWriteInteractionSpec.*
    [12:52:34 AM] Check server log for more details.
    [12:52:34 AM] Error deploying archive sca_DataBAdapter_rev2.jar to partition "default" on server soa_server1 [http://192.168.0.105:8001]
    [12:52:34 AM] #### Deployment incomplete. ####
    [12:52:34 AM] Error deploying archive file:/C:/JDeveloper/mywork/DataBAdapter/DataBAdapter/deploy/sca_DataBAdapter_rev2.jar
    (oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)

  • Trying to open an application using the script below

    tell application "Finder" 
    open file "mactest.app" of folder of (file (path to me))
    end tell
    I would like to open the mactest.app in the foreground.
    But when the script executes finder comes on top of the application.
    Is there some thing that i'm doing wrong?
    Any other ways of doing this without Finder?
    Please help

    This seems to do what you want for a standard application
    tell application "Finder"
              open file (path to application "Calculator")
    end tell
    So what is 'mactest.app'  and what happens if you open it in the normal way?

  • Trying to get newest record using a select statement

    Hello everyone.. I'm a bit new at this but I've been teaching myself by trial and error so bear with me.
    Using a 'DEDUCTION' table for this example, I am trying to get it to resolve the record that is most current. Since each employee record could have changes, the table could have multiple entries/deductions of which only one is the most current.
    Ok, so medical deductions are like DEDUCTIONS 700-715 while dental deductions are 730-737. Initially, I was trying to figure out how to pull the deductions based on an employee and have it compare which is newer and report the newest one for each medical and then the dental deduction. If there is not a type of deduction for someone, it should report zero like a NVL I think. See example:
    EMP_ID DEDUCTIONS EFF_DATE AMT
    1 710 2000/12/01 85.39
    1 735 2000/12/01 8.31
    9 701 2001/08/29 12
    9 707 2000/12/01 12
    9 730 2000/12/01 .23
    10 700 2001/02/25 .46
    10 730 2001/02/25 .23
    The record that stands out in this example is employee #9 with two medical deduction, one that supersedes the other - 701 and 707. Because 701 is newer it should ignore the 707 deduction.
    Any ideas? Thank you!
    ken

    Here are a couple of methods. The second one should run faster, but requires Oracle 8i.
    SQL> SELECT   emp_id, deductions, eff_date, amt,
      2           'MEDICAL' AS type
      3  FROM     deduction
      4  WHERE    (emp_id, eff_date) IN
      5           (SELECT   emp_id, MAX (eff_date)
      6            FROM     deduction
      7            WHERE    deductions BETWEEN 700 AND 715
      8            GROUP BY emp_id)
      9  AND      deductions BETWEEN 700 AND 715
    10  UNION
    11  SELECT   emp_id, deductions, eff_date, amt,
    12           'DENTAL' AS type
    13  FROM     deduction
    14  WHERE    (emp_id, eff_date) IN
    15           (SELECT   emp_id, MAX (eff_date)
    16            FROM     deduction
    17            WHERE    deductions BETWEEN 730 AND 737
    18            GROUP BY emp_id)
    19  AND      deductions BETWEEN 730 AND 737
    20  ORDER BY emp_id, deductions
    21  /
        EMP_ID DEDUCTIONS EFF_DATE          AMT TYPE
             1        710 2000/12/01      85.39 MEDICAL
             1        735 2000/12/01       8.31 DENTAL
             9        701 2001/08/29         12 MEDICAL
             9        730 2000/12/01        .23 DENTAL
            10        700 2001/02/25        .46 MEDICAL
            10        730 2001/02/25        .23 DENTAL
    6 rows selected.
    SQL> SELECT   emp_id, deductions, eff_date, amt,
      2           'MEDICAL' AS type
      3  FROM     (SELECT   emp_id, deductions, eff_date, amt,
      4                     RANK () OVER
      5                          (PARTITION BY emp_id
      6                           ORDER BY     eff_date DESC) AS rk
      7            FROM     deduction
      8            WHERE    deductions BETWEEN 700 AND 715)
      9  WHERE    rk = 1
    10  UNION
    11  SELECT   emp_id, deductions, eff_date, amt,
    12           'DENTAL' AS type
    13  FROM     (SELECT   emp_id, deductions, eff_date, amt,
    14                     RANK () OVER
    15                          (PARTITION BY emp_id
    16                           ORDER BY     eff_date DESC) AS rk
    17            FROM     deduction
    18            WHERE    deductions BETWEEN 730 AND 737)
    19  WHERE    rk = 1
    20  ORDER BY emp_id, deductions
    21  /
        EMP_ID DEDUCTIONS EFF_DATE          AMT TYPE
             1        710 2000/12/01      85.39 MEDICAL
             1        735 2000/12/01       8.31 DENTAL
             9        701 2001/08/29         12 MEDICAL
             9        730 2000/12/01        .23 DENTAL
            10        700 2001/02/25        .46 MEDICAL
            10        730 2001/02/25        .23 DENTAL
    6 rows selected.

  • Cash Application using FF_5 Bank Statement

    Hello,
    We are currently processing European customer invoice payments using the FF_5 Bank Statement transaction. The bank files are in BAI2 format. We have been successful in getting invoices to automatically clear when the bank file contains correct invoice number(s) and payment amount, but without an invoice number/payment match the payments remain unprocessed and must be processed manually. Some, but not all, of the payments are received with IBAN numbers but we do not currently have the IBAN functionality implemented on our customer masters (although we do for vendor masters).
    In contrast, using the lockbox functionality in the US we are able to have payments posted to the customer's account when the customer's banking information is present or partially applied in cases when there is a partial match between invoice number(s) and payment amount.
    Similar to the success we have in the US using the lockbox functionality, we would like to have our European payments post to the customer accounts or be partially applied (where appropriate) in cases where there is not an exact match for invoice number(s) and payment amount between the bank file and the customer account. Is there a way to make this happen?
    We are on ECC 6.0.  I have searched for OSS notes on this topic, have searched related questions in this Forum and have searched the internet for guidance on this but have found nothing useful.  Does anyone have any insight into this?

    Hi,
    AL11 - You can create the folders. These are the folders in application server. Nothing but they are create in one of your network drive but linked to AL11 by your basis consultant.
    You should not upload the bank statement from your local drive due to security concerns. There are chances that the file values can be manipulated. The file you are uploading from presentation server.
    Regards,
    Ravi

  • After trying to update iBook application stays in waiting state

    After Update iBook app, stays in waiting state . Will not open or able to delete.

    Try this first ...tap the "waiting" icon and see if you can pause it. If it does pause, then tap it again and see if it will resume. If that works, repeat the same steps for each "waiting" icon.
    If that didn't work, try this ....Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.

  • Java Application using Swig Running Visual C++ 6.0

    i,
    I am using Swig with Java ,I'm trying launch a Java application using a Windows executable,
    I'm using VC++6.0, and followed the instruction in Swig Documentation chaper 20,Section 20.2.8.
    I Build my dll in Vc++ i get this error Anyone know this,please help me.
         SWIG
         Compiling resources...
         Compiling...
         StdAfx.cpp
         Compiling...
         example.c
         Generating Code...
         Compiling...
         example_wrap.cpp
    c:\program files\java\jdk1.5.0_01\include\jni.h(46) : error C2146: syntax error : missing ';' before identifier 'jsize'
    c:\program files\java\jdk1.5.0_01\include\jni.h(46) : fatal error C1004: unexpected end of file found
    Generating Code...
    Error executing cl.exe.
    example.dll - 2 error(s), 0 warning(s)
    Regards
    Devi

    check on line 46, there might be a missing ";"
    c:\program files\java\jdk1.5.0_01\include\jni.h(46) : error C2146: syntax error : missing ';' before identifier 'jsize'

  • Error -2147352573 executing application using LV2012 and RGT 1.1.3

    Hi,
    I am currently trying to deploy an application using the LabVIEW Report Generation Toolkit (Version: 1.1.3) and I am facing a compatibility problem with Excel 2007 & 2010. I am aware that some internal ActiveX components have slightly changed between the two versions of Excel but I have a specific error on a particular VI. Here is the error message :
    "Error -2147352573 occurred at Membre introuvable dans NI_Excel.lvclass : Excel Set Cell Color and Border.vi."
    I have tried everything to solve this problem using all the posts in the Web that I could find but I still don’t have the answer.
    My developer computer configuration : LV2012, RGT 1.1.3, Office 2010.
    The target computer configuration : LV2012, RGT 1.1.3, Office 2007.
    I have development licences on both computers so I built my application on both system. The build made on the target computer (office 2007) works fine on my computer (office 2010 : retrocompatibility ok). The build made on my computer does not work on the target computer as I explained in the beginning of my question.
    By the way, I did not manage to find the user manual of the LabVIEW RGT 1.1.3 on the NI website.
    Thanks !

    When I try Deploying A WebCenter PS3 Portal Application using JDev 11.1.1.1.4 Integarted WebLogic Server I get the following error :
    [02:21:12 PM] Deploying Application...
    <29/03/2011 2:21:12 PM EST> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1301368872572' for task '1'. Error is: 'weblogic.management.DeploymentException: [J2EE:160149]Error while processing library references. Unresolved application library references, defined in weblogic-application.xml: [Extension-Name: oracle.webcenter.framework, Specification-Version: 11.1.1, exact-match: false], [Extension-Name: oracle.webcenter.skin, Specification-Version: 11.1.1, exact-match: false], [Extension-Name: oracle.sdp.client, exact-match: false].'
    weblogic.management.DeploymentException: [J2EE:160149]Error while processing library references. Unresolved application library references, defined in weblogic-application.xml: [Extension-Name: oracle.webcenter.framework, Specification-Version: 11.1.1, exact-match: false], [Extension-Name: oracle.webcenter.skin, Specification-Version: 11.1.1, exact-match: false], [Extension-Name: oracle.sdp.client, exact-match: false].
         at weblogic.application.internal.flow.CheckLibraryReferenceFlow.prepare(CheckLibraryReferenceFlow.java:26)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:613)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:184)
         at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:58)
         Truncated. see log file for complete stacktrace
    I need some help to triage the issue and resolve the cause. any help in this context appreciated .
    Redg

  • Problem in building the enterprise application using Ant -Wrkshop

    Hi All,
    I have developed the enterprise application using workshop and tries to build the application using Ant script and getting the following error.
    "An error occurred writing the controls client manifest."
    Regards
    Ashok

    Did you:
    a). Ensure you're using the correct version of WLS (it appears to me you're using a standalone WLS)? - correct version is 10.3.3
    b). Install the application development runtime 11.1.1.3?
    c). Extend the domain with the JRF?
    John

  • Not able to create web application using central admin UI

    We are trying to create web application using central admin UI. but its throwing error.
    Then we tried to create it using powershell but it getting too much time(around 3 hrs) to provision web app on wfe.
    We have around 60 application and farm is virtual.
    Please help us on this.
    Thanks in advance.

    I ran a WSSv3 farm with >60 Web Applications, on a 32bit system no less (careful design of IIS Application Pools was required back then). This isn't impossible to do, but you do need to provide the error in the ULS log and the specifications of your
    virtual environment.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • While statements

    Hi All. I am a student in java programming, beginning class. I am having problems with understanding how to make a loop body work properly using a while statement. I have a problem I am working on, and I can't seem to get it to run properly, and I believe its mainly because I don't understand what I am doing. I have been searching the net for examples of while statements, but all I find are mostly the same ones, and they don't help. Here is the code I have so far, which compiles fine, but does not return the value I want, and also it seems to run infinately. Any ideas or help with this concept would be greatly appreciated.
    public class StereoPayments
    public static final double INTEREST_MONTHLY = 0.015;
    public static final int PAYMENT_MONTHLY = 50;
    public static void main(String[] args)
    //Need variables for monthly interest amount, for amount left over from $50 payment minus inerest(which gets
    //subtracted from the principle.
    double startMoney = 1000;
    double monthsInterest = 0;
    double moneyAfterInterestPayment = 0;
    double numberOne = 0;
    double numberTwo = 0;
    System.out.println("Here is your payments");
    while (startMoney >= 0)
    moneyAfterInterestPayment = (startMoney*INTEREST_MONTHLY);
    numberOne = (moneyAfterInterestPayment + startMoney);
    numberTwo = (numberOne - PAYMENT_MONTHLY);
    monthsInterest++;
    System.out.println("Months of payments " + monthsInterest);
    System.out.printf("Amount of interest paid " + numberOne);
    I am trying to print out how long it took to pay off the stereo, at $50 a month, while adding the interest to it each month, then output the amount of months it took to pay it off, and the total amount of interest paid. I am obviously not doing this right though. Can anyone help me? Thanks in advance! Newbie101.

    public class StereoPayments
    public static final double INTEREST_MONTHLY = 0.015;
    public static final int PAYMENT_MONTHLY = 50;
    public static void main(String[] args)
    //Need variables for monthly interest amount, for amount left over from $50 payment minus inerest(which gets
    //subtracted from the principle.
    double startMoney = 1000;
    double monthsInterest = 0;
    double moneyAfterInterestPayment = 0;
    double numberOne = 0;
    double numberTwo = 0;
    double currentAmount = 0;
    System.out.println("Here is your payments");
    while (startMoney >= 0)
    moneyAfterInterestPayment = (startMoney*INTEREST_MONTHLY);
    numberOne = (moneyAfterInterestPayment + startMoney);
    startMoney = (numberOne - PAYMENT_MONTHLY);
    monthsInterest++;
    System.out.println("Months of payments " + monthsInterest);
    System.out.printf("Amount of interest paid " + moneyAfterInterestPayment);
    Here is a revised code. It does end now, thanks to you folks' help! However, I am failing to add up the interest amount. What is does is show how much interest is being paid monthly, but not adding it up to a grand total. So, would I make a statement of "moneyAfterInterestPayment++; ? Newbie101.

  • How do I use the CASE statement  in the where clause?

    Hello Everyone,
    I have 2 queries that do what I need to do but I am trying to learn how to use the CASE statement.
    I have tried to combine these 2 into one query using a case statement but don't get the results I need.
    Could use some help on how to use the case syntax to get the results needed.
    thanks a lot
    select segment_name,
    product_type,
    count (distinct account_id)
    FROM NL_ACCT
    where
    ind = 'N'
    and
    EM_ind = 'N'
    and product_type in ('TAX','PAY')
    and acct_open_dt between (cast('2006-01-17' as date)) and (cast('2006-01-17' as date) + 60)
    GROUP BY 1,2
    order by product_type
    select segment_name,
    product_type,
    count (distinct account_id)
    FROM NL_ACCT
    where
    ind = 'N'
    and
    EM_ind = 'N'
    and product_type not in ('TAX','PAY')
    and acct_open_dt between (cast('2006-01-17' as date)) and (cast('2006-01-17' as date) + 30)
    group by 1,2
    order by product_type

    Something like:
    SELECT segment_name, product_type,
           SUM(CASE WHEN account_id IN ('TAX','PAY') and
                         acct_open_dt BETWEEN TO_DATE('2006-01-17', 'yyyy-mm-dd') and
                               TO_DATE('2006-01-17', 'yyyy-mm-dd') + 60 THEN 1
                    ELSE 0 END) tax_pay,
           SUM(CASE WHEN account_id NOT IN ('TAX','PAY') and
                         acct_open_dt BETWEEN TO_DATE('2006-01-17', 'yyyy-mm-dd') and
                               TO_DATE('2006-01-17', 'yyyy-mm-dd') + 30 THEN 1
                    ELSE 0 END) not_tax_pay
    FROM NL_ACCT
    WHERE ind = 'N' and
          em_ind = 'N' and
          acct_open_dt BETWEEN TO_DATE('2006-01-17', 'yyyy-mm-dd') and
                               TO_DATE('2006-01-17', 'yyyy-mm-dd') + 60
    GROUP BY segment_name, product_type
    ORDER BY product_typeNote: You cannor GROUP BY 1,2, you need to explicitly name the columns to group by.
    HTH
    John

  • Andydata.getObject in piecewise mode using execute immediate statement err

    andydata.getObject in piecewise mode using execute immediate statement
    will get ora-00600 arguments:[kopuigpfx1], [14] in Oracle 11.1.0.6 and Oralce 10.2.0.2.
    andydata.getObject in piecewise mode using execute immediate statement err
    andydata.getObject in piecewise mode using execute immediate statement will get ora-00600 arguments:[kopuigpfx1], [14] in Oracle 11.1.0.6 and Oralce 10.2.0.x
    The following are test scripts in HR schema.
    create type ob_test is object(c1 varchar2(10));
    script 1: not using execute immediate statement and works fine.
    DECLARE
    p_anytype anytype;
    p_anydata anydata;
    p_value_1 VARCHAR2(4000);
    p_value_2 ob_test;
    p_result PLS_INTEGER;
    BEGIN
    anytype.begincreate(dbms_types.typecode_object, p_anytype);
    p_anytype.addattr('A1',
    dbms_types.typecode_varchar2,
    NULL,
    NULL,
    4000,
    NULL,
    NULL,
    NULL);
    p_anytype.addattr('A2',
    dbms_types.typecode_object,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    anytype.getpersistent('HR', 'OB_TEST'));
    p_anytype.endcreate();
    anydata.begincreate(p_anytype, p_anydata);
    p_anydata.setvarchar2('abc');
    p_anydata.setobject(OB_TEST('abc'));
    p_anydata.endcreate;
    DECLARE
    p_anydata2 anydata := p_anydata;
    p_value_1 VARCHAR2(4000);
    p_value_2 OB_TEST;
    p_result PLS_INTEGER;
    BEGIN
    p_anydata2.piecewise;
    p_result := p_anydata2.getvarchar2(p_value_1);
    p_result := p_anydata2.getobject(p_value_2);
    END;
    END;
    script 2: using execute immediate statement will get ora-600
    DECLARE
    p_anytype anytype;
    p_anydata anydata;
    p_value_1 VARCHAR2(4000);
    p_value_2 ob_test;
    p_result PLS_INTEGER;
    BEGIN
    anytype.begincreate(dbms_types.typecode_object, p_anytype);
    p_anytype.addattr('A1',
    dbms_types.typecode_varchar2,
    NULL,
    NULL,
    4000,
    NULL,
    NULL,
    NULL);
    p_anytype.addattr('A2',
    dbms_types.typecode_object,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    anytype.getpersistent('HR', 'OB_TEST'));
    p_anytype.endcreate();
    anydata.begincreate(p_anytype, p_anydata);
    p_anydata.setvarchar2('abc');
    p_anydata.setobject(OB_TEST('abc'));
    p_anydata.endcreate;
    EXECUTE IMMEDIATE 'DECLARE' || chr(10) ||
    ' p_anydata2 anydata := :1;' || chr(10) ||
    ' p_value_1 VARCHAR2(4000);' || chr(10) ||
    ' p_value_2 OB_TEST;' || chr(10) ||
    ' p_result PLS_INTEGER;' || chr(10) || 'BEGIN' ||
    chr(10) || ' p_anydata2.piecewise;' || chr(10) ||
    ' p_result := p_anydata2.getvarchar2(p_value_1);' ||
    chr(10) ||
    ' p_result := p_anydata2.getobject(p_value_2);' ||
    chr(10) || 'END;'
    USING p_anydata;
    END;
    script 3: comment statment "p_result := p_anydata2.getobject(p_value_2);", it works ok.
    DECLARE
    p_anytype anytype;
    p_anydata anydata;
    p_value_1 VARCHAR2(4000);
    p_value_2 ob_test;
    p_result PLS_INTEGER;
    BEGIN
    anytype.begincreate(dbms_types.typecode_object, p_anytype);
    p_anytype.addattr('A1',
    dbms_types.typecode_varchar2,
    NULL,
    NULL,
    4000,
    NULL,
    NULL,
    NULL);
    p_anytype.addattr('A2',
    dbms_types.typecode_object,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    anytype.getpersistent('HR', 'OB_TEST'));
    p_anytype.endcreate();
    anydata.begincreate(p_anytype, p_anydata);
    p_anydata.setvarchar2('abc');
    p_anydata.setobject(OB_TEST('abc'));
    p_anydata.endcreate;
    EXECUTE IMMEDIATE 'DECLARE' || chr(10) ||
    ' p_anydata2 anydata := :1;' || chr(10) ||
    ' p_value_1 VARCHAR2(4000);' || chr(10) ||
    ' p_value_2 OB_TEST;' || chr(10) ||
    ' p_result PLS_INTEGER;' || chr(10) || 'BEGIN' ||
    chr(10) || ' p_anydata2.piecewise;' || chr(10) ||
    ' p_result := p_anydata2.getvarchar2(p_value_1);' ||
    chr(10) ||
    ' /*p_result := p_anydata2.getobject(p_value_2);*/' ||
    chr(10) || 'END;'
    USING p_anydata;
    END;
    Could someone tell me how to solve this problem.
    Thanks a lot.
    Daniel

    andydata.getObject in piecewise mode using execute immediate statement
    will get ora-00600 arguments:[kopuigpfx1], [14] in Oracle 11.1.0.6 and Oralce 10.2.0.2.
    andydata.getObject in piecewise mode using execute immediate statement err
    andydata.getObject in piecewise mode using execute immediate statement will get ora-00600 arguments:[kopuigpfx1], [14] in Oracle 11.1.0.6 and Oralce 10.2.0.x
    The following are test scripts in HR schema.
    create type ob_test is object(c1 varchar2(10));
    script 1: not using execute immediate statement and works fine.
    DECLARE
    p_anytype anytype;
    p_anydata anydata;
    p_value_1 VARCHAR2(4000);
    p_value_2 ob_test;
    p_result PLS_INTEGER;
    BEGIN
    anytype.begincreate(dbms_types.typecode_object, p_anytype);
    p_anytype.addattr('A1',
    dbms_types.typecode_varchar2,
    NULL,
    NULL,
    4000,
    NULL,
    NULL,
    NULL);
    p_anytype.addattr('A2',
    dbms_types.typecode_object,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    anytype.getpersistent('HR', 'OB_TEST'));
    p_anytype.endcreate();
    anydata.begincreate(p_anytype, p_anydata);
    p_anydata.setvarchar2('abc');
    p_anydata.setobject(OB_TEST('abc'));
    p_anydata.endcreate;
    DECLARE
    p_anydata2 anydata := p_anydata;
    p_value_1 VARCHAR2(4000);
    p_value_2 OB_TEST;
    p_result PLS_INTEGER;
    BEGIN
    p_anydata2.piecewise;
    p_result := p_anydata2.getvarchar2(p_value_1);
    p_result := p_anydata2.getobject(p_value_2);
    END;
    END;
    script 2: using execute immediate statement will get ora-600
    DECLARE
    p_anytype anytype;
    p_anydata anydata;
    p_value_1 VARCHAR2(4000);
    p_value_2 ob_test;
    p_result PLS_INTEGER;
    BEGIN
    anytype.begincreate(dbms_types.typecode_object, p_anytype);
    p_anytype.addattr('A1',
    dbms_types.typecode_varchar2,
    NULL,
    NULL,
    4000,
    NULL,
    NULL,
    NULL);
    p_anytype.addattr('A2',
    dbms_types.typecode_object,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    anytype.getpersistent('HR', 'OB_TEST'));
    p_anytype.endcreate();
    anydata.begincreate(p_anytype, p_anydata);
    p_anydata.setvarchar2('abc');
    p_anydata.setobject(OB_TEST('abc'));
    p_anydata.endcreate;
    EXECUTE IMMEDIATE 'DECLARE' || chr(10) ||
    ' p_anydata2 anydata := :1;' || chr(10) ||
    ' p_value_1 VARCHAR2(4000);' || chr(10) ||
    ' p_value_2 OB_TEST;' || chr(10) ||
    ' p_result PLS_INTEGER;' || chr(10) || 'BEGIN' ||
    chr(10) || ' p_anydata2.piecewise;' || chr(10) ||
    ' p_result := p_anydata2.getvarchar2(p_value_1);' ||
    chr(10) ||
    ' p_result := p_anydata2.getobject(p_value_2);' ||
    chr(10) || 'END;'
    USING p_anydata;
    END;
    script 3: comment statment "p_result := p_anydata2.getobject(p_value_2);", it works ok.
    DECLARE
    p_anytype anytype;
    p_anydata anydata;
    p_value_1 VARCHAR2(4000);
    p_value_2 ob_test;
    p_result PLS_INTEGER;
    BEGIN
    anytype.begincreate(dbms_types.typecode_object, p_anytype);
    p_anytype.addattr('A1',
    dbms_types.typecode_varchar2,
    NULL,
    NULL,
    4000,
    NULL,
    NULL,
    NULL);
    p_anytype.addattr('A2',
    dbms_types.typecode_object,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    anytype.getpersistent('HR', 'OB_TEST'));
    p_anytype.endcreate();
    anydata.begincreate(p_anytype, p_anydata);
    p_anydata.setvarchar2('abc');
    p_anydata.setobject(OB_TEST('abc'));
    p_anydata.endcreate;
    EXECUTE IMMEDIATE 'DECLARE' || chr(10) ||
    ' p_anydata2 anydata := :1;' || chr(10) ||
    ' p_value_1 VARCHAR2(4000);' || chr(10) ||
    ' p_value_2 OB_TEST;' || chr(10) ||
    ' p_result PLS_INTEGER;' || chr(10) || 'BEGIN' ||
    chr(10) || ' p_anydata2.piecewise;' || chr(10) ||
    ' p_result := p_anydata2.getvarchar2(p_value_1);' ||
    chr(10) ||
    ' /*p_result := p_anydata2.getobject(p_value_2);*/' ||
    chr(10) || 'END;'
    USING p_anydata;
    END;
    Could someone tell me how to solve this problem.
    Thanks a lot.
    Daniel

Maybe you are looking for