Strange If Condition

Dear All, My Name Is Ayman and I've been Programming on NetBeans 4 Only Couple o' Days, But What Helped me the most is i have a good background of other programming languages like c#..
i have a strange problem in my "if statement" !! i hope to get the answer for the problem soon cuz i wouldn't rest until i get the answer and i couldn't get the answer my self. by the way, this is my first post, i hope it would be a good one :)
private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {                                     
        jTextField1.setText(RightAnswer);
        if (jTextField1.getText().toString() == RightAnswer  )
           jLabel2.setText("Right");
        else
            jLabel2.setText("Wrong");
        //jTextField1.setText(jTextField1.getText());
// TODO add your handling code here:
//Integrated Security=true;
    int rand;
    String RightAnswer;
    String Question;
    private void formWindowOpened(java.awt.event.WindowEvent evt) {                                 
           Connection con = null;
           Statement stm = null;
           ResultSet st = null;
           ResultSet m = null;
           String connectionUrl = "jdbc:sqlserver://localhost:1360;databaseName=amhajja;user=ayman;password=123456";
           try
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection(connectionUrl);
            String SetAskedToFalse = "update Questions set Asked = 0;";
            rand =1+ (int) (Math.random()*4);
            stm = con.createStatement();
            st = stm.executeQuery(SetAskedToFalse);
            catch(Exception e)
              jLabel1.setText(e.toString());
           try
            Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
            con = DriverManager.getConnection(connectionUrl);
            String SelectQ = "select * from Questions where ID="+rand+";";
            stm = con.createStatement();
            st = stm.executeQuery(SelectQ);
            while (st.next())
                RightAnswer = st.getString(3);
                jLabel1.setText(st.getString(2));
           catch(Exception e)
               jLabel1.setText(e.toString());
    }      note* : i always get Wrong even though am sure that i enter the right answer on jTextField1, and i checked once by letting the jave prints the value of RigntAnswer and the value of jTextField1.getText().toString() and they are the same, but doesn't enter the "then" section and goes to the "else" section always..
i also tried to put this statement before the if statement and also it didn't work for me:
jTextField1.setText(RightAnswer); // ofcourse that's not what i want but only to try to figure out what's wrong.
and also didn't enter the "then" section of my if statement.
sorry if this is a newbie question, and thnx for all in advance.

Roronoa.Zoro wrote:
Dear All, My Name Is Ayman and I've been Programming on NetBeans 4 Only Couple o' Days, But What Helped me the most is i have a good background of other programming languages like c#..
i have a strange problem in my "if statement" !! i hope to get the answer for the problem soon cuz i wouldn't rest until i get the answer and i couldn't get the answer my self. by the way, this is my first post, i hope it would be a good one :)
private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {                                     
jTextField1.setText(RightAnswer);
if (jTextField1.getText().toString() == RightAnswer  )
jLabel2.setText("Right");
else
jLabel2.setText("Wrong");
//jTextField1.setText(jTextField1.getText());
// TODO add your handling code here:note* : i always get Wrong even though am sure that i enter the right answer on jTextField1, and i checked once by letting the jave prints the value of RigntAnswer and the value of jTextField1.getText().toString() and they are the same, but doesn't enter the "then" section and goes to the "else" section always..
i also tried to put this statement before the if statement and also it didn't work for me:
jTextField1.setText(RightAnswer); // ofcourse that's not what i want but only to try to figure out what's wrong.
and also didn't enter the "then" section of my if statement.
sorry if this is a newbie question, and thnx for all in advance.Use the equals() method to compare Strings not "==".
if (thisString.equals(thatString) {

Similar Messages

  • Strange behavior in BI Publisher with long column names from BI Answers

    Hello all!
    I have created a BI Answers request with few calculated columns in form of
    case when <condition> then <value if true> else <value if false> end
    Then in BI Publisher Desktop designed a report ttemplate based on saved BI Answers request and noticed that for calculated columns their names look strange:
    CASEWHEN_<condition>THEN...ELSE..._...END__
    Some of the column names are about 100 characters long.
    After running the report from Word found that for these "long length named columns" there's no data in the output.
    Do someone else experience the same? Any workarounds?
    Regards,
    mr.maverick

    This is because the length for the formula is restricted in publisher. you have to either reduce the size of the column name in answers or change the formula. another workaround is completely pasting the formula directly in the word template instead of placing the formula inside the form field. you can add maximum of 300 characters i guess. you can edit the formula for the form field in the form field options formuals menu.

  • Routing condition in receiver determination

    Hi,
    In my RFC to JMS scenario, i encountered with a strange routing condition for the receiver determination.
    I have routing condition like " string length (one field in Bapi)<1" .
    Could any one help me how to implement this?
    Regards,
    Vishnu.

    HI check the below links for reference
    https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=transactional
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a1a0eb43-0b01-0010-23aa-908cc4eaabcd
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.sdn.folder.sdn!2fco...
    note:reward points if solution found helpfull.....
    regards
    chandrakanth.k

  • JBO-3003 Application pool, Error JDBC connection

    Hi, I'm trying to run a simple webapp but get this error:
    JBO-30003: The application pool (model.RoomReservationsAppModuleLocal) failed to checkout an application module due to the following exception:
    oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.JboException, msg=JBO-29000: Unexpected exception caught: oracle.jbo.DMLException, msg=JBO-26061: Error while opening JDBC connection.
    Anyone know what to do?
    Regards ,
    Ketil
    I

    Hi Erik,
    The solution of having the two root ApplicationModules share a single JDBC connection violates some assumptions of the BC4J architecture and could result in some strange race conditions in JDBC.
    We should focus your solution on how the panels are released. It ought to be possible to release the BindingContainer for the panel without releasing the underlying DataControl. With this solution you would only require one root ApplicationModule and one JDBC connection.
    How are you releasing the ADF and BC4J references when you close the panel? I would expect you to be invoking release on the DCBindingContainer instance only. If you are already doing this then what is causing the commit/rollback?
    Hope this helps,
    JR

  • The content database on the server is temporarily unavailable while deploying a app

    HI,
    I got the following error while deploying a app. I have not added any logic in App.
    What i have tried yet:
    1. Configured Server for Using App
    2. Added permission to user2 (app developer account by which i open VS 2012) as mentioned in following URL
    http://community.zevenseas.com/Blogs/Akhilesh/Lists/Posts/Post.aspx?ID=10
    Please let me know if anyone have faced and resolved it before....
    Here we go .............................
    Active Deployment Configuration: Deploy App for SharePoint
      Skipping deployment step because a pre-deployment command is not specified.
      Skipping the uninstall step because the app for SharePoint is not installed on the server.
      Install app for SharePoint:
      Uploading the app for SharePoint...
      Installation is in progress (00:00:00)
      Installation is in progress (00:00:01)
      Installation is in progress (00:00:02)
      Installation is in progress (00:00:03)
      Installation is in progress (00:00:04)
      Installation is in progress (00:00:05)
      App failed to install, cleaning up...
      App installation cleanup failed due to errors.  Please see the app on the SharePoint site’s “Site Contents” page for details.
      App installation encountered the following errors:
      11/19/2013 2:42:13 PM
      @"Error 1
            CorrelationId: e6d878ab-ae8b-442c-90c1-ee989f5e719b
            ErrorDetail: The content database on the server is temporarily unavailable.
            ErrorType: Transient
            ErrorTypeName: Intermittent
            ExceptionMessage: System.IO.FileNotFoundException: <nativehr>0x80070002</nativehr><nativestack></nativestack>
       at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder)
       at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder)
       at Microsoft.SharePoint.SPWeb.GetList(String strUrl)
       at Microsoft.SharePoint.Administration.SPDeveloperData.AddToDraftApps(Guid appInstanceId)
       at Microsoft.SharePoint.Lifecycle.FinalFixupTask.Deploy()
       at Microsoft.SharePoint.Administration.SPAppTask.DeployOperation()
       at Microsoft.SharePoint.Lifecycle.MonitoredTaskExecution.DoTask()
            Source: Finalization
            SourceName: App Deployment Finalization
      @"Error 2
            CorrelationId: e6d878ab-ae8b-442c-90c1-ee989f5e719b
            ErrorDetail: The content database on the server is temporarily unavailable.
            ErrorType: Transient
            ErrorTypeName: Intermittent
            ExceptionMessage: System.IO.FileNotFoundException: <nativehr>0x80070002</nativehr><nativestack></nativestack>
       at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder)
       at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder)
       at Microsoft.SharePoint.SPWeb.GetList(String strUrl)
       at Microsoft.SharePoint.Administration.SPDeveloperData.RemoveFromDraftApps(SPSite site, Guid appInstanceId)
       at Microsoft.SharePoint.Lifecycle.FinalFixupTask.Rollback()
       at Microsoft.SharePoint.Administration.SPAppTask.DeployOperation()
       at Microsoft.SharePoint.Lifecycle.MonitoredTaskExecution.DoTask()
            Source: Finalization
            SourceName: App Deployment Finalization
    Harsh

    no ,it does has db permissions , this whole thing I think is related with weird and strange new condition of havinng sub-domains for apps ? by some changes I found it gos to my website and find outs that no resource available there , sometime 404 sometimes
    502 error. 
    The whole idea of office team about app deployment is crazy , no proper documentation or knowledge base available for people using on-prem sharepoint, this may because of the idea using cloud more ,why should we use cloud for our enterprise data ?
    btw links you gave not working either 
    Tech Learner

  • How to update a Windows 8 application to latest WinJS (4.0-preview)

    Hello,
    I am having issues in my Windows 8 application, because of this issue:
    https://github.com/winjs/winjs/issues/146
    This is a strange race condition that was fixed by @rigdern in this commit:
    https://github.com/winjs/winjs/commit/dbc7a96d53bbed9d68471d1b6a84b7a130e7dfec
    In my Windows 8 application project, I have a reference to:
    C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.WinJS.2.0\1.0\
    And ui.js is currently located in:
    C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1\ExtensionSDKs\Microsoft.WinJS.2.0\1.0\DesignTime\CommonConfiguration\neutral\Microsoft.WinJS.2.0\js\ui.js
    With this link (https://github.com/winjs/winjs/releases/download/release%2F4.0.0-preview/winjs.zip) I can get all the files for WinJS 4.0-preview but how exactly am I supposed to use this? 
    Should I monkey patch what's in Program Files so that the new files will be packaged?
    Should I remove the reference to WinJS 2.0 from my project and include the downloaded WinJS 4.0 files in my project directly and reference them in my head tags? Will that even work or does Visual Studio need to have a WinJS reference to be able to package my
    application?
    Thanks for your help,
    Fabien

    Please post problems with the WinJS preview on the Issues section of its github project:
    https://github.com/winjs/winjs/issues
    That said, you should be able to include the new files and change the references in your head tags to the new version. Beware though that there may be some other breaking changes you'll need to deal with.

  • Time capsule is very slow on wired Ethernet - tested from multiple sources

    I purchased a 2 TB Time Capsule today. I want to use it for automatic backups of my Macbook, and I also want to use it to store files from my Windows PC's.
    My TC is connected to my network using wred Ethernet only (Wireless is disabled in the TC)
    My problem is that transferring files to the TC is incredibly slow. I have been doing some research and found lots of articles that talk about wireless interference and various problems with interoperability between WiFi flavors. None of these would seen to apply as I am using only wired Ethernet to transfer my files.
    I also found a couple of discussions that describe how to make a change to the Mac's TCP/IP configuration to avoid a strange network condition slowing things down. This solution doesn't seem applicable as I am seeing the performance problem regardless of where I copy files FROM (I have a mixed environment with Windows and Linux and Mac systems)
    Also, I am aware that the inital backup with Time Machine will be slow but I don't think that's relevant to my situation.
    My TC is configured for file sharing so I can read and write files from my various Windows systems on the network. When I copy a set of large files to the TC, I see a typical transfer rate of 5 - 6 MB / Second. To me, this is completely abnormal and here is why: When I copy the same files, from the same Windows system, to a server on my network I get about 60 MB / second or about 10 times the transfer rates.
    The TC is running firmware 7.4.2.
    What gives?
    Message was edited by: 92656iPhone

    I also had the same issue. My Time Capsule was connect to the Linksys router WAG325N. I had a wireless network broadcasted from the Linksys and a different one from the Time Capsule. When connected to the TIme Capsule wireless network i pinked the Linksys router and got 10% to 30% pack loss. When i pinked the Time Capsule i got 0% loss. I used the AirPort Utility and changed the "Internet" "Ethernet WAN Port" from automatic to "10 Mbps/Full Duplex" and this seem to fix the slow internet.
    I guess the Linksys and Time Capsule as issues with port speed negotiation.

  • Forum user in a bad state

    Strange psychological condition demonstrated by this user :
    http://forums.oracle.com/forums/profile.jspa?userID=728005

    hoek wrote:
    He/she appears to have seen the (programming) light! ;)Yes,
    but it seems that the light was blinding enough to cause uncontrollable postings of impressions with oracle , and maybe even pronouncing
    "unbreakable oracle" while writing those posts.
    I hope user8751564 is ok now.
    :)

  • Workflow Condition giving strange output

    Hello Experts,
    I am getting an strange issue in my workflow.
    Here is the condition in the workflow -
    &SWITCHDOC.SERVICEPROVIDERNEW.SERVICEPROVIDER& NE "space"  AND
    &SWITCHDOC.TARGETSUPPLYSCENARIO.VERSORGUNGSSZENARIO& NE "space"
    still i get the result false even if both the filed is filled in the container
    Can any one suggest me somthing on this issue?
    Thanks in Advance,
    Pritam

    Hi Pritam,
    whats the data type of your two parameters?
    Please check is there any default values and if it is type 'NUMC' means it has 0000 by default.
    So it can also made the conflict.
    Thanks,
    Vijay.

  • Method cellForRowAtIndexPath if (cell == nil) {} condition strange behavior

    This tableView’s are making me crazy. I just tested this behavior on new test project (iPad) with one tableView. I added 30 sections with one row per section and put this line inside if( cell == nil ) {} condition in cellForRowAtIndexPath method:
    NSLog(@”Creating cell %d”,indexPath.section);
    When I launch application I get this in output:
    Creating cell 0
    Creating cell 1
    Creating cell 2
    Creating cell 20
    Creating cell 21
    Only 22 cells are visible on first run. That’s ok, tableView created only cells that are visible. So far so good.
    But when I scroll down to see the rest of the cells (8 other cells) the console only shows me this:
    Creating cell 22
    Why did tableView skipped creating last 7 rows and used them from queue instead? isn’t that kind a strange behavior? Or maybe is this a bug in apple’s tableView? Or maybe I am wrong and don’t quite understand the background of tableView reusing…?
    Any help appriciated, thanks!

    Ok, I find out that this is normal and native behavior for tableView's.

  • Strange condition on 4948 nexus

    I had a strange condition today. Had a snmp discovery running ( from a ca product called spectrum) it does extensive mapping both layer2 and layer 3 ....however we had a 4948 crash in our data centre possibly as a result thereof...no real evidence but snmp load was huge .
    Anyone seen anything like this before ?
    Thanks
    Sent from Cisco Technical Support iPad App

       I have seen snmp bury switches cpu before so it's certainly possible.  I would check your tool and see if there is some way to rate limit the snmp polling or you may have try and figure out if there is a way using control plane policeing .  Also check for bugs for
    your version of code .

  • Strange InfoProvier Selection Condition

    Hello xperts,
    I am struggling to understand one thing in a solution that I have inherited from my predecessor.
    When viewing the request information loaded into a (target) DSO (right click DSO->manage) under selection conditions the following appears:
    BSDD04BHSPC0=BBE;BSDD04CALMONTH=201006;CALMONTH=200711-201005;
    BHSPC0 and CALMONTH are characteristics in the DSOs (in both source and target)
    BSDD04 is a DSO in our system, but is NOT the source nor the target.
    The selection condition: CALMONTH=200711-201005 i interpret as a filter restriciton in the DTP and this makes sense.
    Question: what does BSDD04 in BSDD04BHSPC0=BBE and BSDD04CALMONTH=201006 mean?
    Obviously some sort of filter restriction, but on what???
    I assume it must have been the DTP filter restrition at the time of laoding, but now the problem is I do not know how to replicate it.
    This strange of selection condition only appears for one DTP. Other DTPs in this and other infoproviders have the standard selection condition denotation e.g. /BIC/BHSPC0=BBE or SPC0=BBE.
    Thanx

    Ok, I have cjecked that, but not able to find out the Gap.
    Is Consolidation Unit Hierarchy can be a issue like I have  Cons Hierarchy under that Consolidation Group, Under that Sub Group and then Consolidation Unit.
    Hierarchy
    Consolidation Group
    Cons Sub Group
    Cons Unit
    I tried to execute the task at COns Group Level and at Sub group level, yet the message remains same.

  • Strange issue when running sql with false condition

    Hi,
    I'm running this query from the application:
    select 22
    from DUAL
    where ( to_number(0) <> 0 ) and exists (
    select 'X'
    from TABULA.macdent$FNCITEMS
    where ( macdent$FNCITEMS.QIV = to_number(0) ) );
    And it takes a long time because it is checking the second condition.
    Even though the first one is False.
    When running it through sqlplus it takes nothing. and of course no rows returns.
    The 0 in to_number is a bind variable
    it looks like this:
    select :intvar
    from DUAL
    where ( to_number(:QIV$) <> 0 ) and exists ( select 'X'
    from TABULA.macdent$FNCITEMS
    where ( macdent$FNCITEMS.QIV = to_number(:QIV$) ) )
    1 - filter predicate: ( IS NOT NULL AND 0<>TO_NUMBER(TO_CHAR(:QIV$)))
    But in sqlplus the filter predicates is different.
    1 - filter(NULL IS NOT NULL AND EXISTS (SELECT 0 FROM "TABULA"."MACDENT$FNCITEMS" "MACDENT$FNCITEMS" WHERE
    SQL> select 22
    from DUAL
    where ( to_number(0) <> 0 ) and exists (
    select 'X'
    from TABULA.macdent$FNCITEMS
    where ( macdent$FNCITEMS.QIV = to_number(0) ) );
    2 3 4 5 6
    no rows selected
    Elapsed: 00:00:00.00
    Execution Plan
    Plan hash value: 883410849
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
    Time | TQ |IN-OUT| PQ Distrib |
    | 0 | SELECT STATEMENT | | 1 | | 0 (0)| | | | |
    |* 1 | FILTER | | | | | | | | |
    | 2 | FAST DUAL | | 1 | | 2 (0)|00:00:01 | | | |
    | 3 | PX COORDINATOR | | | | | | | | |
    | 4 | PX SEND QC (RANDOM)| :TQ10000 | 63M| 782M| 2 (0)|00:00:01 | Q1,00 | P->S | QC (RAND) |
    | 5 | PX BLOCK ITERATOR | | 63M| 782M| 2 (0)|00:00:01 | Q1,00 | PCWC | |
    |* 6 | TABLE ACCESS FULL| MACDENT$FNCITEMS | 63M| 782M| 2 (0)|00:00:01 | Q1,00 | PCWP | |
    Predicate Information (identified by operation id):
    1 - filter(NULL IS NOT NULL AND EXISTS (SELECT 0 FROM "TABULA"."MACDENT$FNCITEMS" "MACDENT$FNCITEMS" WHERE
    "MACDENT$FNCITEMS"."QIV"=0))
    6 - filter("MACDENT$FNCITEMS"."QIV"=0)
    ANY SUGGESTIONS?
    Thanks,

    912294 wrote:
    Hi,
    I'm running this query from the application:
    select 22
    from DUAL
    where ( to_number(0) <> 0 ) and exists (
    select 'X'
    from TABULA.macdent$FNCITEMS
    where ( macdent$FNCITEMS.QIV = to_number(0) ) );
    Why are you using "to_number(0)"? the zero is already seen by oracle as a number.
    The to_number function expects to get a character string as the argument: to_number('0')
    See the difference?
    As you currently have it coded, you are forcing oracle to do an implicit conversion of the number zero to the character string '0' in order to pass it to to_number to convert it back to the number zero.
    And what is the point of "where to_number(0) <> 0"
    When would that EVER be true?
    And it takes a long time because it is checking the second condition.
    Even though the first one is False.
    When running it through sqlplus it takes nothing. and of course no rows returns.
    The 0 in to_number is a bind variable
    it looks like this:
    select :intvar
    from DUAL
    where ( to_number(:QIV$) <> 0 ) and exists ( select 'X'
    from TABULA.macdent$FNCITEMS
    where ( macdent$FNCITEMS.QIV = to_number(:QIV$) ) )
    So the query you showed at the top is not the query we are really dealing with. What is the data type of QIV$? At least now we know that comparison to zero is not a fixed value.
    1 - filter predicate: ( IS NOT NULL AND 0<>TO_NUMBER(TO_CHAR(:QIV$)))
    This suggests QIV$ is already a number, else why would you pass it to to_char? And as I said above, if it is already a number, why pass it to to_number? Here you appear to be explicitly doing what I described oracle as implicitly doing in your first query above.
    But in sqlplus the filter predicates is different.
    1 - filter(NULL IS NOT NULL AND EXISTS (SELECT 0 FROM "TABULA"."MACDENT$FNCITEMS" "MACDENT$FNCITEMS" WHERE
    SQL> select 22
    from DUAL
    where ( to_number(0) <> 0 ) and exists (
    select 'X'
    from TABULA.macdent$FNCITEMS
    where ( macdent$FNCITEMS.QIV = to_number(0) ) );
    2 3 4 5 6
    no rows selected
    Elapsed: 00:00:00.00
    Execution Plan
    Plan hash value: 883410849
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
    Time | TQ |IN-OUT| PQ Distrib |
    | 0 | SELECT STATEMENT | | 1 | | 0 (0)| | | | |
    |* 1 | FILTER | | | | | | | | |
    | 2 | FAST DUAL | | 1 | | 2 (0)|00:00:01 | | | |
    | 3 | PX COORDINATOR | | | | | | | | |
    | 4 | PX SEND QC (RANDOM)| :TQ10000 | 63M| 782M| 2 (0)|00:00:01 | Q1,00 | P->S | QC (RAND) |
    | 5 | PX BLOCK ITERATOR | | 63M| 782M| 2 (0)|00:00:01 | Q1,00 | PCWC | |
    |* 6 | TABLE ACCESS FULL| MACDENT$FNCITEMS | 63M| 782M| 2 (0)|00:00:01 | Q1,00 | PCWP | |
    Predicate Information (identified by operation id):
    1 - filter(NULL IS NOT NULL AND EXISTS (SELECT 0 FROM "TABULA"."MACDENT$FNCITEMS" "MACDENT$FNCITEMS" WHERE
    "MACDENT$FNCITEMS"."QIV"=0))
    6 - filter("MACDENT$FNCITEMS"."QIV"=0)
    ANY SUGGESTIONS?
    Thanks,

  • Strange Condition Oracle Merge

    I have an Oracle Merge statement. The condition I am facing is that the statement is updating the table as well as inserting the record that its updated. I have duplicates in the table for this reason. Can someone please advice why this condition occurs? the primary key constraint of the table is disabled.

    The Merge statement is attached below. I am selecting my query from a view thats based on a table. My aim is to generate a summary at a level higher than that of the table. date_key here refers to the weekend date. ITs used instead of a week id.
    My problem is that the table has duplicate records after the merge. when i run the select part of this merge, it doesnt get me any duplicates.
    MERGE INTO WEEKLY_PGROUP_SUMMARY w
    USING (
    SELECT date_key, ccid, year_id, period_id, week_id, company, country,
    location, brand, mainbrand, pgroup,
    sales_qty, sales_cost, sales_value,
    fp_sales_qty, fp_sales_cost, fp_sales_value,
    md_sales_qty, md_sales_cost, md_sales_value,
    sreturns_qty, sreturns_cost, sreturns_value,
    grn_qty, grn_cost, grn_value,
    tfrin_qty, tfrin_cost, tfrin_value,
    tfrout_qty, tfrout_cost, tfrout_value,
    intake_qty, intake_cost, intake_value,
    preturns_qty, preturns_cost, preturns_value,
    adjm_qty, adjm_cost, adjm_value,
    adjw_qty, adjw_cost, adjw_value,
    adjc_qty, adjc_cost, adjc_value,
    adjt_qty, adjt_cost, adjt_value,
    adjv_qty, adjv_cost, adjv_value,
    stockob_qty, stockob_cost, stockob_value,
    fp_stockob_qty, fp_stockob_cost, fp_stockob_value,
    md_stockob_qty, md_stockob_cost, md_stockob_value,
    tm_stockob_qty, tm_stockob_cost, tm_stockob_value,
    stockcl_qty, stockcl_cost, stockcl_value,
    fp_stockcl_qty, fp_stockcl_cost, fp_stockcl_value,
    md_stockcl_qty, md_stockcl_cost, md_stockcl_value,
    se_stockcl_qty, tm_stockcl_cost, tm_stockcl_value,
    tm_stockcl_qty, se_stockcl_cost, se_stockcl_value,
    co_stockcl_qty, co_stockcl_cost, co_stockcl_value,
    currency, exrate1, exrate2, exrate3, exrate4, exrate5
    FROM generate_pgroup_summary_v ) v
    -- On condition includes all fields that are indexed
    ON (v.date_key = w.date_key AND v.ccid = w.ccid AND v.brand = w.brand
    AND v.pgroup = w.pgroup)
    WHEN MATCHED THEN
    UPDATE
    SET w.currency = v.currency,
    w.exrate1 = v.exrate1,
    w.exrate2 = v.exrate2,
    w.exrate3 = v.exrate3,
    w.exrate4 = v.exrate4,
    w.exrate5 = v.exrate5,
    w.sales_qty = v.sales_qty,
    w.sales_cost = v.sales_cost,
    w.sales_value = v.sales_value,
    w.fp_sales_qty = v.fp_sales_qty,
    w.fp_sales_cost = v.fp_sales_cost,
    w.fp_sales_value = v.fp_sales_value,
    w.md_sales_qty = v.md_sales_qty,
    w.md_sales_cost = v.md_sales_cost,
    w.md_sales_value = v.md_sales_value,
    w.sreturns_qty = v.sreturns_qty,
    w.sreturns_cost = v.sreturns_cost,
    w.sreturns_value = v.sreturns_value,
    w.grn_qty = v.grn_qty,
    w.grn_cost = v.grn_cost,
    w.grn_value = v.grn_value,
    w.tfrin_qty = v.tfrin_qty,
    w.tfrin_cost = v.tfrin_cost,
    w.tfrin_value = v.tfrin_value,
    w.tfrout_qty = v.tfrout_qty,
    w.tfrout_cost = v.tfrout_cost,
    w.tfrout_value = v.tfrout_value,
    w.intake_qty = v.intake_qty,
    w.intake_cost = v.intake_cost,
    w.intake_value = v.intake_value,
    w.preturns_qty = v.preturns_qty,
    w.preturns_cost = v.preturns_cost,
    w.preturns_value = v.preturns_value,
    w.adjm_qty = v.adjm_qty,
    w.adjm_cost = v.adjm_cost,
    w.adjm_value = v.adjm_value,
    w.adjw_qty = v.adjw_qty,
    w.adjw_cost = v.adjw_cost,
    w.adjw_value = v.adjw_value,
    w.adjc_qty = v.adjc_qty,
    w.adjc_cost = v.adjc_cost,
    w.adjc_value = v.adjc_value,
    w.adjt_qty = v.adjt_qty,
    w.adjt_cost = v.adjt_cost,
    w.adjt_value = v.adjt_value,
    w.adjv_qty = v.adjv_qty,
    w.adjv_cost = v.adjv_cost,
    w.adjv_value = v.adjv_value,
    w.stockob_qty = v.stockob_qty,
    w.stockob_cost = v.stockob_cost,
    w.stockob_value = v.stockob_value,
    w.fp_stockob_qty = v.fp_stockob_qty,
    w.fp_stockob_cost = v.fp_stockob_cost,
    w.fp_stockob_value = v.fp_stockob_value,
    w.md_stockob_qty = v.md_stockob_qty,
    w.md_stockob_cost = v.md_stockob_cost,
    w.md_stockob_value = v.md_stockob_value,
    w.tm_stockob_qty = v.tm_stockob_qty,
    w.tm_stockob_cost = v.tm_stockob_cost,
    w.tm_stockob_value = v.tm_stockob_value,
    w.stockcl_qty = v.stockcl_qty,
    w.stockcl_cost = v.stockcl_cost,
    w.stockcl_value = v.stockcl_value,
    w.fp_stockcl_qty = v.fp_stockcl_qty,
    w.fp_stockcl_cost = v.fp_stockcl_cost,
    w.fp_stockcl_value = v.fp_stockcl_value,
    w.md_stockcl_qty = v.md_stockcl_qty,
    w.md_stockcl_cost = v.md_stockcl_cost,
    w.md_stockcl_value = v.md_stockcl_value,
    w.se_stockcl_qty = v.se_stockcl_qty,
    w.se_stockcl_cost = v.se_stockcl_cost,
    w.se_stockcl_value = v.se_stockcl_value,
    w.tm_stockcl_qty = v.tm_stockcl_qty,
    w.tm_stockcl_cost = v.tm_stockcl_cost,
    w.tm_stockcl_value = v.tm_stockcl_value,
    w.co_stockcl_qty = v.co_stockcl_qty,
    w.co_stockcl_cost = v.co_stockcl_cost,
    w.co_stockcl_value = v.co_stockcl_value,
    w.modifiedon=stime
    WHEN NOT MATCHED THEN
    INSERT (date_key, ccid, year_id, period_id, week_id,
    company, country,location, brand, mainbrand,
    pgroup,
    sales_qty, sales_cost, sales_value,
    fp_sales_qty, fp_sales_cost, fp_sales_value,
    md_sales_qty, md_sales_cost, md_sales_value,
    sreturns_qty, sreturns_cost, sreturns_value,
    grn_qty, grn_cost, grn_value,
    tfrin_qty, tfrin_cost, tfrin_value,
    tfrout_qty, tfrout_cost, tfrout_value,
    intake_qty, intake_cost, intake_value,
    preturns_qty, preturns_cost, preturns_value,
    adjm_qty, adjm_cost, adjm_value,
    adjw_qty, adjw_cost, adjw_value,
    adjc_qty, adjc_cost, adjc_value,
    adjt_qty, adjt_cost, adjt_value,
    adjv_qty, adjv_cost, adjv_value,
    stockob_qty, stockob_cost, stockob_value,
    fp_stockob_qty, fp_stockob_cost, fp_stockob_value,
    md_stockob_qty, md_stockob_cost, md_stockob_value,
    tm_stockob_qty, tm_stockob_cost, tm_stockob_value,
    stockcl_qty, stockcl_cost, stockcl_value,
    fp_stockcl_qty, fp_stockcl_cost, fp_stockcl_value,
    md_stockcl_qty, md_stockcl_cost, md_stockcl_value,
    se_stockcl_qty, tm_stockcl_cost, tm_stockcl_value,
    tm_stockcl_qty, se_stockcl_cost, se_stockcl_value,
    co_stockcl_qty, co_stockcl_cost, co_stockcl_value,
    currency, exrate1, exrate2, exrate3, exrate4, exrate5,
    modifiedon)
    values
    (v.date_key, v.ccid, v.year_id, v.period_id, v.week_id, v.company, v.country,
    v.location, v.brand, v.mainbrand, v.pgroup,
    v.sales_qty, v.sales_cost, v.sales_value,
    v.fp_sales_qty, v.fp_sales_cost, v.fp_sales_value,
    v.md_sales_qty, v.md_sales_cost, v.md_sales_value,
    v.sreturns_qty, v.sreturns_cost, v.sreturns_value,
    v.grn_qty, v.grn_cost, v.grn_value,
    v.tfrin_qty, v.tfrin_cost, v.tfrin_value,
    v.tfrout_qty, v.tfrout_cost, v.tfrout_value,
    v.intake_qty, v.intake_cost, v.intake_value,
    v.preturns_qty, v.preturns_cost, v.preturns_value,
    v.adjm_qty, v.adjm_cost, v.adjm_value,
    v.adjw_qty, v.adjw_cost, v.adjw_value,
    v.adjc_qty, v.adjc_cost, v.adjc_value,
    v.adjt_qty, v.adjt_cost, v.adjt_value,
    v.adjv_qty, v.adjv_cost, v.adjv_value,
    v.stockob_qty, v.stockob_cost, v.stockob_value,
    v.fp_stockob_qty, v.fp_stockob_cost, v.fp_stockob_value,
    v.md_stockob_qty, v.md_stockob_cost, v.md_stockob_value,
    v.tm_stockob_qty, v.tm_stockob_cost, v.tm_stockob_value,
    v.stockcl_qty, v.stockcl_cost, v.stockcl_value,
    v.fp_stockcl_qty, v.fp_stockcl_cost, v.fp_stockcl_value,
    v.md_stockcl_qty, v.md_stockcl_cost, v.md_stockcl_value,
    v.se_stockcl_qty, v.tm_stockcl_cost, v.tm_stockcl_value,
    v.tm_stockcl_qty, v.se_stockcl_cost, v.se_stockcl_value,
    v.co_stockcl_qty, v.co_stockcl_cost, v.co_stockcl_value,
    v.currency, v.exrate1, v.exrate2, v.exrate3, v.exrate4, v.exrate5,
    stime);

  • Strange: Conditional Error in Intermedia Text Index Creation

    Hi All,
    I am facing a strange error while creating the Intermedia Text index on 8.1.6 release for NT 4.0.
    I have one database instance installed on the server. When i connect to Oracle through SQL plus as: connect username/password;
    The index creation works fine!
    But, if i connect using: username/password@servicename;
    The index creation does not work!
    The following error occurs.
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000:intermedia Text error:
    ORA-50704:Net8 listener is not running or cannot start external procedures
    ORA-28575:unable to open RPC connection to external procedure agent
    ORA-12154:TNS:could not resolve service name
    ORA-06512:at "CTXSYS.DRUE", line 126
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 54
    ORA-06512:at line 1
    Could anyone please help as to why it works without when connected without the service name but not otherwise?
    Thanking you in advance!
    Thanks and Regards
    Anurag Agarwal

    Hi All,
    I am facing a strange error while creating the Intermedia Text index on 8.1.6 release for NT 4.0.
    I have one database instance installed on the server. When i connect to Oracle through SQL plus as: connect username/password;
    The index creation works fine!
    But, if i connect using: username/password@servicename;
    The index creation does not work!
    The following error occurs.
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-20000:intermedia Text error:
    ORA-50704:Net8 listener is not running or cannot start external procedures
    ORA-28575:unable to open RPC connection to external procedure agent
    ORA-12154:TNS:could not resolve service name
    ORA-06512:at "CTXSYS.DRUE", line 126
    ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 54
    ORA-06512:at line 1
    Could anyone please help as to why it works without when connected without the service name but not otherwise?
    Thanking you in advance!
    Thanks and Regards
    Anurag Agarwal

Maybe you are looking for

  • How can I copy the format of one sentence or paragraph onto another sentence or paragraph?

    When I copy and paste a section from one article to another, I want to change the format of the imported section to match the rest of the article. In Outlook or eM Client, I would use the paintbrush icon for this. How do I copy the format of a sectio

  • Ellipse not working in few document libraries in SharePoint 2013

    I have few document libraries with 500+ documents. I am not able to edit the properties using ellipse. I tried on all browsers and on all version. It is working for other document libraries

  • [SOLVED] Huge tray icons in KDE

    Until the other day, my tray icons looked like this (good): http://i.imgur.com/o0v5hVd.png Now, it looks like this (bad): http://i.imgur.com/FD77IWF.png I tried downgrading some kde packages, but couldn't find the one responsible for the change. Has

  • Yellow photos in low light

    My pictures taken in low light (indoor), just one small bulb for example gets yellowish. I tried to change the white balance but for no good. Is it just something I have to accept or what?

  • Printing to pdf question CS5.5 Windows

    I am on a PC - Windows 7 using CS5.5. - I have created a piece and printed to a pdf. - When the person on the other end prints out the margins are all off. I realize and pointed out they are using an office printer, not a high end printer. The print