Subquery and procedure  - problem

Hello,
I have procedure created with option "WITH RESULT VIEW ProcViewTest1".
When I try to execute statement below everything is ok.
select * from ProcViewTest1 WITH PARAMETERS ('placeholder' = ('$$str1$$', 'Michal'))
But when I try to execute:
select *, (select * from ProcViewTest1 WITH PARAMETERS ('placeholder' = ('$$str1$$', 'Michal'))) as col1 from dummy
I have error: "sql syntax error: incorrect syntax near "WITH"
I checked that in the case of procedures without parameters can be used as a subquery.
Why I have this message?
What shoul I do?
Maybe the error is in syntax?
Best regards,

Hello,
I have procedure created with option "WITH RESULT VIEW ProcViewTest1".
When I try to execute statement below everything is ok.
select * from ProcViewTest1 WITH PARAMETERS ('placeholder' = ('$$str1$$', 'Michal'))
But when I try to execute:
select *, (select * from ProcViewTest1 WITH PARAMETERS ('placeholder' = ('$$str1$$', 'Michal'))) as col1 from dummy
I have error: "sql syntax error: incorrect syntax near "WITH"
I checked that in the case of procedures without parameters can be used as a subquery.
Why I have this message?
What shoul I do?
Maybe the error is in syntax?
Best regards,

