Previous (Self) not working

Guys,
I know this is very simple, but I am stuck at one point.
I am trying to implement Dense Rank function in my WebI report. I am using the below formula.
  =If([Ranking] = Previous([Ranking]) ; [Ranking];(Previous(Self)+1)). Previous (Self) is not taking the previous value, rather it is considering as 0. Please help me with this.

Hi Sathish,
Running Count gives me sequential numbers. I am trying to achieve the below (Dense Rank column).
Ranking
Dense Rank
1
1
2
2
3
3
3
3
5
4
6
5
7
6
7
6
7
6
8
7

Similar Messages

  • Web Gallery, previous/ next not working consistently

    First time I've seen this:    next and previously are not working good. Some work in the gallery, some don't.
    Reboot Firefox, some different ones work, some dont. It's worrisome. I'm sending this to people- any tips?

    .Mac email can be set up two different ways on the iPhone. For "Send to Web Gallery" button to appear when clicking on the action button while viewing a photo, you must have your .Mac email set up as IMAP. This is the default setup for a .Mac email account.
    If you take the time to manually set up your .Mac email as POP, then you will not have the "Send to Web Gallery" option and you will be unable to successfully email into your web gallery even if all else is set up correctly.
    To check to see how you have .Mac email set up on your iPhone, go to the Home Screen, tap Settings, tap Mail, tap your .Mac account name, tap Advanced, move down on the page, and make sure you see "IMAP Path Prefix" setting (it can be blank and does not need to be changed). If the "IMAP Path Prefix" is there, then you do indeed have your .Mac email set up as IMAP on your iPhone.
    If you do have it set up as a POP account, you can delete that mail account by selecting the red Delete Account button when viewing your email account as listed in Settings.
    To add your .Mac email account as an IMAP account, from the Home Screen, tap Settings, tap Mail, tap Add Account..., tap .Mac, and fill out the fields with your information, tap Save and it will verify access to your .Mac email account.

  • User Login - go to previous URL not working

    Hi
    I have a user login set up using the DW server behaviour.
    The problem I have is that the redirect to the previous url doesnt work and always directs a successful login to the default successful login page.
    The problem seems to revolve around this part of the code:
                    if (isset($_SESSION['PrevUrl']) && FALSE) {
                        $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
                    header("Location: " . $MM_redirectLoginSuccess);
    and in particular the use of the && FALSE check.  I can see from my debugger that the value of $_SESSION['PrevUrl'] is properly set to the previous url.  If I remove the && FALSE check the login works as I would expect and redirects to the previous URL.  However, as this is 'out of the box' DW code I am concerned in case removing the && FALSE check may be doing some harm.  I have to admit I dont understand the logic of what the && FALSE part of the IF statement is actually checking for.
    Any advice and/or reassurance that by removing the && FALSE is not doing any harm or exposing me to any risks would be appreciated.
    Thanks

    session_start() is set
    As I step through the code and watch the variables I can see that the value of $_SESSION['PrevUrl'] is equal to the previous url but $MM_redirectLoginSuccess remains as the default success page.
    If I remove the && FALSE element from the IF statement, the value of MM_redirectLoginSuccess is changed to the the value of $_SESSION['PrevUrl'], which is what I want.
    So my question is, what is the && FALSE bit doing and why is it there and do I need it?

  • Searching .php files - previous suggestions not working

    I'm having a problem getting previous suggestions to work in indexing my php files.
    I do development in and out of my sites folder, but I can't get any of my php files' content to index. I've added this line to the source code importer:
    <string>public.php-script</string>
    and I've forced the reindex of those files with:
    mdimport -r /Library/Spotlight/SourceCode.mdimporter
    forced the indexing of a target folder with:
    mdimport -f /dir
    I've even forced the import of a specific folder with the importer:
    mdimport -r /Library/Spotlight/SourceCode.mdimporter -f /dir
    I simply cannot get Spotlight to look into these files. I get them by name, but not by content.

    Check out:
    http://www.macosxhints.com/article.php?story=20050514182520714

  • ActionScript 2 issues: previous button not working

    Hello,
    I am trying to create a slideshow in Flash CS4 using ActionScript 2.
    I have imported "pause" and "play" buttons from the libraries, and I have created "next" and "previous" buttons by using the PolyStar tool.
    Here is my problem: The "previous" button is not working. However, the other buttons (even the "next" button, which only really has the opposite code) do work.
    I am writing all of my code in the frames, which probably isn't the best idea, but it would be hard for me to change now.
    Code (an example code frame)(currently on the 1st frame):
    prev.onPress = function(){
    gotoAndStop("14");
    begin.onPress = function(){
    play();
    pause.onPress = function(){
    stop();
    next.onPress = function(){
    gotoAndStop("2");
    previous.onPress = function(){
    gotoAndStop("14");
    "prev" is an instance of "previous". "begin", "next", and "pause", are instances of a play button, "next", and a pause button. I am using frame labels that go from "1" to "14".
    What am I doing wrong?
    feffer1218

    Thanks for your advice, but it didn't work.
    1. I changed all of my frame labels so that they have the letter "p" in front of all of them. (ex: "p1" instead of "1")
    2. I commented out the "previous.onPress" code.
    2 examples of code:
    //p1 (first photo)
    prev.onPress = function(){
        gotoAndStop("p14");
    begin.onPress = function(){
        play();
    pause.onPress = function(){
        stop();
    next.onPress = function(){
        gotoAndStop("p2");
    /*previous.onPress = function(){
        gotoAndStop("14");
    //p2 (second photo)
    begin.onPress = function(){
        play();
    pause.onPress = function(){
        stop();
    next.onPress = function(){
        gotoAndStop("p3");
    prev.onPress = function(){
            gotoAndStop("p1");
    I don't know what I'm doing wrong! The Properties window says that "prev" is an "instance of: previous."
    Any ideas? Thanks for the attempt, though.
    feffer1218

  • Next-Previous Do not work Properly for lengthly dynamic Where Clause

    I have created a View object using Expert Query mode
    with following Query:
    SELECT LIC_SYS_ID,
    LIC_NAME,
    TERRITORIES,
    LANGUAGES,
    MEDIA,
    SEGMENT_NAME,
    CHANNELS,
    ACTIVITY_CD,
    LS.LIC_SHORT_NAME,
    LS.LIC_AKA_NAME
    FROM V_LICENSEE_SEARCH LS
    ORDER BY LIC_NAME
    Then at run time the following Where Clause staments get added by in JSP based on the users criteria
    wClause = "(ACTIVITY_CD = '" + activityStatus + "')"
    + " AND " +
    "(LIC_NAME like '" + licenseeName + "%' OR " +
    " LIC_SHORT_NAME like '" + licenseeName + "%' OR " +
    " LIC_AKA_NAME like '" + licenseeName + "%' ) "
    In this case the DataScroller does not work properly It DataTable traves only one setp when I click the "Next" link, But if I use the Drop down list of the Scroller its works fine.
    Secondly the "Next" "Previous" links of the DataScroller work fine if I use only one stmt in the WhereClause ex: "ACTIVITY_CD LIKE 'A%'".
    Can anybody help me with this, Is this a limitation of DataScroller/DataTable/DataSource tags why does it not work??
    Please help me its urgent.
    Thanks a ton !!

    Thx for the reply, I did try your suggestion It did not throw any exception. Here is the log messages after enabling jbo Debug.
    [391] Reusing a cached session application module instance
    [392] Getting a connection for internal use...
    [393] Creating internal connection...
    [394] Oracle SQLBuilder: Registered driver: oracle.jdbc.driver.OracleDriver
    wClause : (ACTIVITY_CD = 'A') AND (LIC_NAME like 'A%' OR LIC_SHORT_NAME like 'A%' OR LIC_AKA_NAME like 'A%' )
    [395] Column count: 10
    [396] ViewObject : Reusing defined prepared Statement
    [397] $$added root$$ id=-2
    [398] Application Module failover is enabled
    [399] Getting a connection for internal use...
    [400] Creating internal connection...
    [401] Oracle SQLBuilder: Registered driver: oracle.jdbc.driver.OracleDriver
    [402] <AM MomVer="0">
    <cd/>
    <VO>
    <VO Sz="8" St="8" Def="com.sophoi.ipls.media.tv.businessentities.licensee.LicenseeView" Name="licenseeView">
    <Wh>
    <![CDATA[(ACTIVITY_CD = 'A') AND (LIC_NAME like 'A%' OR  LIC_SHORT_NAME like 'A%' OR  LIC_AKA_NAME  like 'A%' )]]>
    </Wh>
    <Or>
    <![CDATA[LIC_NAME ASC]]>
    </Or>
    </VO>
    </VO>
    </AM>Long postings are being truncated to ~1 kB at this time.

  • Navigation Previous, Next not working

    Navigation - Go to Previous Page and Go to Next Page are not working properly. It works only for page 1 and 2.
    Using SAP Crystal Reports, Developer Version for Microsoft Visual Studio version 13.0.8.1216.
    Crystal Reports Activex viewer has been used to display reports.
    Is this issue fixed any other version
    --Jagannath

    After adding to Page_Init() Navigation worked fine, but I don't understand previous versions were working fine in Page_Load(), why not latest version of Crystal Reports not working.
    Thank you for the answer.
    --Jagannath

  • Scroll back to previous page not working in safari on my air since downloaded maverick - any suggestions

    I dont seem to be able to go back in safari by using finger scrolling on trackpad on my air- I can on my imac but it wont work on the air. I know that other people have had a similar problem and have read the suggestions but I dont know how to empy cache and do the other things suggested. Can anyone tell me in plain english how to fix it please.

    It's fine now. Originally, he went on Safari and clicked on one of his most visited sites and was unable to scroll. Then he went to Google and was able to get to the keyboard to do a search (I guess he couldn't do that with the scrolling issue). He also tried Yahoo and did a search for a news site he couldn't get to previously, went to the site and now everything is fine. For someone with PTSD (not me) this is like a life or death situation. For me, it's something I try to look into for resolve ASAP!!!
    Cyber hiccup?

  • Restoring data from previous device not working

    QUESTION:
    My question is, am I able to transfer data from my previous Blackberry 10 device and onto my new Blackberry 10 device if I do not have my old device anymore? (Keeping in mind that I have the previous device data backed up).
    Problem:
    Ok so:
    1. I purchased the Z10 and started adding contacts, apps etc.
    2. I purchased the Q10 and transfered data using the switch device system
    3. The Q10 I had purchased was faulty so before I handed it in to get a new Q10 I backed it up so I could restore its data on the new Q10.
    4. Once I received the new Q10 I handed the old one in and went home and attempted to do the same method of transferring my data across
    Turns out that you need your previous bbry for this action to be able to work so I thought I would just connect the new Q10 into Link and just click on restore data and using the backup on my previous Q10 (the faulty one).
    5. I get an error every time saying that the restore could not be completed because; did not recognise device, try unplugging and replugging etc etc.
    Attempted Resolution from reading the forums:
    > Restarted PC
    > Took bbry battery and sim card out
    > Restoring data via Applications > Media > Settings
    > Removed device from Link
    > Restarted bbry
    > Full security wipe and tried again

    When you use BlackBerry Link to transfer data from an old device to a new one the software should prompt you to connect your old device. That's when you connect the Z10 (as long as you didn't delete everything from the Z10). It copies and then it prompts you to connect the new device. 
    To make sure BB Link connects to the new device, go into that device's Settings > Storage and Access and make sure you have USB Connection set for "Connect to PC" and not to "Autodetect." You can try toggling to Mac and back to PC if it doesn't recoginize the connection.

  • Buttons to change to next/previous state not working

    Hi guys
    Apologies if you consider this an acrobat issue but I thought it was more indesign.
    I am trying to add in a slide show to my interactive pdf and I just can't get it to work.
    I've followed a couple of tutorials to the letter and when I preview in indesign the buttons work fine and the picture changes the next/previous state.  When I export to SWF, again, it works beautifully.  But as soon as I export to interactive PDF, the buttons dont work.
    I can only think this is either something in the export settings or something with my acrobat not letting it be interactive.
    I use CS5 and Acrobat X pro.
    Any ideas?  Literally nothing happens when I click on the buttons in the PDF.
    Thank you

    MSO….multi state object.
    Unsupported in PDF. Never has been.
    The only possible workaround is to create it in a different file, export as SWF and place the SWF into a PDF.
    Bob

  • Aperture 3.4.5 - update from previous version not working

    Hi, I have updated Aperture to 3.4.5 via the App Store update and now it won't startup correctly.  I get this...
    I started with Aperture 2 via disk install and then upgrade to V3 via the App store, all other updates have worked fine.
    Any ideas guys?
    I can use Time Macjine to go back a version and get things working again but this is preventing any further updates and enhancements from being applied.
    Thanks.

    In previous versions of Aperture it helped to trash it and to install it again from the App Store (don't empty the Trash), when Aperture was asking for the serial number.
    I don't know, however, if it will still help with the new AP 3.5.

  • Save for previous does not work

    In LabVIEW 7, there is no possibility to save for a previous version. The reference to "Save with options" in file menu, given in Help, leads nowhere. I have also tried to save programmically, using method "Save for previous", but it did nothing (and did not say anything in the Warnings or Error).
    What to do?

    > In LabVIEW 7, there is no possibility to save for a previous version.
    > The reference to "Save with options" in file menu, given in Help,
    > leads nowhere. I have also tried to save programmically, using method
    > "Save for previous", but it did nothing (and did not say anything in
    > the Warnings or Error).
    > What to do?
    Can you be more specific? Save with options has six options listed on
    the left side. The next to last in LV7 should allow for saving the
    LV6.1. Really, you should just have to click that radio button and if
    you aren't using any toolkits, you click save and choose a folder for LV
    to place the VIs into -- it does this trying to avoid saving over the
    originals. If you need the VIs for versions before 6.1, load into 6.1
    and go furthe
    r back into time. In general, each LV release will save
    back to the previous major release.
    Where in this sequence do you run into a problem?
    Greg McKaskle

  • Left Arrow "Goto Previous Frame" Not Working in Projects

    When trying to navigate around the timeline in a project, I can press the "Right Arrow" key on the keyboard to navigate to the next frame in the timeline from the playhead.  When I try and press the "Left Arrow" key to navigate to the previous frame, the project is de-selected and the selection jumps up to Macintosh HD above the project (or if editing a project on another drive, it jumps up and selects that Drive).  Pressing the left arrow key again collapses that Drive and all the projects on it are hidden.
    I can skip 10 frames in either direction just fine by pressing Shift-Left or Shift-Right, but for some reason cannot skip backward frame by frame without the project being de-selected.
    If I choose a clip in the Event Library, I am able to navigate frame by frame either direction just fine with the Arrow keys - it only seems to be a problem in an actual project.
    Any ideas?
    Thanks!

    When trying to navigate around the timeline in a project,
    Is this really in the timeline, or in the Project Library? It sounds like you're in the Project Library. In there, yes that's the way the arrow keys work. They're used to navigate through projects and folders. Event Library works the same way.
    After the drive collapses with the left arrow, you can use the right arrow to open it. If you want to slow play through the project hold K and L. If you want frame by frame inspection, hold the K key and tap the L key. Or open the project into the timeline panel.

  • ORA-01489 sys_connect_by_path and previous solution not working

    Hi all.
    Oracle version:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE     11.2.0.1.0     Production"
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    I need to get routes in a map and the associated sum of distances from some point to another.
    map
    --     9
      F ----------E
      | \         |
      |  \2       |6
      |   \   11  |
    14|   C-------D
      |  / \10   /
      | /9  \   /15
      |/     \ /
      A-------B
         7I have a query that correctly gets the routes.
    WITH distances AS
         SELECT 'A' n1, 'B' n2, 7 d FROM DUAL UNION
         SELECT 'A' n1, 'C' n2, 9 d FROM DUAL UNION
         SELECT 'A' n1, 'F' n2, 14 d FROM DUAL UNION
         SELECT 'B' n1, 'D' n2, 15 d FROM DUAL UNION
         SELECT 'B' n1, 'C' n2, 10 d FROM DUAL UNION
         SELECT 'C' n1, 'D' n2, 11 d FROM DUAL UNION
         SELECT 'C' n1, 'F' n2, 2 d FROM DUAL UNION
         SELECT 'D' n1, 'E' n2, 6 d FROM DUAL UNION
         SELECT 'F' n1, 'E' n2, 9 d FROM DUAL
    SELECT
         'A'||sys_connect_by_path(n2,'-') path,
         SUBSTR(sys_connect_by_path(d,'+'),2) sum_dist
    FROM distances
    START WITH n1='A'
    CONNECT BY NOCYCLE PRIOR n2=n1;
    A-B          7
    A-B-C          7+10
    A-B-C-D          7+10+11
    A-B-C-D-E     7+10+11+6
    A-B-C-F          7+10+2
    A-B-C-F-E     7+10+2+9
    A-B-D          7+15
    A-B-D-E          7+15+6
    A-C          9
    A-C-D          9+11
    A-C-D-E          9+11+6
    A-C-F          9+2
    A-C-F-E          9+2+9
    A-F          14
    A-F-E          14+9The problem is when there are a lot of nodes, I get an ORA-01489: result of string concatenation is too long.
    I followed this link.
    sys_connect_by_path & to_CLOB
    I built the specified package but apparently is combining elements.
    If it's called just one time.
    WITH distances AS
         SELECT 'A' n1, 'B' n2, 7 d FROM DUAL UNION
         SELECT 'A' n1, 'C' n2, 9 d FROM DUAL UNION
         SELECT 'A' n1, 'F' n2, 14 d FROM DUAL UNION
         SELECT 'B' n1, 'D' n2, 15 d FROM DUAL UNION
         SELECT 'B' n1, 'C' n2, 10 d FROM DUAL UNION
         SELECT 'C' n1, 'D' n2, 11 d FROM DUAL UNION
         SELECT 'C' n1, 'F' n2, 2 d FROM DUAL UNION
         SELECT 'D' n1, 'E' n2, 6 d FROM DUAL UNION
         SELECT 'F' n1, 'E' n2, 9 d FROM DUAL
    SELECT
         'A'||'-'||hierarchy.branch(LEVEL,n2,'-') path
    FROM distances
    START WITH n1='A'
    CONNECT BY NOCYCLE PRIOR n2=n1;
    A-B
    A-B-C
    A-B-C-D
    A-B-C-D-E
    A-B-C-F
    A-B-C-F-E
    A-B-D
    A-B-D-E
    A-C
    A-C-D
    A-C-D-E
    A-C-F
    A-C-F-E
    A-FBut if I call it twice in the same query...
    WITH distances AS
         SELECT 'A' n1, 'B' n2, 7 d FROM DUAL UNION
         SELECT 'A' n1, 'C' n2, 9 d FROM DUAL UNION
         SELECT 'A' n1, 'F' n2, 14 d FROM DUAL UNION
         SELECT 'B' n1, 'D' n2, 15 d FROM DUAL UNION
         SELECT 'B' n1, 'C' n2, 10 d FROM DUAL UNION
         SELECT 'C' n1, 'D' n2, 11 d FROM DUAL UNION
         SELECT 'C' n1, 'F' n2, 2 d FROM DUAL UNION
         SELECT 'D' n1, 'E' n2, 6 d FROM DUAL UNION
         SELECT 'F' n1, 'E' n2, 9 d FROM DUAL
    SELECT
         'A'||SUBSTR(hierarchy.branch(LEVEL,n2,'-'),2) path,
         hierarchy.branch(LEVEL,d,'+') sum_dist
    FROM distances
    START WITH n1='A'
    CONNECT BY NOCYCLE PRIOR n2=n1;
    A          7
    A-C          7+10
    A-10-D          7+10+11
    A-10-11-E     7+10+11+6
    A-10-F          7+10+2
    A-10-2-E     7+10+2+9
    A-D          7+15
    A-15-E          7+15+6
    A          9
    A-D          9+11
    A-11-E          9+11+6
    A-F          9+2
    A-2-E          9+2+9As you can see, is combining the elements (A-10-11-E) node - distance - distance - node
    Do I have to create separate functions in the package, one per column?, or is there another way to solve this problem?, or even better, another way to solve the original problem (ORA-01489)
    Thanks a lot.
    Regards.
    Package code (by Solomon Yakobson):
    CREATE OR REPLACE
      PACKAGE Hierarchy
        IS
            TYPE BranchTableVarchar2Type IS TABLE OF VARCHAR2(4000)
              INDEX BY BINARY_INTEGER;
            BranchTableVarchar2 BranchTableVarchar2Type;
            TYPE BranchTableClobType IS TABLE OF CLOB
              INDEX BY BINARY_INTEGER;
            BranchTableClob BranchTableClobType;
            FUNCTION Branch(
                            p_Level          IN NUMBER,
                            p_Value          IN VARCHAR2,
                            p_Delimiter      IN VARCHAR2 DEFAULT CHR(0)
              RETURN VARCHAR2;
            PRAGMA RESTRICT_REFERENCES(Branch,WNDS);
            FUNCTION Branch(
                            p_Level          IN NUMBER,
                            p_Value          IN CLOB,
                            p_Delimiter      IN VARCHAR2 DEFAULT CHR(0)
              RETURN CLOB;
            PRAGMA RESTRICT_REFERENCES(Branch,WNDS);
    END Hierarchy;
    CREATE OR REPLACE
      PACKAGE BODY Hierarchy
        IS
            ReturnValueVarchar2 VARCHAR2(4000);
            ReturnValueClob     CLOB;
        FUNCTION Branch(
                        p_Level        IN NUMBER,
                        p_Value        IN VARCHAR2,
                        p_Delimiter    IN VARCHAR2 DEFAULT CHR(0)
          RETURN VARCHAR2
          IS
          BEGIN
              BranchTableVarchar2(p_Level) := p_Value;
              ReturnValueVarchar2          := p_Value;
              FOR I IN REVERSE 1..p_Level - 1 LOOP
                ReturnValueVarchar2 := BranchTableVarchar2(I)|| p_Delimiter || ReturnValueVarchar2;
              END LOOP;
              RETURN ReturnValueVarchar2;
        END Branch;
        FUNCTION Branch(
                        p_Level        IN NUMBER,
                        p_Value        IN CLOB,
                        p_Delimiter    IN VARCHAR2 DEFAULT CHR(0)
          RETURN CLOB
          IS
          BEGIN
              BranchTableClob(p_Level) := p_Value;
              ReturnValueClob          := p_Value;
              FOR I IN REVERSE 1..p_Level - 1 LOOP
                ReturnValueClob := BranchTableClob(I)|| p_Delimiter || ReturnValueClob;
              END LOOP;
              RETURN ReturnValueClob;
        END Branch;
    END Hierarchy;
    /Edited by: sKr on 08-mar-2012 17:29
    Package code added

    Hi,
    sKr wrote:
    Hi all.
    Oracle version:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    "CORE     11.2.0.1.0     Production"
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    I need to get routes in a map and the associated sum of distances from some point to another.
    map
    --     9
    F ----------E
    | \         |
    |  \2       |6
    |   \   11  |
    14|   C-------D
    |  / \10   /
    | /9  \   /15
    |/     \ /
    A-------B
    7... I wish we could mark questions as "Helpful" or "Correct". You'd get 10 points for sure.
    Do I have to create separate functions in the package, one per column?,You don't need separate functions. One user-defined function should be enough, just like one built-in version of SYS_CONNECT_BY_PATH is enough. Whatever it has to store internally, it knows to keep a separate copy for every argument that you call it with. The problem with the package, as originally posted, is that there's only one internal variable BranchTableVarchar2. Instead of one variable, make an array of similar variables, and add an optional argument to the branch funtion to tell it which element in that array to use.
    CREATE OR REPLACE
      PACKAGE Hierarchy
        IS
            TYPE BranchTableVarchar2Type IS TABLE OF VARCHAR2(4000)
              INDEX BY BINARY_INTEGER;
            BranchTableVarchar2 BranchTableVarchar2Type;
         TYPE VList     IS TABLE OF BranchTableVarchar2Type          -- ***  NEW  ***
           INDEX BY     BINARY_INTEGER;                         -- ***  NEW  ***
         vl     VList;                                      -- ***  NEW  ***
            TYPE BranchTableClobType IS TABLE OF CLOB
              INDEX BY BINARY_INTEGER;
            BranchTableClob BranchTableClobType;
            FUNCTION Branch(
                            p_Level          IN NUMBER,
                            p_Value          IN VARCHAR2,
                            p_Delimiter      IN VARCHAR2     DEFAULT CHR(0),
                   p_PathNum      IN PLS_INTEGER     DEFAULT     1     -- ***  NEW  ***
              RETURN VARCHAR2;
            PRAGMA RESTRICT_REFERENCES(Branch,WNDS);
            FUNCTION Branch(
                            p_Level          IN NUMBER,
                            p_Value          IN CLOB,
                            p_Delimiter      IN VARCHAR2 DEFAULT CHR(0)
              RETURN CLOB;
            PRAGMA RESTRICT_REFERENCES(Branch,WNDS);
    END Hierarchy;
    SHOW ERRORS
    PROMPT     ==========  FK BODY  ==========
    CREATE OR REPLACE
      PACKAGE BODY Hierarchy
        IS
            ReturnValueVarchar2 VARCHAR2(4000);
            ReturnValueClob     CLOB;
        FUNCTION Branch(
                        p_Level        IN NUMBER,
                        p_Value        IN VARCHAR2,
                        p_Delimiter    IN VARCHAR2       DEFAULT CHR(0),
                  p_PathNum        IN PLS_INTEGER DEFAULT 1     -- ***  NEW  ***
          RETURN VARCHAR2
          IS
          BEGIN
              vl (p_PathNum) (p_Level) := p_Value;               -- ***  CHANGED  ***
              ReturnValueVarchar2          := p_Value;
              FOR I IN REVERSE 1..p_Level - 1 LOOP
                ReturnValueVarchar2 := vl (p_PathNum) (I)          -- ***  CHANGED  ***
                             || p_Delimiter
                         || ReturnValueVarchar2;
              END LOOP;
              RETURN ReturnValueVarchar2;
        END Branch;
        FUNCTION Branch(
                        p_Level        IN NUMBER,
                        p_Value        IN CLOB,
                        p_Delimiter    IN VARCHAR2 DEFAULT CHR(0)
          RETURN CLOB
          IS
          BEGIN
              BranchTableClob(p_Level) := p_Value;
              ReturnValueClob          := p_Value;
              FOR I IN REVERSE 1..p_Level - 1 LOOP
                ReturnValueClob := BranchTableClob(I)|| p_Delimiter || ReturnValueClob;
              END LOOP;
              RETURN ReturnValueClob;
        END Branch;
    END Hierarchy;
    SHOW ERRORSAs you can see, I only changed the VARCHAR2 version. I'll leave changing the CLOB version as an exercise for you.
    When you call branch, pass a unique number for each column of output. If you don't explicitly give a number, it will default to 0.
    Here's your query modified to call it:
    SELECT  'A' || SUBSTR ( hierarchy.branch ( LEVEL
                                           , n2
                    , 2
                    )          AS path
    ,     hierarchy.branch ( LEVEL
                    , d
                    , '+'
                    , 12
                    )     AS sum_dist
    FROM    distances
    START WITH          n1 = 'A'
    CONNECT BY NOCYCLE      PRIOR n2     = n1
    ;For path, I called branch with only 3 arguments, so it's using vl (0) for internal storage for path.
    For sum_dist, I had to use a different integer. I couldn't decide if I should use 1 or 2, so I compromised and used 12. I could have used any integer, except 0.
    Output:
    PATH                           SUM_DIST
    A                              7
    A-C                            7+10
    A-C-D                          7+10+11
    A-C-D-E                        7+10+11+6
    A-C-F                          7+10+2
    A-C-F-E                        7+10+2+9
    A-D                            7+15
    A-D-E                          7+15+6
    A                              9
    A-D                            9+11
    A-D-E                          9+11+6
    A-F                            9+2
    A-F-E                          9+2+9
    A                              14
    A-E                            14+9
    or is there another way to solve this problem?, or even better, another way to solve the original problem (ORA-01489)Since you're calling a user-defined package, you might want to add other features to the package.
    For starters, in addition to a function that returns a string like '7+10+11', it might be handy to have a string that keeps those numbers internally, but returns the actual value 7 + 10 + 11 = 28.
    If you're using this for problems where you want to find the path with the least total d (or the greatest total d, for that matter, but for now let's say you're only interested in the minimum), you might want a function that keeps track of the minimum total d encountered so far for each node. Every time you find a different path to a node, the function could check to see if the total d is better than the previous best. If not, it could return a flag (sort of like CONNECT_BY_ISCYCLE) that tells you not to bother with that path any more.

  • Automatic removal of previous backups not working

    retention policy is window of 7 days
    Sat:
    crosscheck backup
    report need backup
    delete obsolete
    backup incremental level 0 database
    backup archivelog all delete input all
    Sun-Fri:
    crosscheck backup
    report need backup
    delete obsolete
    backup incremental level 1 cumulative
    backup archivelog all delete input all
    Here is what is in the backup directory
    incremental level 0 & acrchivelogs : Feb 25
    incremental level 1 & acrchivelogs : Feb 26
    incremental level 0 & acrchivelogs : Mar 4
    incremental level 1 & acrchivelogs : Mar 5
    Shouldn't everything before Mar 4 have been deleted by "delete obsolete"? I thought I understood RMAN but apparently not. Please help.

    Hi
    That you continue to have a full backup of Feb. 25 is correct. Retention policy set to 7 days means that you should be able to restore till 7 days ago; to do that you need a backup older than 7 days.
    Your output is correct!
    Bye, Aron

Maybe you are looking for

  • Changin SID of cloned virtualized R/3 4.6c system

    Hello all, we are planning an upgrade of our R/3 4.6c landscape (DEV, QUAL, PROD) to EHP5 for ERP 6.0. Our systems are on VMware (ESX), Windows Server 2003, Oracle 10.2.0.5 We plan to setup Solution Manager 7.1. While upgrading DEV and TEST we need t

  • Current datetime in xslt

    Hi , I want to get the current datetime during my xlst tranform. I used the below codes but can not get it . xslt 1.0 <xsl:stylesheet ... xmlns:ex="http://exslt.org/dates-and-times" extension-element-prefixes="ex"> <xsl:value-of select="ex:date-time(

  • Web-Based iTunes??

    Other people must be facing this problem as well - I don't have a computer I can download iTunes on. I have an older home computer that won't work with iTunes (windows millenium anyone?). The security and network guys are coming down on non-company s

  • [Newbie] JSP precompilation & dumps

    Hey there, I've just gotten started on my first JSP project. I've done some extensive googling, but can't work out the following two issues. 1) One of my pages, takes around 10-15 seconds to load in the browser. I'm assuming thats because tomcat is p

  • FM8 with RoboHelp 7 -- Straightforward way to generate as Web Help?

    I'm an experienced FrameMaker user who hasn't used any version of RoboHelp for a while. I'm currently trying to use RoboHelp 7 generate a structured FrameMaker book OR the book's individually selected .fm or .mif files as an HTML-based help system wi