Solved : Unexpected Behaviour

Hello Everyone,
Can someone let me know what is wrong in the Code <br>below...
<br>
<br>
I have a Procedure which hs a cursor...<br><br>
CURSOR cDescription IS SELECT description, name,<br> expiry_date, course_type<br>
FROM COURSE_LIST<br>
WHERE COURSE_ID = pCourse;<br>
<br>
information cDescription%ROWTYPE;<br>
<br>
<br>
Later in the body I have something like this...<br><br>
OPEN cDescription;<br>
FETCH cDescription INTO information; <br>
IF cDescription%FOUND THEN<br>
<br>
htp.p('<table align=center <br>cellPadding=1 cellspacing=2 border=0>');<br>
htp.p('<tr>');<br>
htp.p('<br>');<br>
htp.p('</tr>'); <br>
htp.p('<tr>');<br>
htp.p('<td class=data-table-item <br>align=left>Course ID</td>');<br>
htp.p('<td class=data-table-item <br>align=left> '); <br>
htp.p('<input type="text" <br>name="pCID" size="30" disabled value = ' || pCourse <br>|| ' >');<br>
htp.p('</td>');<br>
htp.p('</tr>');<br>
<br>
htp.p('<tr>');<br>
htp.p('<td class=data-table-item <br>align=left>Course Name</td>');<br>
htp.p('<td class=data-table-item <br>align=left> '); <br>
htp.p('<input type="text" <br>name="pCName" size="30" value = ' || <br>information.name || '>'); <br>
htp.p('</td>');<br>
htp.p('</tr>');<br>
<br>
htp.p('</table>');<br>
END IF;<br>
CLOSE cDescription;<br>
<br>
<br>
The code doesnt show anything on the screen...I tried <br>debugging and it goes into the loop, it find one row <br>and still dont display anything......<br>
<br>
Please let me know what should I change to make this <br>work..<br>
Thanks,<br>
Harsimrat
Message was edited by:
Harsimrat
Message was edited by:
Harsimrat

Solved...
Thanks,
Harsimrat

