CONNECT BY MISTAKE...

Dear all,

I wrote a script that passes data such as A/b/C that represents Apple/Maria/Carrott. Unfortunately, when I run the script it returns all combinations due to the external CONNECT BY function. However, I'm not sure how to solve this problem and I would really appreciate the help.

Also on a sub note is there a better way to do what I hate the re - invent the wheel :)

CODE
WITH exm_data AS
(
SELECT '1' cst_id, "A, b, C" as jnd_data
OF THE DOUBLE
UNION ALL
SELECT "2", "B/C".
OF THE DOUBLE
UNION ALL
SELECT "3", "BA".
OF THE DOUBLE
), exm_decoder AS
(
SELECT 'A' AS ident,
'Apple' AS fruit_or_veg
OF THE DOUBLE
UNION ALL
SELECT "BA."
"Maria".
OF THE DOUBLE
UNION ALL
SELECT 'C ',.
"Carrott.
OF THE DOUBLE
)
SELECT DISTINCT Cst_id,
SYS_CONNECT_BY_PATH(fruit_or_veg, '/') AS jnd_data
FROM (SELECT cst_id,
jnd_data,
LV
FROM (SELECT cst_id,
REGEXP_SUBSTR (str, ' [^ /] +', 1, LEVEL) jnd_data,.
LEVEL lv,
LAG(Level, 1, 0) OVER (PARTITION BY cst_id ORDER BY LEVEL) lg
FROM (SELECT cst_id,
Concat(jnd_data,'/') str
Of exm_data
)
CONNECT BY REGEXP_SUBSTR(str, '[^/]+', 1, LEVEL) IS NOT NULL
)
WHERE lv! = lg
ORDER BY lb ADDED THIS NOT SURE I'LL HAVE IT...
) exm_split
JOIN the exm_dec exm_decoder
ON exm_split.jnd_data = exm_dec.ident
CONNECT BY cst_id = PRIOR cst_id
AND lv = lv + 1 PRIOR
;


OUTPUT CURRENT
CST_ID JND_DATA
2 /Bannana
1 /Bannana
2 /Carrott
3 /Bannana
1 /Apple
1/Maria/Carrott
1 /Carrott
1/Apple/Banana
2/Maria/Carrott
1/Apple/hero/Carrott

DESIRED OUTPUT
CST_ID JND_DATA
1 Apple/Maria/Carrott
2 hero/Carrott
Hero 3
column jnd_data format a40
WITH exm_data AS (
                  SELECT '1' as cst_id, 'A/BA/C' as jnd_data FROM DUAL UNION ALL
                  SELECT '2', 'BA/C' FROM DUAL UNION ALL
                  SELECT '3', 'BA' FROM DUAL
                 ),
  exm_decoder AS (
                  SELECT 'A' AS ident,'Apple' AS fruit_or_veg FROM DUAL UNION ALL
                  SELECT 'BA','Bannana' FROM DUAL UNION ALL
                  SELECT 'C','Carrott' FROM DUAL
                 )
select  distinct cst_id,
                 ltrim(sys_connect_by_path(fruit_or_veg,'/'),'/') jnd_data
  from  (
         select  cst_id,
                 level rn,
                 regexp_substr(jnd_data,'[^/]+',1,level) jnd_data_element
           from  exm_data
           connect by level <= (select max(length(jnd_data) - length(replace(jnd_data,'/'))) from exm_data) + 1
        ),
        exm_decoder
  where ident = jnd_data_element
    and connect_by_isleaf = 1
  start with rn = 1
  connect by cst_id = prior cst_id
         and rn = prior rn + 1
  order by cst_id
/

C JND_DATA
- ----------------------------------------
1 Apple/Bannana/Carrott
2 Bannana/Carrott
3 Bannana

SQL> 

SY.

Published by: Solomon Yakobson, May 15, 2009 07:09

Tags: Database