Similar Messages

  • Problem creating a table with a subquery and a dblink

    Hello!!
    I have a little problem. When I create a table with a subquery and a dblink, for example:
    CREATE TABLE EXAMPLE2 AS SELECT * FROM EXAMPLE1@DBLINK
    the table definition is changed. Fields with a type of CHAR or VARCHAR2 are created with a size three times bigger than the original table in the remote database. Field of type DATE and NUMBER are not changed. For example if the original table, in the database 1, has a field of type CHAR(1) it is create in the local database with a type of CHAR(3), and a VARCHAR2(5) field is created with VARCHAR2(15).
    Database 1 has a WE8DEC character set.
    Database 2 has a AL32UTF8 character set.
    Could it be related to the difference in character sets?
    What can I do to make Oracle use the same table definition when creating a table in this way?
    Thanks!!

    That is related to character sets, and probably necessary if you want all the data in the remote table to be able to fit in the new table.
    When you declare a column VARCHAR2(5), by default, you're allocating 5 bytes of storage. In a single-byte character set, which I believe WE8DEC is, that also happens to equate to 5 characters. In a multi-byte character set like AL32UTF8, though, 1 character may require up to 3 bytes of storage, so you'd need to allocate 15 bytes to store that data. That's what's going on here.
    You could still store all the data if you create the table locally by explicitly requesting 5 characters of storage by declaring the column VARCHAR2(5 CHAR). You could also set the NLS_LENGTH_SEMANTICS parameter to CHAR rather than BYTE before creating the table, but I believe that both of these will only apply when you're explicitly defining columns as part of your CREATE TABLE. I don't believe either will apply to CTAS statements.
    Justin

  • Function and triggers and procedures

    sorry to asking this question,
    In oracle. we use the function and triggers and procedure.
    for eg:
    if we wrote an trigger for a table. it fires at a time manipulating table. (database contains table contains datas and database also contains triggers likewise function,procedure).
    but my questions?: is
    In my database I kept only tables. no triggers,no function,no procedures. and
    i dont want to kept this triggers, function, procedures in database  Instead of i want to kept this triggers, function, procedures in business logic layers(middle tier)
    is it possible? .
    if yes means, how to write or where to write? please help me, or else send the guidance documents or blog releated to it.

    Subu123,
    the +1 related to Would be great if you can take step back and see the implementation from another angle. First see why do you need DB trigger/function etc.Then check whether it is possible to implement the functionality using ADF BC + feasibility study between 2 approaches(I didn't mean to invoke DB objects from business components, instead checking the feasibility of implement the same functionality in your EntityObj/ViewObj/Service calls )Before making a decision for or against holding fuctions, triggers and procedures in the DB, you have to get the whole picture.
    Think about a trigger outside the DB. What could this be and why or for what is it used?
    All the answers are pointing to 'lets keep them in the DB'. Now there are situation where you don't have a DB or are not allows to use it. Still there can be triggers, only they are implemented in a different way.
    The same can be said for procedures and functions.
    So you have to think about the whole problem and how each sub problem you have to solve work together to resolve the whole problem.
    I'm personally tend to keep the business logic the the DB if the business logic is already there (e.g. I have to migrate an old forms app).
    If I design a new app I tend to keep the logic in java. Only sequences (for generating ids) and some other stuff which is purely db related like cleaning up tables I keep in the DB.
    Timo

  • How to use type, packages, functions, and procedures in another schema ?

    I have two target schema in one OWB project, such as A and B. In a mapping of A, I would like to use some types, packages, functions, and procedures from B. I have tried the method of synonym as suggested, but I could not find the metadata of these when importing ... The only type of synonym I can import is the synonym for table. Is there a bug for synonym?
    If I cannot use synonym for this issue, is there another way to solve the problem?

    Now, in some instances you will absolutely need to create the second module as Carsten describes, however it should also be noted that you can reference objects in things like Expressions even if you have not loaded up the metadata. It is only when you need strong binding that it becomes neccessary to import objects. For everything else, as long as the reference will resolve at compile-time then you are good to go.
    For example, I have a function in one target schema (S1) and a private synonym to it in another(s2). A mapping in the S2 schema has an expression object that uses the synonym to the function in the expression property for a couple of the output attirbutes. The synonym has not been loaded into metadata - indeed OWB has no knowledge of its existance. But it resolves at compile time so the mapping validates and generates successfully.
    Mike

  • Java Stored Procedure Problem

    Hi all,
    I was able to deploy the Java class into the database (the message says Success). And then I am able to desc MyJavaSproc name in SQL*Plus and see the Pl/SQL parameter and return types. But when I use either call or select from dual, it tells me the the Java class (MyJavaName) is not there. The Oracle error is this: ORA-29540: class MyJavaName does not exist. I am running 10gR2. I did encounter a problem when I first tried to deploy using J2SE 1.5 as source and target and JDev suggested that I change that to an earlier version. I changed that to 1.4 and then deployed successfully.
    Could someone help me with this? Thanks a lot.
    Ben

    Thanks. I created a simple file Java class with JDev (10g 1.3). I have some static methods (according to Oracle docs) in the class. Then by following JDev's help doc, I created a deployment profile for the project using JDec. I then added the Java methods that I wanted to deploy as sprocs. As I said, after I changed the J2SE from 1.5 (the default) to 1.4, the deployment was successful. I can see it using desc in SQL*Plus. I can also see it in the database connection tab in JDev. I can open the class stub created by JDev, and the sprocs and funcs are listed under Functions and Procedures on the database connection tab.
    Thanks.
    Ben

  • Sql developer doesn't show any packages and procedure.

    Hi All,
    I am perty new here and I am facing a strange problem in SQL DEVELOPER. I have one schema and it has packages and functions created in it, but when I click
    packages or functions in sql developer it says table or views does not exist. however, I can see those packages and procedures from sql plus and oracle enterprise manager. you swift reply would be highly appriciated
    hare krishna
    Alok

    Which version of sqldeveloper?
    Which version of Oracle?
    This sounds like an old bug where sqldeveloper checked for 'select any table', but you actually need 'select any dictionary'

  • Oracle Form functions and procedures in APEX, how?

    I am working to recreate in APEX, already existing Read Only Forms in Oracle Forms. APEX Interactive Report functionality among other things, makes it worth while as well as targetting a different audience than the one that utilizies the Oracle Form versions. Oracle Forms versions use lots of pre and post query triggers, PLSQL Functions.
    In Oracle Forms one of the places those functions can be located is in the "Program Units" section of the Form. A typical function of this sort, based on a specific Mission ID Itinerary, collects scheduled passengers last names, formats them with a comma and space after each one, into a single string that is returned and displayed as the passenger list of one row.
    I have all this code written so I can move most of the main query of the Oracle Form into an Interactive Report. These functions and triggers called from within the Form, from the "Program Units" section of the Oracle Form rather than being stored in the Database schema in a package, where would they go inside APEX? Can I create a "Shortcut" in APEX and call it from the Interactive Report "Region Source"? Can I create the PLSQL function at the page level or region level of the Interactive Report? Or, is my best bet creating a package stored in the database, of all these functions and/or proecedures I may need from the original Oracle Form?
    Some advice would be greatly appriciated.

    RLBickham wrote:
    I don't think I have been clear enough in describing the specific thing I want to do, it simply does not reach the level of forms to APEX conversion. It is basically a PLSQL Function problem.
    I have an Interactive Report that is currently getting 90 percent of what I want however, each row, representing a Mission may have multiple legs. Each Leg has two locations or ICAO codes attached to it. Based on the Mission number, I want to loop through the leg table, collect all the ICAO codes for that Mission, put them all into 1 variable separated by a coma and add that variable to the column display of that Interactive Report as the last column.
    In Oracle Forms I have a function saved to the database that is called within the main query. Maybe I am asking a question that does not need to be asked but in any case my question is can I put that function currently in the database somewhere in the confines of the Interactive Report and reference it via Http somehow or should I just stick with putting functions and procedures in packages stored in the database and called the conventional way?You could move the function to the database and call it from the report query, but it sounds as if it's superfluous. In the report query use whatever form of Re: 4. How do I convert rows to columns? is appropriate to your (unspecified) database version.
    When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
    <li>Full APEX version
    <li>Full DB/version/edition/host OS
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)
    <li>Browser(s) and version(s) used
    <li>Theme
    <li>Template(s)
    <li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.

  • Double quotes in function and procedure names when using impdp

    When viewing a function in the original database, it looks like:
    CREATE OR REPLACE FUNCTION TA_ACTIVITY_D_GEN_FNC
    After doing an expdp and impdp to restore a development database, it now looks like
    CREATE OR REPLACE FUNCTION "TA_ACTIVITY_D_GEN_FNC"
    and also has 2 blank lines at end of function.
    This causes us problems when trying to use various utilites to compare differences in production and development. Now every function and procedure shows up as being different.
    Can someone please explain why and what can be done to avoid this from happening?
    Edited by: user6116705 on Jun 15, 2010 7:52 AM

    from old exp, here is the first line of the create procedure statement:
    CREATE FORMAT71 PROCEDURE "SECURE_DML"
    You can see the double quotes. I don't understand why you wouldn't see the same compare issue with old exp. I was wondering what you were using for compare since it would let me know where to look for anything that has changed from the original create to the create performed by data pump. I remember there being an issue in this area. I just don't remember if it was extra spacing, upcasing, or something else or multiple changes. You could contact Oracle support to see if there is a fix and if it is backported to your version.
    The only other way you can possibly fix this (and it would be a huge pain) would be to run impdp with a sqlfile and then edit the sqfile to remove the double quotes and to remove any extra spacing/extra lines. A patch from Oracle would certainly be easier if one was available.
    Dean

  • Oracle Cluster and libnnz10 problem - SOLVED!

    Hi to all
    I have some machines (XServe) with OSX 10.4.9 and Oracle 10.1.0.3.
    In all the machines I follow the instructions find in this forum (the relink libnnz10.dylib trick) and all the databases runs very well.
    Now I'm trying to instal two machines in cluster mode.
    The node 1 is a clean machine. The node 2 is a machine that has a Oracle single instance running.
    All the installation in cluster mode runs smooth and I made the same things that in a single instance (like the relink trick).
    With all installed, the CRS daemon is running and the listeners is running (I run NETCA before runnig DBCA).
    Using the DBCA works fine until the last step - for the database creation, the last script has a shutdown/startup command to run a full recompile of all packages and procedures in the database.
    At this moment the installation fails (with end-of-communication channel). Looking in the logs, this is the _dyld libnnz10.dylib error.
    Even after the crash in installation, I quit the DBCA and runs SQLPLUS. I connect in the database, try a startup (that fails with the error mentioned), reconnect again and make two commands : alter database mount; alter database open; (and it works).
    I do this in the two nodes and the CRS daemon recognizes the running instances (with crs_stat -t I can see all online) and the database is running and in cluster (what I do in one instance appears in the other and the datafiles are the same), including failover tasks (like simulating a node down - the database still running).
    But all tries to run the startup/shutdown commands fails. It fails always when the LMON processes try to start.
    I recheck the installation, focusing in the relink trick with the libnnz10. When I use DBCA to install a single instance on node 1 or node 2 in the same ORACLE_HOME of the cluster, it runs fine (including startup/shutdown) - this make me think that all the database relink's are fine.
    I try to relink the cluster. In installation it uses 4 makes and I redo this makes without the libnnz10. The makes runs well too, but the error continues (only using startup/shutdown in cluster database).
    I'm doing the documentation of the process and will post it, but I want to resolve this issue.
    Any ideas ?
    Thanks to all
    Message was edited by:
    alliance01

    Hi to all.
    I downloaded the 10.1.0.5 as soon I can - thanks to damjanp!
    After the download, I follow all the instructions.
    I stop the database, all the services and the cluster. Run the installer and it works fine.
    When I try to make the post-installation tasks, I cannot startup the database (nor with the error that I was having). I received a Oracle Cluster Configuration Error...
    I read all the logs and find 3 errors. I do not know if this occurs because of wrong environment variables.
    The commands awk, touch and basename fails - the scripts try to find this commands in /bin (this commands in OSX stay in /usr/bin). I prefer make a link (ln -s) using root :
    ln -s /usr/bin/awk /bin/awk
    ln -s /usr/bin/touch /bin/touch
    ln -s /usr/bin/basename /bin/basename
    When I done this, the cluster starts (ocssd.bin, crsd.bin e evmd.bin). But when I try to start the database, it fails (ORA-29702 : error occurred in Cluster Group Service operation) and srvctl gives me PRKH-1010 : Unable to communicate with CRS services. [OCR Error(Native : prsr_initCLSS:[21])].
    To resolve this I use localconfig (user root) :
    localconfig reset /<ORACLE_HOME>
    After this, I shutdown all and restart the CRS services - and for my surprise the CRS automaticaly starts all the services (including the instances).
    And the libnnz10 problema was gone!
    I read the documentation and found that the "TNS - lost contact" problem in Tiger (yeah - Tiger) was resolved.
    I think that 10.1.0.5 can runs on Tiger more easily.
    The cluster are running fine now - I shutdown/startup the instance several times to test with no errors.
    I will prepare a documentation to post in the Web about this installation. When I finish I post in this forum the link.
    Thank's to all.

  • Outgoing audio. Was not going on Skype after ios7 download.went to settings--privacy--microphone--on--and the problem was resolved.

    Outgoing audio. Was not going on Skype after ios7 download.went to settings--privacy--microphone--on--and the problem was resolved.

    Hello:>
    I created a function "APEX_030200.wwv_flow_epg_include_mod_local" as a sys user, then I dropped it.>
    You can't have 'created' this function ! The function is installed by the APEX installer. This function needs to exist in the database for APEX to function correctly. Install the function described below into your database
    CREATE OR REPLACE function APEX_030200.wwv_flow_epg_include_mod_local(
        procedure_name in varchar2)
    return boolean
    is
    begin
        return false; -- remove this statement when you modify this function
        -- Administrator note: the procedure_name input parameter may be in the format:
        --    procedure
        --    schema.procedure
        --    package.procedure
        --    schema.package.procedure
        -- If the expected input parameter is a procedure name only, the IN list code shown below
        -- can be modified to itemize the expected procedure names. Otherwise you must parse the
        -- procedure_name parameter and replace the simple code below with code that will evaluate
        -- all of the cases listed above.
        if upper(procedure_name) in (
              '') then
            return TRUE;
        else
            return FALSE;
        end if;
    end wwv_flow_epg_include_mod_local;
    /Varad

  • Can SQL Developer control versioning of stored functions and procedures?

    Hi all. I have a problem with my project, for developing Oracle functions and procedures. My team want to control versioning of that.
    I found that Oracle SQL Developer support versioning features with CVS and Subversion. But I think it just about the files not functions and procedures.
    We don't want to control version of files and copy it to stored somethings..
    Do you have any idea?
    Thanks for reading this post.

    Since K asked :)
    Both SQL Navigator and Toad for Oracle support controlling PL/SQL at the FILE and DATABASE level.
    [Controlling Objects in the Database with Toad|http://www.toadworld.com/BLOGS/tabid/67/EntryID/136/Default.aspx]

  • Mac suddenly very slow and other problems

    Since a few days ago I've been experiencing the following problems:
    + VERY long startup time (more than four minutes vs. about a minute previously).
    + When starting an application, the system frequently hangs for a few seconds. (While it's hanging, sometimes the process is marked "doesn't react" in Activity Monitor).
    + Everything feels much slower and less responsive than it used to be and I'm frequently getting the spinning pinwheel.
    + Parallels doesn't start any more. After double-clicking the Parallels desktop icon, the icon jumps up and down in the dock for a little while and then just disappears.
    The problem may or may not be related to the removal of my Bootcamp partition, which I did shortly before the problems started to occur. I don't remember if the problems started immediately after the removal of the Bootcamp partition but I think it's likely that there is a connection.
    I did lots of things to find the cause and solve the problem, to no avail:
    + Made sure that after the Bootcamp removal the Mac HD is selected as the start volume.
    + Checked the HD using Disc Utility (no errors found)
    + Repaired permissions using Disc Utility
    + Created a new user account (problem persisted)
    + Cleared system caches
    + Ran various checks using Onyx (no problems found)
    + Deleted PRAM by starting up and pressing ALT-CMD-R-P
    + Checked for viruses (no viruses found)
    + Unplugged all USB devices
    + Reinstalled OS X ("archive and install")
    None of this helped.
    Observations:
    + I tried to start in safe mode but that made the startup procedure even slower, I was seeing the Apple logo and the grey spinning wheel for almost 10 minutes alone.
    + According to Activity Monitor there's always lots of free memory and CPU power.
    I'm really clueless as to what else I could do other than wiping the HD and reinstalling everything from scratch or sending the machine back to Apple. Any ideas would be *very much appreciated*!

    Hard to believe, the problem is back!
    Everything worked just fine last night. This morning I turn the iMac on and the problems are back: Extremely long time to startup, application hangs, everything super slow.
    Any ideas?
    I restarted in verbose mode and took some pictures, in case that helps...
    http://gallery.me.com/cjanz#100008

  • I am not able to launch FF everytime i tr to open it, it says FF has to submit a crash report, i even tried doing that and the report was submitted too, but stiil FF did not start, and the problem still persists, please help me solve this issue in English

    Question
    I am not able to launch FF everytime i try to open it, it says FF has to submit a crash report,and restore yr tabs. I even tried doing that and the report was submitted too, but still FF did not start, and the problem still persists, please help me solve this issue
    '''(in English)'''

    Hi Danny,
    Per my understanding that you can't get the expect result by using the expression "=Count(Fields!TICKET_STATUS.Value=4) " to count the the TICKET_STATUS which value is 4, the result will returns the count of all the TICKET_STATUS values(206)
    but not 180, right?
    I have tested on my local environment and can reproduce the issue, the issue caused by you are using the count() function in the incorrect way, please modify the expression as below and have a test:
    =COUNT(IIF(Fields!TICKET_STATUS.Value=4 ,1,Nothing))
    or
    =SUM(IIF(Fields!TICKET_STATUS=4,1,0))
    If you still have any problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • BOSD, Battery issues and Heating problem after iOS 8 upgrade

    i have upgraded my iPad mini to iOS 8. Ever since I upgraded to iOS 8 am facing blue screen issues and heating problem as well. This is really frustrating even the patch iOS 8.0.2 dint solve the problem. Are you guys listening our complaints. When will you fixing it.

    The same thing happened to me on my 2012 Subaru Outback.  I'm not sure this will help you since you have a Honda, but I'm posting this just in case.
    I paired the audio on my car with my iPhone 6.  However, when I turned the car off and back on again, the iPhone would not pair automatically.  I had to manually connect the iPhone with the car.  Turns out there are two separate bluetooth pairings on my car: one for phone which allows up to 5 devices and one for audio which allows only one device.  So I did the second bluetooth pairing for the phone (had already done the audio), and that fixed it.  YMMV

  • I am making code to try to make a game and my problem is that my code......

    I am making code to try to make a game and my problem is that my code
    will not let it change the hit everytime so im getting the first guy to hit 1 then next hits 8 and so on and always repeats.
    Another problem is that I would like it to attack with out me telling it how much times to attack. I am using Object oriented programming.
    Here is the code for my objects:
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.Random;
    import static java.lang.Math.*;
    import java.awt.*;
    import java.awt.color.*;
    class rockCrab {
         //Wounding formula
         double sL = 70;                                   // my Strength Level
         double bP = 1;                                   // bonus for prayer (is 1 times prayer bonus)
         double aB = 0;                                 // equipment stats
         double eS = (sL * bP) + 3;                         // effective strength
         double bD = floor(1.3 + (eS/10) + (aB/80) + ((eS*aB)/640));     // my base damage
         //Attack formula
         double aL = 50;                                   // my Attack Level
         double eD = 1;                                   // enemy's Defence
         double eA = aL / eD;                              // effective Attack
         double eB = 0;                                   // equipment bonus'
         double bA = ((eA/10) * (eB/10));                    // base attack
         //The hit formula
         double fA = random() * bA;
         double fH = random() * bD;
         double done = rint(fH - fA);
         //health formula
         double health = floor(10 + sL/10 * aL/10);
         rockCrab() {
         void attack() {
              health = floor(10 + sL/10 * aL/10);
              double done = rint(fH - fA);
              fA = random() * bA;
              fH = random() * bD;
              done = rint(fH - fA);
              System.out.println("Rockcrab hit" +done);
    import java.lang.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.Random;
    import static java.lang.Math.*;
    import java.awt.*;
    import java.awt.color.*;
    class self {
         //Wounding formula
         double sL = 1;                                   // my Strength Level
         double bP = 1;                                   // bonus for prayer (is 1 times prayer bonus)
         double aB = 0;                                 // equipment stats
         double eS = (sL * bP) + 3;                         // effective strength
         double bD = floor(1.3 + (eS/10) + (aB/80) + ((eS*aB)/640));     // my base damage
         //Attack formula
         double aL = 1;                                   // my Attack Level
         double eD = 1;                                   // enemy's Defence
         double eA = aL / eD;                              // effective Attack
         double eB = 0;                                   // equipment bonus'
         double bA = ((eA/10) * (eB/10));                    // base attack
         //The hit formula
         double fA = random() * bA;
         double fH = random() * bD;
         double done = rint(fH - fA);
         //health formula
         double health = floor(10 + sL/10 * aL/10);
         self() {
         void attack() {
              health = floor(10 + sL/10 * aL/10);
              fA = random() * bA;
              fH = random() * bD;
              done = rint(fH - fA);
              System.out.println("You hit" +done);
    }Here is the main code that writes what the objects do:
    class fight {
         public static void main(String[] args) {
              self instance1 = new self();
              rockCrab instance2 = new rockCrab();
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
              instance2.health = instance2.health - instance1.done;
              System.out.println("You hit: " +instance1.done);
              System.out.println("rockCrabs health: " + instance2.health);
              instance1.health = instance1.health - instance2.done;
              System.out.println("RockCrab hit: " +instance2.done);
              System.out.println("rockCrabs health: " + instance1.health);
    }when the code is run it says something like this:
    you hit 1
    RockCrabs health is 9
    RockCrab hit 7
    your health is 38
    you hit 1
    RockCrabs health is 8
    RockCrab hit 7
    your health is 31
    you hit 1
    RockCrabs health is 7
    RockCrab hit 7
    your health is 24
    you hit 1
    RockCrabs health is 6
    RockCrab hit 7
    your health is 17
    my point is whatever some one hits it always repeats that
    my expected output would have to be something like
    you hit 1
    RockCrabs health is 9
    RockCrab hit 9
    your health is 37
    you hit 3
    RockCrabs health is 6
    RockCrab hit 4
    your health is 33
    you hit 2
    RockCrabs health is 4
    RockCrab hit 7
    your health is 26
    you hit 3
    RockCrabs health is 1
    RockCrab hit 6
    your health is 20
    Edited by: rade134 on Jun 4, 2009 10:58 AM

    [_Crosspost_|http://forums.sun.com/thread.jspa?threadID=5390217] I'm locking.

Maybe you are looking for

  • ** File Content Conversion Error in Receiver CC - How to solve this?

    Hi friends, My target structure looks like below. EmployeeJobDetails                                        --> Message Type    JobCode                                                      --> Node         EmployeeNumber            xsd:string        

  • Microsoft apps are not supported by Lion?

    Is it true microsoft apps are not supported by Lion? I just upgraded and now I'm getting a message my microsoft apps are no longer available. Any upgrades to bring them online?

  • Error I am getting at ECC6.0 installation

    when installing SAP ECC6.0 on Windows Operating system platform I am getting error at SAPAPPL2.Log at C:\programfiles\sapinst_instdir\ERP\SYSTEM\ORA\CENTRAL\AS Unable to allocate 4108 bytes of shared memory. at SAP Level at IMPORT ABAP I am getting e

  • An error occurred while backing up this iPad (-43), can't upgrade to IOS 5

    As per title, my XP was just upgraded to iTune 10.5 and the itune music library was also successfully relocated to another drive to make room for the upgrade preparation. According to the pre-upgrade message, my ipad backup just need ~9G space while

  • PE7 not showing RAW with Windows 7 64bit

    Just upgraded to Windows 7 64-bit and now PE7 will no longer open .NEF raw files from my Nikon D90. I downloaded Camera Raw 5.5 update and moved the 64bit 8BI plug-in to the File Formats folder but still get error message saying it cannot be opened (