Similar Messages

  • Unexpected behaviour upon pressing the 'Enter' key on dialog screen

    Hi.
    I have two dialog screens that exhibit unexpected behaviour when i pressed the 'Enter' key.
    Screen 1: When I pressed the 'Enter' key, the focus shifted to another input field and the content of the previous input field is cleared. The thing is, I did not have any codes in PAI for 'Enter'. Why is this happening?
    Screen 2: On load, some of the fields on this screen will be disabled. However, when I pressed the 'Enter' key, all the disabled fields become enabled. Again, I did not have any codes that handle the 'Enter' key in PAI. Why is this happening?
    Any help is appreciated.

    Hi Atish.
    Yes, I have used CHAIN... END CHAIN.
    I thought that CHAIN... END CHAIN allows my input fields to be re-activated after an error message is displayed.
    How would CHAIN... END CHAIN cause the unexpected behaviour?
    Thanks.

  • SAP Personas: An unexpected behaviour has been detected and you have been disconnected – please log in again.

    Hallo everyone,
    We are installing Personas and facing several challenges.
    Personas 2 SP02 was installed according to instructions of Note '1848339 - Installation and Upgrade note for Personas' and configured according to the Config Guide v1.3 (rel. May 2014). The referenced notes were also applied as well as the 'How to config - FAQ' blog by Sushant.
    We are able to log on and execute transactions and perform activities successfully (e.g. SE80, SPRO, KB15, etc.).
    When trying to copy a screen the following error appears: 'An unexpected behaviour has been detected and you have been disconnected - please log in again.'
    Thereafter one can simply continue executing transactions without having to log in again.
    Please see the download of the error attached as per blog: SAP Screen Personas Support Tips – client side logging
    The HAR is unfortunately too large to attach. Are there any alternatives?
    Thank you in advance for you assistance!
    Kind regards,
    Daniel
    Message was edited by: Daniel K

    Hi,
    I have never worked on SAP PERSONA but you can try below things
    1)try to use different user or J2ee_admin since it might be same user multiple session case
    2) Try with different browser since plugins can behave unexpectedly
    3)Make entry in host file also
    4) check dev_icm logs
    5) check on ABAP side for dumps in ST22
    Warm Regards,
    Sumit

  • Unexpected behaviour of Composer with adf-config

    This is a part of my adf-config.xml file:
    <cust:customizableComponentsSecurity xmlns="http://xmlns.oracle.com/adf/faces/customizable/config">
    <cust:enableSecurity value="true"/>
    <cust:actionsCategory>
    <cust:actionCategory name="personalizeActionsCategory" value="#{securityContext.userName eq 'weblogic' ? 'true' : 'false'}"/>
    <cust:actionCategory name="customizeActionsCategory" value="#{securityContext.userName eq 'weblogic' ? 'true' : 'false'}"/>
    </cust:actionsCategory>
    </cust:customizableComponentsSecurity>
    Section upon sets a simple EL to provide security restrictions for user in Composer. When I deploy an application and login at first time everything works fine. But when I log in with user other than 'weblogic' unexpected behaviour appears. After that even 'weblogic' user can not access to personalization and customization options anymore.
    So, the question is - is it a really unexpected behaviour, bug or I missed something? Here is a pretty clear and simple manual that I followed to try to make it work: http://docs.oracle.com/cd/E29597_01/webcenter.1111/e25595/jpsdg_page_editor_security.htm#autoId18
    Edited by: Igor_Petrov on 22.02.2013 5:56
    Edited by: Igor_Petrov on 22.02.2013 5:57

    More information: I tried rebuild again. The Messages folder now has 20418 entries and takes 7.54 Gb of disk space.
    I searched using Spotlight for a unique term which appears in one of the messages and found 8 instances of it. All are the same message, but are separate .emlx files.
    This is getting crazy ...

  • [SOLVED] Strange behaviour of Query-by-Example (QBE) fields

    Hello,
    Jdev 11g TP3.
    We have a QBE-Block with input fields.
    Follwing steps are performed:
    1) Change to find mode: #{bindings.Find.execute}
    2) Enter search criteria into the fields
    3) execute query: #{bindings.Execute.execute}
    4) change to find mode again --> previously entered search criterias are shown --> OK
    5) clear the search criteria in all fields
    6) execute query again
    7) PROBLEM: query is executed with the OLD search criteria again.
    If we change into query mode again, the OLD search criterias are shown again
    (BUT not for ALL fields).
    8) Even wildcards (* or %) doesn't change the situation.
    But it's possible to enter a different (but not empty) search criteria into the field.
    Details:
    =====
    For some of the QBE-Fields the search criteria can be cleared but for some of them not.
    Differences between this fields:
    a) mandatory fields (also part of the key in the view model and NOT NULL in DB) --> criteria can't be cleared
    b) non-mandatory fields (also not part of the view model and NULL-able in DB) --> criteria can be cleared
    I tried to change one of the mandatory fields to non-mandatory and to be not part of the key in the view model but behaviour doesn't change?
    Can anybody confirm this behaviour as bug or is there a mistake on my side?
    BR
    Peter
    Message was edited by:
    hofespet

    Seems to be solved in TP4.
    br
    Peter

  • [solved] Unexpected EOF error while reading

    Hi
    I created a bootable jumpstart DVD for x86, and erverything works up to the extract of the flash archive.
    During the extract, I receive this error:
    Extracted 2046.00 MB ( 92% of 2208.35 MB archive)
    Extracted 2047.00 MB ( 92% of 2208.35 MB archive)
    ERROR: Unexpected EOF error while reading (/cdrom/latest_archive)
    ERROR: Could not extract Flash archive
    ERROR: Flash installation failed
    Solaris installation program exited.
    The size of the archive on the DVD is ok.
    Any Idea?

    I solved it like this:
    - added the "-I" option to flar when the archive get created.
    - added the "-x /usr" option to flar to skip the /usr filesystem.
    - created and compressed a fs dump of /usr which I placed on the dvd.
    - added the ufsrestore of /usr to my jumpstart finish script.
    With this I got files smaller than 2gb on my isofs.
    --- Joris Vuffray

  • SimpleDateFormat unexpected behaviour

    Hi everybody,
    i'm facing an issue which is mainly due to my incomprehension of the inner mechanisms of date parsing in Java. I would like to parse a date from an input string with a specific pattern, but some inputs match this pattern when i expect them not to. Let me explain it through an example:
    public class DateIssue {
         public static void main(String[] args) {
              SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
              sdf.setLenient(false);
              try {
                   System.out.println(sdf.parse("10/02/20001"));
              } catch (ParseException pe) {
                   pe.printStackTrace();
    }Here i'm expecting a 4 digit year, but when i give "20001" as a year, the simpledateformat parses it just fine, and no exception is thrown. I checked the API where i found:
    Year:  If the formatter's Calendar is the Gregorian calendar, the following rules are applied.
    * For formatting, if the number of pattern letters is 2, the year is truncated to 2 digits; otherwise it is interpreted as a number.
    * For parsing, if the number of pattern letters is more than 2, the year is interpreted literally, regardless of the number of digits. So using the pattern "MM/dd/yyyy", "01/11/12" parses to Jan 11, 12 A.D.
    * For parsing with the abbreviated year pattern ("y" or "yy"), SimpleDateFormat must interpret the abbreviated year relative to some century. It does this by adjusting dates to be within 80 years before and 20 years after the time the SimpleDateFormat instance is created. For example, using a pattern of "MM/dd/yy" and a SimpleDateFormat instance created on Jan 1, 1997, the string "01/11/12" would be interpreted as Jan 11, 2012 while the string "05/04/64" would be interpreted as May 4, 1964. During parsing, only strings consisting of exactly two digits, as defined by Character.isDigit(char), will be parsed into the default century. Any other numeric string, such as a one digit string, a three or more digit string, or a two digit string that isn't all digits (for example, "-1"), is interpreted literally. So "01/02/3" or "01/02/003" are parsed, using the same pattern, as Jan 2, 3 AD. Likewise, "01/02/-3" is parsed as Jan 2, 4 BC.
    Otherwise, calendar system specific forms are applied. For both formatting and parsing, if the number of pattern letters is 4 or more, a calendar specific long form is used. Otherwise, a calendar specific short or abbreviated form is used.
    I suspect the following excerpt:
    For parsing, if the number of pattern letters is more than 2, the year is interpreted literally,
    to be responsible for this behaviour, but i thought parsing with lenient would avoid such a "mistake", and throw an exception because of the wrong number of digits. What is the best way to check that the year is exactly four digit long? Do I have to use string.matches() or a Pattern object just for this?
    Thanks a lot
    Edited by: calvino_ind on Aug 30, 2009 1:51 PM

    See this recent, and related thread: [Unexpected SimpleDateFormat behavior|http://forums.sun.com/thread.jspa?threadID=5404776&messageID=10802339]
    The behavior is unexpected intuitively but seems to follow the API contract. The number of digits apparently is only used to break up consecutive fields.

  • [SOLVED] Unexpected reset of communication controller

    Hallo,
    I have here a Gigabyte GA-Z77-DS3H board and today I updated its BIOS to the newest version (because I have some seldom freezes which might come from my Ivybridge and I just wanted to exclude other possibilities).
    However, since then dmesg logs the following message every 30s:
    mei 0000:00:16.0: unexpected reset.
    If I interpret this right this refers to PCI address 00:16 which is - according to lspci
    00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
    Does anybody know what this is telling me? Should I worry (hardware failure) or can I ignore it? What should I do to further investigate the cause of this?
    Thanks in advance!
    Last edited by guitar76 (2012-08-25 08:08:00)

    Well, this again was clearly a case of "think and WAIT before you write":
    I just checked the gigabyte website and behold: a new BIOS version was released (probably it has been released some days ago, but it didn't appear on the German website) which solved the issue.
    So have a nice day...

  • Unexpected behaviour on SharePoint 2013 and task sync

    hello, i deleted the work management service application due to issues with try to get my tasks to sync, as i deleted it the "sync to outlook" had changed to "Connect to outlook" on my tasks area and i can now sync tasks to my outlook.
    i was under in the impression that the work management service application was needed for tasks sync to occur the reason why i deleted it was due to the error,
    We weren't able to sync your tasks. This could be because your mailbox is on an Exchange server that isn't supported for syncing tasks. Please contact your administrator for more help.
    sync turned off.
    i couldn't make any of the solutions work to fix my task sync errors.
    any one help me with some insight into this? and ideally the original error i was getting
    many thanks
    BPDZenith

    The error message you are getting would suggest that you don't have Exchange 2013.  The default task sync only works with Exchange 2013.  But there is a farm level feature that can be turned off to go back to syncing tasks the way it worked with
    Exchange 2010.  Then you can go to a particular task list and use the "Connect to Outlook" button in the ribbon to sync that list with Outlook.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Extending class gives unexpected behaviour

    Hello forumusers
    I am making my own table model by extending DefaultTableModel. When calling insertRow(int, Object[]) in my own code, super.insertRow calls insertRow(int, Vector) in my code instead of in the superclass. I didn't think that the superclass would hold any reference to my class and when the superclass calls insertRow(int, Vector) it would be a method in the DefaultTableModel class.
    Please see the code below. Can anyone explain this behaviour to me?
    import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    class TableModelTest {
      public TableModelTest() {
        BundleTableModel m = new BundleTableModel(
            new String[][]{{"aaa", "aab", "aba"}, {"ccc", "cca", "cac"}},
            new String [] {"header0", "header1", "header2"});
        m.insertRow(1, new String[]{"BBB", "BBA", "BAB"});
      public static void main(String[] args) {
        TableModelTest dut = new TableModelTest();
      public class BundleTableModel extends DefaultTableModel {
        public BundleTableModel(String[][] dataIds, String[] columnNameIds) {
          super();
          setColumnCount(columnNameIds.length);
          setRowCount(dataIds.length);
          // My own code comes here
        public void insertRow(int row, Object[] rowData) {
          System.out.println("insertRow(int, Object[] called");
          super.insertRow(row, rowData);
          // My own code comes here
        public void insertRow(int row, Vector rowData) {
          System.out.println("insertRow(int, Vector) called");
          super.insertRow(row, rowData);
          // My own code comes here
    }

    Lesson learned.
    ejp was correct from the beginning.
    JLS section 8.4.10.6 'Large Example of Overriding' explains:
    "The critical point about overriding in this example is that the method putstr, which is declared in class BufferOutput, invokes the putchar method defined by the *current object this*, which is not necessarily the putchar method declared in class BufferOutput.
    This allows a subclass of BufferOutput to change the behavior of the putstr method without redefining it."
    Thanks for all comments.

  • SOLVED:Strange behaviour:request shows results in Answers not in dashboard

    Hi all,
    I've come across somethings very strange, which I know has to do with the lowest level of detail of my organisation hierarchy (and the keys used at that level), but I cant understand why its doing the following:
    I have a table in a dashboard that can receive 'is prompted' filter values from a prompt on the same dashboard. When i created this request in answers, for test reasons i gave it values for a "centre" (lowest level of the organization hierarchy), and it displays resultos for my metrics.
    Now I place this request on a dashboard. I have removed my manual test filters, and left the four organization columns of the request as "is prompted", the lowest of these being the centre value. Now in the dashboard, i decide to enter a value directly for the centre dropdown (same value as i previously tested) in my prompt...i get no results found!!!
    The lowest level of this prompt has a key made of two atributes (center and center code), this allows me to "drill down" from the centre to the centre code, although centre code is at the same level. If i remove the drilldown capability, the problem is solved...im not quite sure why.
    Message was edited by:
    zjac

    The problem was with the actual data. WHen analyzing the query that was being done, i realised that one of the keys (the centre name) was using a text field that has spaces after the name of the centre (god knows why), so using a trim resolved the issue.
    I guess the other configuration was using the centre id which was not encountering the above problem.

  • Regexp_substr unexpected behaviour

    While trying to come up with a constraint to check for correct RGB color codes
    (RvalueGvalueBvalue) where the value is between 0 and 255
    I saw the following:
    database used: Oracle Database 10g Express Edition Release 10.2.0.1.0
    CREATE TABLE test
    (color varchar2(12)
    ,status varchar2(1)
    insert into test
    values ('R2G2B2','G')
    insert into test
    values ('R22G22B22','G')
    insert into test
    values ('R222G222B222','G')
    insert into test
    values ('R300G2B2','F')
    insert into test
    values ('R300G256B2','F')
    insert into test
    values ('R300G256B256','F')
    select t.status
         , t.color
         , REGEXP_SUBSTR(t.color,'^R(\d{1,2}|1\d{2}|2[0-4]\d{1}|25[0-5])') red
         , REGEXP_SUBSTR(t.color,'G(\d{1,2}|1\d{2}|2[0-4]\d{1}|25[0-5])') green
         , REGEXP_SUBSTR(t.color,'B(\d{1,2}|1\d{2}|2[0-4]\d{1}|25[0-5])$') blue
         , REGEXP_SUBSTR(t.color,'^R(\d{1,2}|1\d{2}|2[0-4]\d{1}|25[0-5])G(\d{1,2}|1\d{2}|2[0-4]\d{1}|25[0-5])B(\d{1,2}|1\d{2}|2[0-4]\d{1}|25[0-5])$','1','1','i') total
    from test t
    order by redoutput
    status   color        red    green    blue  total
      G      R2G2B2       R2      G2       B2    R2G2B2
      G      R22G22B22    R22     G22      B22   R22G22B22
      G      R222G222B222 R22     G22      B222  R222G222B222
      F      R300G2B2     R30     G2       B2   
      F      R300G300B2   R30     G30      B2
      F      R300G300B300 R30     G30Expected output
    status   color        red    green    blue  total
      G      R2G2B2       R2      G2       B2    R2G2B2
      G      R22G22B22    R22     G22      B22   R22G22B22
      G      R222G222B222 R222    G222     B222  R222G222B222
      F      R300G2B2             G2       B2   
      F      R300G300B2                    B2
      F      R300G300B300 Both the total and blue colums have the output as expected
    but the red and the green give a output with a maximum of 2 digits instead of 3
    even when the string should not match (300 > 255).
    I have read the information about regular expressions in the Application Developer's Guide - Fundamentals and SQL Reference but neither explain above behaviour
    Can someone explain why this is happening?
    Or give a hint of how to correct the select statement in such a way that results are like the expected output?

    First thanks everybody for their response.
    I was wrong in assuming that R300G0B0 with above mentioned regular expression for red should return null instate of R30 because 30 is on the range 0-255 I didn't say that the expression should take all the digits into account.
    Akeeti Jyuuzou's solutions is doing just that with anchoring the red to the green and the green to the blue and the blue to the end of the line. In the blow example I have anchored the red to any non digit character.
    SQL> select t.kleur color
      2       , REGEXP_SUBSTR(t.kleur,'^R(25[0-5]|2[0-4]\d{1}|1\d{2}|\d{1,2})\D') red
      3       , REGEXP_SUBSTR(t.kleur,'G(\d{1,2}|1\d{2}|2[0-4]\d{1}|25[0-5])') green
      4       , REGEXP_SUBSTR(t.kleur,'B(\d{1,2}|1\d{2}|2[0-4]\d{1}|25[0-5])$') blue
      5       , REGEXP_SUBSTR(t.kleur,'^R(\d{1,2}|1\d{2}|2[0-4]\d{1}|25[0-5])G(\d{1,2}|1\d{2}|2[0-4]\d{1}|25[0-5])B(\d{1,2}|1\d{2}|2[0-4]\d{1}|25[0-5])$','1','1','i') total
      6  from test t
      7  /
    COLOR                 RED   GREEN   BLUE    TOTAL
    R300G0B300                   G0                                                                                                                                                               
    R0G0B20X            R0G    G0                                                                                                                                                               
    SQL Slow moe is indeed right that the alterations are read form left to right and is stopped by the first correct pattern as is shown below.
    In below example I have turned around the alterations for the red but left the green to see the difference
    SQL> select t.kleur color
      2       , REGEXP_SUBSTR(t.kleur,'^R(25[012345]|2[01234]\d{1}|1\d{2}|\d{1,2})') red
      3       , REGEXP_SUBSTR(t.kleur,'G(\d{1,2}|1\d{2}|2[01234]\d{1}|25[012345])') green
      4       , REGEXP_SUBSTR(t.kleur,'B(\d{1,2}|1\d{2}|2[01234]\d{1}|25[012345])$') blue
      5       , REGEXP_SUBSTR(t.kleur,'^R(\d{1,2}|1\d{2}|2[01234]\d{1}|25[012345])G(\d{1,2}|1\d{2}|2[01234]\d{1}|25[012345])B(\d{1,2}|1\d{2}|2[01234]\d{1}|25[012345])$','1','1','i') total
      6  from test t
      7  order by id
      8  /
    COLOR                   RED     GREEN     BLUE     TOTAL
    R222G222B222        R222     G22         B222       R222G222B222
                                                                                                                                                                 

  • Unexpected behaviour with my navigation buttons

    Hi Guys,
    I've just noticed some strange behaviour for my nav buttons in a project I've recently created. My project uses click boxes to naviage and has a Home Button which jumps from any slide (aside from Question Slides) to the first slide in the project. A next and back click box which are all set to go to the next slide / go to previous slide...
    All works fine and as expected (i.e as soon as I click on the next button it goes to the next slide regardless if audio is still playing of the if the slide has finished playing) until say I get two or three pages in to the project and click the home button. It goes to the first page as expected where I click a go to next slide click box (this one takes a few seconds to appear on this slide) which immediatly goes to the next slide. Here is where my problems start... I click on next and I hear the click sound but it refuses to skip to the next slide - It plays the whole slide (50 seconds worth of audio) before it will go to the next slide...
    For the life of me I cannot see why it would do this.
    The click box is set to infinite attempts.
    Anyone ever had a similar issue???
    Thanks
    JT

    Try fiddling with your Quiz: Settings > Required options to see if they make a difference.

  • [SOLVED] Unexpected problems after installing systemd

    Hi there,
    Since I read that Arch is going to start using systemd I decided to install it. I followed the systemd wiki article (https://wiki.archlinux.org/index.php/Sy … g_to_start) and at first sight everything seemed OK and I didn't have much problems with it. My only serious problem was that the network-manager plasmoid in KDE was not working properly - it stated that Network Manager was not started. After searching the forums I found out that the problem was due to my pam login file for lightdm not configured properly and I managed to fix the problem. However after several days of use I found out the following additional problems:
    1. Removable drives not working - before usb flash drives and sd cards were automounted by KDE when i inserted them. Now nothing happens (I tested with a usb flash drive and an sd memory card).
    2. My laptop's touchpad feels very slugish and scroll is not working. After I tried to check the touchpad settings in the KDE control centre I found out while all the touchpad settings are present, they are greyed out and can't be changed.
    3. Sound is extremely choppy in wine games. In native linux games (Faster Than Light for example) it is OK. It is also OK in other native linux applications like clementine and mplayer. I am using pulseaudio which i've set up in accordance with the pulseaudio wiki article.
    I tried to recall any problems I may have had while setting up systemd and the onlything ordinary i can thing about was that when i tried to do "systemctl enable dbus.service" (because the systemd wiki article advised me to "systemctl enable" all daemons listed in my former rc.conf) I got the following output: "The unit files have no [Install] section. They are not meant to be enabled using systemctl.". On the other hand the dbus.service seems to be running just fine:
    "dbus.service                                 loaded active running       D-Bus System Message Bus"
    Has anyone encounter similar problems when using systemd?
    Best regards!
    Last edited by hellfire[bg] (2012-10-14 19:36:59)

    I had some time to tweak my system and i have an update on my problems - the 1st and 2nd problems were solved by reverting back to initscripts and setting up systemd again. I can swear i followed the same instructions (on the arch linux wiki page) as before but somehow after it did it those problems disappeared. I am now running a pure systemd system and everything appears to be OK. Regarding the 3rd problem it turned out that it was a pulseaudio issue. After I set up pulseaudio initialy I checked wine and it was running fine but apparently I have tweaked my pulseaudio setup since then and this broke wine. Systemd being the biggest change to my system before i detected the problem, i assumed that it was the reaseon. However it seems that pulseaudio was the culprit and after a little tweking with its configuration file it seems to be OK now. If anyone has the problem, this setting described in the arc wiki was the reason for my problem - https://wiki.archlinux.org/index.php/Pu … _crackling . Using the default set up (as opposed to the option described in the wiki) solved my problem.
    Pse, here's the output of what you requested, ran as a normal user (in pastebin):
    http://pastebin.com/w5A1F9jf
    Last edited by hellfire[bg] (2012-10-14 19:39:30)

  • MERGE: unexpected behaviour, oracle 11g

    Hi all,
    I'm facing a strange behaviour with Merge statement.
    In particular in doc Oracle we read:
    "MERGE is a deterministic statement. That is, you +*cannot update*+ the same row of the target table multiple times in the same MERGE statement."
    My source table has two equal key rows and the "merge statement" merge the row with the last value in the source table.
    How Is this possible ?
    thank you.

    VERSION:
    SQL> select * from v$version
      2  ;
    BANNER
    Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL>MERGE, in a dynamic context:
    v_sql :=
    'MERGE INTO dwh_cdl.dim_cost_hierarchy dim
             USING (SELECT DISTINCT TRIM (item_code) id_item,
                                    NVL (TRIM (CATEGORY), ''ND'') CATEGORY,
                                    r1.r1_code r_1,
                                    r2.r2_code r_2,
                                    r3.r3_code r_3,
                                    r4.r4_code r_4,
                                    w.item_description desc_item
                                            FROM '
                                            || v_wrk
                                            || ' w INNER JOIN dwh_cdl.lu_r1 r1
                                                 ON (w.r_1 = r1.r1_code)
                                                 INNER JOIN dwh_cdl.lu_r2 r2
                                                 ON (w.r_2 = r2.r2_code)
                                                 INNER JOIN dwh_cdl.lu_r3 r3
                                                 ON (w.r_3 = r3.r3_code)
                                                 INNER JOIN dwh_cdl.lu_r4 r4
                                                 ON (w.r_4 = r4.r4_code)
                                    ) wrk
             ON (    dim.id_item = wrk.id_item
                 AND dim.category = wrk.category
                 AND dim.r1_code = wrk.r_1
                 AND dim.r2_code = wrk.r_2
                 AND dim.r3_code = wrk.r_3
                 AND dim.r4_code = wrk.r_4
                 AND dim.wid_country = '
                || pkg_global.v_country
                || ')
             WHEN MATCHED THEN
                UPDATE
                   SET dim.desc_item = wrk.desc_item
             WHEN NOT MATCHED THEN
                INSERT (wid_item, id_item, CATEGORY, desc_item, type_item,
                        flag_valid, r1_code, r2_code, r3_code, r4_code,
                        wid_country, date_in)
                VALUES (pkg_util.get_next_val (''DIM_COST_HIERARCHY''), wrk.id_item,
                        wrk.CATEGORY, wrk.desc_item, NULL, 1, r_1, r_2, r_3, r_4,
                || pkg_global.v_country
                || ', SYSDATE)';
    EXECUTE IMMEDIATE v_sql;The USING table has duplicate key rows. So when join with "dim_cost_hierarchy" Oracle should issue error ! But, it doesn't !
    It gets the last one row value.

Maybe you are looking for

  • Link problem with Fireworks CS5 - net::ERR_FILE_NOT_FOUND

    Hi, I'm having trouble with the hotspot links in Fireworks CS5. When I've added the links I want and click F12 to preview in Chrome, it loads the page without problems. But when I click on one of the links I get the following message: Webpage cannot

  • Error in BW Chainprocess

    we are runing a job in Redwood , it is callig BW Chain, the job is going on waiting for very long time, as BW Chain call is on REMOTE status, at last it failing with the following error: ORA-20000: At least one child failed ORA-06512: at "RSI.RSIEXEC

  • After my Acrobat X (CS5- Mac) started crashing I tried to re-install it.

    After my Acrobat X (CS5- Mac) started crashing I tried to re-install it. I keep getting this error message. WARNING: DS013: Payload {4BD61514-FB3F-40DA-A2EF-506D9A4AD9DE} Digital Publishing 26.0.0.0 is already installed and the session payload {99BDA

  • Exception in  useOneAsMany function

    Hi Experts, I have a scenario IDoc (ORDERS05) to cXML. to map the E1CUCFG (SO configuration data) to CXML.I have used the below mapping Please click the link: [http://www.flickr.com/photos/25429360@N07/2466275133/] Everything works fine, but if a IDo

  • Has anyone experienced graphical problems and high power consumption while hibernating after upgrading to Mavericks?

    Since I've upgraded to OS 10.9 my Macbook Pro 2.4GHz started doing strange things. It consumes large amounts of Power. The battery draines much faster than before in normal usage and even worse... it consumes quite a bit power while its alseep. A ful