Similar Questions

  • TUXEDO C server using Oracle 11 g ProC receives ORA-01012 not connected by mistake on EXEC SQL PREPARE

    Porting of some former service C code for TUXEDO that used Informix to Oracle... a trial.

    Service logic uses dynamic SQL to SQL and pre-compiler instructions to then run the

    Statement and return to the client in the form of an XML doc.

    Port is done now and during the test initial (after you have configured the TUXCONFIG, environment, Oracle DB, etc) am receiving an Oracle ORA-01012 not connected when the TUXEDO service routine tries to prepare the SQL SELECT statement.

    The statement in question is a simple "SELECT * FROM EMP".

    The server is defined in a group belonging to a group that has an OPENINFO string that connects to the Oracle DB.  This seems to be the case I see the sqlplus using the view v$ session where the user sessions connect when servers of launch.

    No idea why the EXEC SQL PREPARE is causing the server to disconnect from the DB?

    THX.

    W. MacKenzie

    It was with the inclusion of the DB = orcl tag in my OPENINFO in the TUXCONFIG.  Remove that and specify the database instance in the envfile for the configuration.  Works now.

  • Connect by mistake of loop

    Hi friends,

    When I tried to run my application im below get error like
    ORA-01436: CONNECT LOOP IN the USER DATA
    This is my request
    select  distinct papf.person_id, papf.full_name "Employee Name", supf.full_name "Manager Name", paaf.supervisor_id, level
    from per_all_people_f papf, per_all_people_f supf, per_all_assignments_f paaf
    where papf.person_id = paaf.person_id and nvl(paaf.supervisor_id, papf.person_id) =  supf.person_id and
    trunc(sysdate) between paaf.effective_start_date and PAAF.effective_end_date and
    trunc(sysdate) between papf.effective_start_date and PApF.effective_end_date
    start with paaf.supervisor_id is null
    connect by prior papf.person_id =  PAAF.supervisor_id
    order by papf.person_id
    If I was wrong, could understand the cause.

    Thank you

    Kind regards
    Vel

    For performance reasons, you must use

    connect prior ADP.person_id = PAAF.supervisor_id

    not

    connect prior women's wear.person_id = PAAF.supervisor_id

    But the reason to connect loop entered into force ADP check is in the wrong place. To be part of the beginning with and connect to. Also, if you check the date of entry into women's WEAR, you should also check SUPF entry date. And then you wouldn't need SEPARATE

    Try:

    select  papf.person_id,
            papf.full_name "Employee Name",
            supf.full_name "Manager Name",
            paaf.supervisor_id,
            level
      from  per_all_people_f papf,
            per_all_people_f supf,
            per_all_assignments_f paaf
      where paaf.person_id = papf.person_id
        and nvl(paaf.supervisor_id, paaf.person_id) = supf.person_id
        and trunc(sysdate) between papf.effective_start_date and papf.effective_end_date
        and trunc(sysdate) between supf.effective_start_date and supf.effective_end_date
      start with paaf.supervisor_id is null
        and trunc(sysdate) between paaf.effective_start_date and paaf.effective_end_date
      connect by paaf.supervisor_id = prior paaf.person_id
          and trunc(sysdate) between paaf.effective_start_date and paaf.effective_end_date
      order by papf.person_id
    /
    

    SY.

  • Can make a record hard damaged by mistake of connection of the power cord on the jumper pin?

    Hello

    I tried to upgrade my HD, but I connected by mistake the SATA power cable to the axis of the lower rider after mistakenly removing the jumper shunt

    May I know if this could have damaged by HD?

    I tried to connect in the way justifiable but the system might not always detect the drive.

    What are the possible causes and how to overcome it?

    Thank you

    Low

    A Sata hard drive shouldn't have riders, so make sure you have the jumper in the right position and the cable correctly connected IDE.

  • Arbitrary accusations Skype Wifi!

    I went to my beloved coffee today. Evertime I connect to the hotspot WiFi Skype popup appears. Normally I close and connect even if the portal that gives you a 1 FREE Internet time. Today, I clicked on connect by mistake.

    Given that it was a mistake, I immediately started looking for how to disconnect. No luck!.

    I turned off wifi, I closed the laptop, I left Skype. Nothing hapenned.

    After 30 minutes, a load of 4.2Euros appeared on my account 29: 58 minutes of wifi!

    Is there any time the connection minimum 29:58:00 documented anywhere in the site of Skype wifi?

    If anyone from Skype is reading this forum, I would like to know what is the meaning of "you pay for what you use" that is advertised for this service. The correct one should be "you pay what we decide to charge you."

    Contact customer service

    TIME ZONE - US EAST. LOCATION - PHILADELPHIA, PA, USA.

    I recommend that you always run the latest version of Skype: Windows & Mac

    If my advice helped to solve your problem, please mark it as a solution to help others.
    Please note that I usually do not respond to unsolicited private Messages. Thank you.

  • Could not load the vi in the runtime of LV - NEW

    It is probably the interaction more frustrating that I have with TestStand and Labview.

    You build a VI with the development system, test everything works fine, then take the runtime of LV and get the dreaded "Unable to load xxx.vi with the labview runtime engine.

    So after the multitude of posts here, you 1 / ensure that your screws are not read only 2 / mass compile your screws 3 / use the 'update VI calls' TestStand and finally 4 / give up in disgust and try to diagnose the problem and systematically tearing your library share to find the VI problem in your system.

    Surely, there must be a way for the Labview Runtime stupid engine indicate Teststand why he can't run the screw in question? Connect a mistake somewhere maybe? A debugger mode? Try just at random of things every time I encounter this problem is driving me crazy (and is very stressful when you have a production system down).

    A concrete example - my current number is;

    TestStand 2014 SP1

    LabVIEW 2014 SP1

    LabVIEW Runtime engine 14.0.1

    I built a class LV, and I call the VI with the Labview in Teststand adapter, using the runtime engine. The call type is 'call of class members. Every public method in my class works well with the runtime engine, except a public method that includes the message "Unable to load blah blah blah" dreaded. This public method has nothing inside but a pop-up dialog box. Remove the pop-up dialog box of the method call solves the problem (well other than the class method does nothing now). Of course, the VI works with the development system and I went through the steps of 1, 2, 3, 4. obvious above to solve the problem. The LV Runtime, the development system and the Teststand are still on the same machine - is not as I'm even trying to deploy on another PC!

    My only complaint is not that the Runtime LV has a problem... its there appears no way to debug the issue intelligently without looking for random things.

    Has anyone found a way to debug the runtime of LV under TestStand?

    I always build a library packed .lvlibp during deployment.

    Otherwise I also had problems with simply using screws

    Note: I use also several classes in my project.

    Kind regards

    Akshay

  • Referring XY graph because of report generator when the program is compiled

    I use the simple PDF generator to add a XY Chart Report PDF, same handle is used in an Excel report and works very well. The XY graph appears so fine when the code it running in development mode, when it is run as executable, the chart insert routines fail for lack of FFL *.bmp temp for the chart of 1172. See attachments. Anyone have any idea why the loss of the handle/temp graph error?

    As you say, the error saying that it cannot find the file, which probably means that the file has not been created.

    My guess would be it - you create the chart in the subVIs with the + and control icons (which is probably PDF_Generator.Writer.AddImage.vi) and the VI which is shown in the picture was never his FP posted.

    By default, LV removes the prefix of all the screws enter the EXE file unless he decides he'll need in the public Service. If the FP is removed then the image of the control are not accessible and that would probably prevent the file to be created. To confirm this, the simplest method is to create a node of static property for controls on the front panel. This will force LV to keep the PC when you build the exe.

    If it does not help, then you know exactly where the BMP file is supposed to be generated and see if you can connect a mistake there.

  • LAN broken or disconnected the cable

    the icon in the LAN system tray has a red X and says a network cable is broken or disconnected. my laptop network will connect by mistake. I visually inspected son and they seem ok - is there a way to be sure if it is causing me to lose my connection. appreciate any suggestion

    1. use a different cable

    2. go to start, Control Panel, network connections, right click and choose repair.

    What happens now?

    3. go to start, then right-click on my computer and select manage, select Device Manager, are there points of yellow exclamation that will tell you if there is a problem with a driver?

    4 do the following if you can't connect to the internet, make sure that your system is clean by running a scan with your antivirus which is this?

    5.

    Click Start, run and enter in the box:

    Msinfo32

    Click OK, and when the system info summary appears, click on edit, select all (Ctrl-A), copy (Ctrl-C) and paste (Ctrl-V) the information back here in your next reply.

    You can change the personal information.

     

    Download, install, update and scan with these full free malware detection programs:

    Malwarebytes (MMFA): http://www.malwarebytes.org/products/malwarebytes_free

    SUPERAntiSpyware: (SAS): http://www.superantispyware.com/

    Remove all found, restart, and run again until analyses race clean, these can be removed later if you wish.

  • How can I manage to disconnect from my outlook express

    Dear team,

    I'm having a problem with my login outlook express. I was connected by mistake in outlook express, but I didn't disconnect from option in the page in its entirety and unfortunately I have connected to my office of managers so will you please help me with this.

    Thank you & best regards

    Mani Krishna.V

    If I understand correctly, you can go to tools | Accounts | Mail and delete this account.  Alternatively, you can go to tools | Options and uncheck send it and receive at startup.  You can also just delete the password under Tools | Accounts | Mail | Properties | Servers, then it will ask you every time.

    See if that helps at all.

    Steve

  • nightmare of Java! do I have to have java on my dell laptop wit winxp and IE8?

    Downloaded version the most recent runtime and immediately lost internet connectivity. by mistake, they lack my safety to a proxy but did not provide an address. I want that they out of my computer.  are they essential?

    Hi rosearenas,

    Welcome to the Microsoft community.

    I suggest you go through the following information.

    You receive an automatic download of Java, it is from the Sun, not Microsoft.

    It is not for Windows XP; It is to your Web browser and you just, if you visit a site with Java Web content.

    You can follow the steps to uninstall the updates:

    a. Click Start.

    b. go to the control panel.

    c. navigate to add/remove programs.

    d. check the "Show updates" and then scroll down to the update that you want to delete.

    e. remove the update and restart the computer.

    You can also perform to restore the system to a system restore point before installing the updates. How to restore Windows XP to a previous state.

    http://support.Microsoft.com/kb/306084?WA=wsignin1.0

    You can also refer to:

    Wireless and wired network problems.

    http://Windows.Microsoft.com/en-us/Windows/network-connection-problem-help#network-problems=Windows-XP&V1H=win8tab1&V2H=win7tab1&V3H=winvistatab1&v4h=winxptab1

    If you need more assistance, answer us, we will be happy to help you.

  • HP Envy will not automatically sleep

    My computer will sleep very well if I have to say, but he will not do it automatically. This function is essential to the security of my computer.

    I confirm that I said to sleep after a minute, whether on battery or plugged in. If I said to darken the screen after a minute, which works very well, but he won't sleep.

    Here are the diagnostic report of power efficiency (deleted Forum HTML) - Note the errors.

    I unplugged all USB devices. I stopped the network sharing Service WIndows Media. I disconnected from the network (airplane mode). He shall not sleep.

    Please tell me what else to try.

    Thank you.

    Power efficiency Diagnostics report computer name HP_ENVY time of scanning 2014-05-16 T 02: 26:12Z Scan duration 60 seconds system manufacturer Hewlett-Packard product system name HP ENVY TS 17 Notebook PC BIOS Date 03/05/2014 BIOS Version OS F.53 Build 9600 platform role PlatformRoleMobile connected real mistakes of analytical results of process County 103 Thread Count 1174 report GUID {85eba029-391e-4c52-b630-5313c8f32a3c}

    Hi, AQB,

    Yes, I solved it. Here are my notes on the issue:

    Check out this web site:

    http://mingersoft.com/blog/2011/12/Why-wont-Windows-automatically-sleep/

    Best:

    http://helpdeskgeek.com/Windows-8/fix-Windows-8-1-will-sleep/

    At the command prompt:

    powercfg - requestsoverride driver \filesystem\srvnet system

    or

    powercfg /requestsoverride srvnet system driver

    or

    powercfg with fluo compact /output c:\temp\requests.htm

    Check out this web site:

    http://mingersoft.com/blog/2011/12/Why-wont-Windows-automatically-sleep/

    Best:

    http://helpdeskgeek.com/Windows-8/fix-Windows-8-1-will-sleep/

  • computer says bad password to sign the computer, by chance, that I started to put a bad password and now I cannot sign my computer.

    I can sign is no longer my computer, since I put a wrong password to connect by mistake.  Now I can't sign, as it says wrong password, I don't have a password reset disk? Help

    Hello

    Thanks for posting in the Microsoft Community.

    Please read this:

    Microsoft's strategy concerning lost or forgotten passwords:

    http://support.Microsoft.com/kb/189126

  • Help, please! HOW CAN I CANCEL A MERGER IN NETWORK ON VISTA BUSINESS?

    Recently, I'm new to Vista Business & while I was setting up networks I have merged with a wireless network, on the accident. Now, I have all of other windows programs on my hard drive & I can't undo that! I tried several times to restore but it fails. How can I reverse this? I want to just my old network LAN back! Help, please!

    I'm sorry, but there is no point at all. If you connected by mistake to an another unsecured wireless network, you do not have all their programs installed on your hard drive. You could see everything on the hard drive of this person if you look at what it is sharing, but all his stuff cannot magically transferred to your computer. If you know this person, it would be a good thing to explain why it is important to use good encryption on wireless networks. They are probably completely unaware of what they are doing and would be horrified to know that their stuff is visible in the world.

    Better, please explain what is the configuration of your network and what you were doing. If you try to connect to your wireless network, maybe you didn't your configured properly and that is why you connect to hers. This often occurs if both parties leave the default SSID (wireless network name). Example: If you have both left to 'Linksys', you could connect to the Linksys instead of your Linksys. Just for completeness, here are the instructions for implementing a secure wireless network:

    Have a computer connected to the router with an ethernet cable. Examples given are for a Linksys router. See the manual of your router or the router mftr's Web site. for the parameters by default if you don't have a Linksys. Open a browser such as Internet Explorer or Firefox and in the address bar type:

    http://192.168.1.1 [Enter] (it is default IP address of the router, which varies from router to router then check your manual)

    This will bring you to the login screen of the router. The default username is blank and the Linksys default password is "admin" without the quotes. Enter this information. You are now in the configuration of the router utility. Your configuration utility may be slightly different from mine. The first thing to do is to change the default password because * all * known default passwords for different routers.

    Click the Administration link at the top of the page. Enter your new password. MAKE A NOTE SOMEWHERE THAT YOU WILL NOT LOSE. Re-enter the password to confirm it, and then click Save settings at the bottom of the page. The router will reboot and show you the box of connection again. Do not fill in the user name and put it in your new password to enter the configuration utility.

    Now, click on the link wireless at the top of the page. Change the network name (SSID) wireless by default to something, you'll recognize. I suggest that my clients not use their surname as the SSID. For example, you might want to name your network wireless network "CastleAnthrax" or similar. ;-)

    Click on save settings and when you get the prompt that your changes were successful, click the wireless security link which is just beside the Basic Wireless Settings link (where you changed your SSID). Most computers purchased during the last 4 years have the wireless hardware that will support WPA2-Personal (also known as WPA2-PSK). This is the desired encryption level. If your wireless hardware is older, use WPA. Don't use WEP, because who is easily broken within minutes. So go ahead and set the Security Mode WPA2-Personal. Do this and enter a password. For example, you could use the password ' here be dragons, beware you scurvy dogs! The password is what you enter on all computers that are allowed to connect to the wireless network. MAKE A NOTE SOMEWHERE THAT YOU WILL NOT LOSE.

    At this point, your router is set up and if the computer that you use to configure the router will normally connect wireless, disconnect the ethernet cable and wireless of the computer should see your new network. Enter the password that you have created (exactly as you wrote it with all capital letters and punctuation) to join the network and start surfing.
    MS - MVP - Elephant Boy computers - don't panic!

  • error [122]

    This message happens before I can connect my mistake online game.:game [122], no suitable graphics device has been found, you are running through a remote session or a virtual machine? If this isn't the case, please, check the capabilities of your video hardware. Vista is new to me, so I don't know what to do. I know that on my other comput I had to change the resolusion (sorry if misspelled) to be able to play the game.

    Hello Tinytrouble,

    Thank you for visiting the website of Microsoft Windows Vista Community.

    Regarding your question, there is not enough information to diagnose your problem.  Please include information about your computer (details) and online, what game you play.

    In the meantime you can see the support of the game you play.

    This should solve your problem.

    Let us know if these steps solve your problem.  I hope the information is useful.

    Kind regards

    Anthony
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • BlackBerry Z30 z30 configuration problem

    Recently wiped my Z30 and gave my parents to try. We didn't have time, so only partially put in place before their departure for home, 2.5 hours drive.  I've defined to the point of needing to connect to wifi or mobile network, jumping id blackberry set up. Its their first hands on exposure to a touchscreen phone, and they are in their 70s. For 3 weeks, it was the last software update.

    They picked up a bell prepaid sim card before you end the game up on their wifi at home, the representative of bell inserted the SIM for them and off mobile data, because they intend to use only wifi connections.  I tried to help them connect to the wifi on the phone later that evening, and I think we connected by mistake to a neighbors wifi and we have no internet connectivity. they managed to send me a txt, but since that time they be kind of stuck in a loop of Setup.

    Looks like the phone trying to complete the installation routine, but he is stuck in a loop, try to connect to a network. He's stuck looking for a connection. a shot to the top does nothing, suddenly down only brings emergency call and a ways by scanning does not return to the home screen, just cycles between the network connection configuration screens 3. Ive had hold them the top for reset/shutoff button. It starts up by itself, shows the blue circle restart process and takes their return to the same connect to network screen, where it seems no get escape.cant to a settings screen to turn off wifi and correct the connection information. Have tried to reset several times.

    Ideas for breaking the vicious circle

    They are not used to swipe, and I can't me beam upwards at the moment to see if they are not to swipe up correctly andgive it to try it myself

    . If the phone thinks it is connected but doesn't have access to the internet, and the data are cut in mobile network settings, could it be stuck?

    have my PDP take out of reach of the neighbor's wifi to see if he will allow him to change the settings.

    You don't need a data plan. everything can be done via wifi.  your answer really had no bearing on the question I asked, but I appreciate the effort.

    The phone was blocked in a loop.displaying only 3 screens and does not accept any input and will re-start on efforts to extinguish in itself. Each reset woluld return to the screen in a loop.

    Once I was able to make the trip and get my hands on it, I was able to correct information wifi, after several attempts, as the screen jump, but only accept admission sporadically.the manual setting button would appear and disappear. One of the moments where I could touch the button at the right time, and then I was off to the races again. As soon as there's a wifi connection, internet access, it was ok.

    It seems that a WiFi with no internet connectivity was more that the installation program can handle.

Maybe you are looking for