Strange problem with this SQL

Hello

I'm trying to concatenate the value of SQL_TEXT in multiple lines in a single string using this SQL statement. The problem is that it works fine if I use the PIECE, but if I use SQL_TEXT I get this error ORA-30004: when you use the SYS_CONNECT_BY_PATH function, cannot have a separator in the value of the column. As you can see I tried a number of separators I know are not in SQL_TEXT but still error. And help would be great.

I tested on 11 GR 2 11.2.0.3 but need to run it on 10.2.0.4 so I can't use LISTAGG. I'm open to other methods but I don't have the ability to place and PLSQL nto the database. It must be done in SQL.
select 
  CURRENT_SID, 
  sys_connect_by_path(PIECE,'~') -- Works
  --sys_connect_by_path(SQL_TEXT,'') -- Does Not Work
  -- trim(max(sys_connect_by_path(SQL_TEXT,'~')) keep (dense_rank last order by CURR),'~') as FULL_SQL_TEXT -- Does Not Work
  --ltrim(max(sys_connect_by_path(PIECE,'!')) keep (dense_rank last order by CURR),'!') as FULL_SQL_TEXT -- Does Not Work
from
  (
  select 
      S.USERNAME, S.SID as CURRENT_SID, S.SERIAL#, T.PIECE,
      T.SQL_TEXT,
      ROW_NUMBER() over (partition by S.USERNAME, S.SID, S.SERIAL# order by T.PIECE) as CURR,
      ROW_NUMBER() over (partition by S.USERNAME, S.SID, S.SERIAL# order by T.PIECE) -1 as PREV
  from 
    V$SESSION S,
    V$SQLTEXT_WITH_NEWLINES T
  where 
    S.SQL_ID is not null
    and S.SQL_ID = T.SQL_ID
    and S.SID = sys_context('USERENV', 'SID')
  order by 
    T.PIECE
  )
group by 
  CURRENT_SID
connect by PREV = prior CURR
start with CURR = 1;

Hi SY,
Thanks for the reply that your SQL worked very well. You're right about the GROUP BY and AGGREGATIONS, I had tried so many different things, I had pasted in a version with a bit of my test which was a little strange looking.

The key was just as you say I was looking at my current SQL contained now my ' ~ 'or'!' delimiter. Thanks for all the help!

Tags: Database

Similar Questions

  • OK, what's the problem with this SQL?

    I just can't understand it:

    SQL > /.

    SELECT

    "CREATE or REPLACE trigger abc_ ' | seq___1.nextval | "_aiud" | CHR (10) |

    ' AFTER Insert or Update or delete on ' |  TABLE_NAME | CHR (10) |

    "New reference as new and old old ' | CHR (10) |

    "For each line. CHR (10) |

    'declare ' | CHR (10) |

    ' v_opr varchar2 (1); ' || CHR (10) |

    "start" | CHR (10) |

    "IF THE INSERTION CAN" | CHR (10) |

    "v_opr: ="I"; ' |" CHR (10) |

    "Update then ELSIF | CHR (10) |

    "v_opr: ="U"; ' |" CHR (10) |

    "ELSE" | CHR (10) |

    "v_opr: ="D"; ' |" CHR (10) |

    ' END IF; ' || CHR (10) |

    ' log_to_table ("ROWID", ' |) '''' || TABLE_NAME | '''' || V_OPR); ' || CHR (10) |

    ' end; ' || CHR (10) |

    '/ ' || CHR (10) |

    ' ' || «"CHR (10)»»

    From user_tables where rownum < 3

    ORDER BY table_name

    ORA-02287: sequence number not allowed here

    Hello

    remove the order clause contained in the query, it should work.

    Thank you

  • What is the problem with this pl/sql code?

    What is the problem with this statement of the cursor? I am getting PLS-00341 error for her:
    CURSOR cur_rsource(p_sql_stmt IN VARCHAR2) IS
            SELECT plan_table_output FROM v$sql s, table(dbms_xplan.display_CURSOR(s.sql_id, s.child_number)) t WHERE sql_text LIKE '''%'||p_sql_stmt||'%''';
    How to solve this problem?

    Thank you

    Published by: PhoenixBai on December 14, 2009 14:05

    I don't have time right now to study exhaustively, but for me his vomit ORA-00942 table or view does not exist on this line:

        SELECT sql_id, child_number into tmp_sql_id, tmp_child_number
             from v$sql where sql_text like sql_statement||'%' and sql_text not like '%v$sql%';
    

    I am able to select from v$ sql in normal SQL as user I am compiling as, so don't know why it's complaing.

    Anyone know if there are certain restrictions on access to the views v$ through PL/SQL?

    EDIT: http://www.dbasupport.com/forums/showthread.php?t=22299

    Access to the views of $ v seems to be through a role - try giving explicit access to it.

    As SYS, you must grant select permissions on V_$ SQL (V$ SQL is synonymous with V_$ SQL) to your owner of the procedure. Just tested on my system and it allows him to compile.

    Published by: Cyn on December 14, 2009 10:30

  • I have a strange problem with my RAM supported by installers. When I check the activity monitor, 3 installers are open and they start around 80 MB memory RAM used for about 7 or 10:08 minutes or so.

    I have a strange problem with my RAM supported by installers. When I check the activity monitor, 3 installers are open and they start around 80 MB memory RAM used for about 7 or 8 concerts after 10 minutes. I have to force them to quit, but I don't know what I am closing or why they open in the first place. Applications downloaded on iTunes?

    In addition, the Console has opened with the same message several times, but I don't know what that means.

    Any help would be appreciated.

    Hello

    The last is a picture of the Terminal window.

    Just because it lists 'Console' does not mean that it has nothing to do with this application.

    You have not said why or what you're trying to install so I can't help with that.

    You can use the activity monitor to leave their.

    After you select an item, use the X in a type of stop sign icon and confirm force quit.

    21:36 Thursday; September 15, 2016

     iMac 2.5 Ghz i5 2011 (El Capitan)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro (Snow Leopard 10.6.8) 2 GB
     Mac OS X (10.6.8).
     iPhone and iPad (2)

  • Satellite L850 - 1 H 4 - a strange problem with the FN key

    Hello

    I have a strange problem on my laptop. When I uninstall my PVAT my start "FN" key works, when I install it it s not working not properly. Its market not only the volume key (F9 and F10) without pressing the "Fn", if I want to press F9 or F10 I have to press FN + F9, even with the rest of the buttons.

    When I install PVAT I have to press FN, so I can use my F keys (e.g. F3 to search on the browser tool, alt + f4 - I have to press Fn + alt + f4), and I can't use real functions like mute, disable Touchpad etc. Use the volume keys only. Y at - it a problem if I run my computer without PVAT, this may affect its performance?

    Where could be the problem and can I fix it? I'm with Windows7 x 64, but the laptop was with no OS when I bought it. And there is a problem with this version, I bought its impossible to install the Pakc3 Service, it s with SP1, can be the problem? I put t know what to do... perhaps I run the laptop without PVAT, sounds good, because the buttons work fine without it, but I don't know if it interacts with something else.

    Thanks in advance!

    Its possible to use the function buttons by pressing another button without the use of the fn or FN.
    This option can be changed in the BIOS.

    Go to the BIOS by pressing F2.
    In the BIOS, choose Advanced-> system configuration Options
    Here you should find the option that allows to change the special function keys which allows you to use the function FN or without button Fn button

    By the way: this theme has already spoken here in the forum several times. therefore recommend that you use the advanced search to Forums before posting new thread

  • strange problem with Ericsson H5321

    Hello

    I have a strange problem with Ericsson H5321 on my X 230. Until a few weeks ago, the card worked perfectly as a modem (at least on Linux, so I guess it would be too much work in Windows). Unfortunately, a few weeks ago disappeared from the network manager modem connection. I checked that all the special device for this files still exist:

    $ because I in/sys/class / * / * {ACM, wdm} * / device/interface; echo-n "${i}: ';" $ Cat {i}; fact
    / sys/Class/TTY/ttyACM0/Device/Interface: H5321 gw Broadband Mobile Modem
    / sys/Class/TTY/ttyACM1/Device/Interface: H5321 gw Mobile broadband data Modem
    / sys/Class/TTY/ttyACM2/Device/Interface: H5321 gw Mobile Broadband GPS Port
    / sys/Class/usbmisc/CDC-wdm1/Device/Interface: H5321 gw management of mobile devices to wide band
    / sys/Class/usbmisc/CDC-wdm2/Device/Interface: H5321 gw Mobile Broadband USIM Port
    $ lsusb | grep Ericsson

    .. .and I also checked it works like GPS (at least kind of: it generates data on/dev/ttyACM2 NMEA streams, but cannot get a GPS fix even after 45 minutes with access to an open sky).

    Then I tried to run windows 7 and the card is visible in the "Device Manager", but there is also no possibility to create the GSM connection in the connection menu in the bottom right.

    I tried a new install of Windows 7, I tried to reset the BIOS (even with the removal of the battery backup), but still I can't force them to work again. My BIOS is fully upgraded BTW: the problem appeared during the use of 2.61 and I also tried with recently published 2.62.

    My cell phone is always on the extended warranty, but as modem bought in line with the basic configuration it was only covered by the warranty of 12 months has expired

    Today it came to my mind that, as the modem itself seems a little work (present, responsive GPS device) then maybe it's a SIM card reader that is actually damaged (which would explain a bit why the camera itself is present, but I can't create a connection). Can someone confirm or deny my theory? If it is valid, then I could still replace SIM card reader because it is part of the basic configuration.

    Thanks a lot for your suggestions!

    [Mystery solved: I managed to put the SIM card on a wrong side...;]
    [I hate myself so muuuuch;]
    ([btw: Lenovo could fix their SIM card reader, so there is only one possible way to put a SIM card using his corner of heart: it would have saved me 2 days of stress and an investigation;]) )

  • Strange problem with HP OfficeJet 6500 709n

    I have a very strange problem with my printer HP 6500 E709n wireless network.  I have recently upgraded to Windows 8 and everything worked well.  Then, all of a sudden I wasn't able to scan more.  The HP Solution Center says that the printer is disconnected.

    The weird part is that it appears in the section of Control Panel as active and properly connected printer and devices and I can still print to it, but not scan to it. He also says in the network section of the HP solutions center that the printer is connected and ready.  The printer is connected to my wireless network and I also use it with a Mac Mini.  The Mac can print and scan to it.

    No idea why this is happening and how to fix it?  Thank you.

    This problem of not being able to scan only started after upgrade to Windows 8?

    If so, then to solve the problem, you must first uninstall the Windows 7 software and then reinstall the software of Windows 8 long.

    To uninstall the software, follow these steps:

    1 right-click or press on and hold the lower left corner of the screen, then click or type programs and features. A list of installed programs.
    2. click or tap the name of your HP printer, and then click or tap on uninstall.
    3. follow the on-screen instructions to uninstall the software.

    After you have uninstalled it, go ahead and download the full software features for your printer. It can be found on the link below.

    Driver and HP Officejet Full Feature software

    Install this version of the software and try to scan now!

    Let me know if it works for you, good luck!

    -Kyle

  • Strange problems with the database

    Hello

    I just got my Fuze and am very happy with it; However, I am having a very strange problem with the database. I have a 16 GB sdhc card that I use with the "rocket" and there are about 4 songs on the card that will not play and have no information charge tag. Their tags appear in the tag browser (not the in the track information screen) as just an empty rectangle. Under the track information screen, sizes are listed as ~ 4000 mb. The songs will not play and I can not jump in front of one of these songs once they were loaded.

    At first, I suspected some kind of corruption of tag, so I set out that night to track down the problem. I removed the 16 GB card and reset the player. Then, I loaded one of the corrupt in the internal memory of the player. The track has been scanned and played correctly. Then, I removed the track of the internal memory and it loaded on another SDHC card. Yet once, everything worked correctly, so I knew that the card I was using was a kind of system files or physical problem. I returned the original 16 GB sdhc card in the reader and checked that the file was still unplayable, and then I plugged the "rocket" to my computer. I transferred the unplayable file on my computer and compared (with md5sum) to the original file, thinking that if there was the file system or physical corruption the copy of the map would be damaged. However, the files were equivalent.

    To make things even more interesting, I also have problems with the registration of the kind. I have some files tagged Genres such as 'Classic' and 'Rock '. In the list of the genre, I see this:

    C

    CL

    CLA

    CLAS

    Class

    Classic

    Classic

    Classica

    Classic

    Rock

    So, there is corruption on the kind of 'Classic' but not the kind of "Rock". Each of the substrings of 'Classic' contains only a few titles, with most of the other titles listed where they should be. I checked that the tracks are labeled correctly and in exactly the same way as the other tracks that do not have this problem.

    I am at a total loss about what to do, and I'd really appreciate any advice or suggestions. I use the current firmware, 2.03.31a and the songs in question are in Ogg Vorbis format.

    MM

    Thanks for your replies.

    I managed to find what may be the problem. Tracks that received corrupt tags had the names of total path with more than 256 characters. It seems that the driver internal fat32 the rocket uses vomits all over the place when the path name is too long. Before the "rocket", I got an iPod running rockbox tags with the same directory structure that I have on the "rocket", so I don't think that this restriction on the length of the path name is a limitation or requirement of the fat32 file system. Reduce the path corrected the problem with the files being unreadable.

    However, the problem with foires genres the rest. Looking at the files show that corruption, they all have a little information in tags. Most of the information is contained in the hashes I have files that identify them via musicbrainz. The limit on the total number of characters in the tags of the track includes the "rocket" label is not read or use?

    MM

  • Strange problem with BT Headset!

    Hello

    I have a very strange problem with BT headset.  My Z3 is model of official unlocked Docomo of SO - 01 G.  I got PlayStation Voxtube 500 BT headset BT version is THE 4.0.  This headset has been used with Nexus 5 (Android 5.1.1) without any problem and the battery last almost a week to stanby with a few minute talk time per day.  However, after not getting Z3 with Android 4.4.4, pairing with Voxtube has no problem.  Then, the battery is discharged within 4-5 hours stanby.  I tested it for 3 or 4 times, it has come down to that there must be something worng with the battery of the headset.

    So, I got with PlayStation representative claim (it is only a few months old).  Surprisingly, representative of PlayStation has all the test suggested no stanby time problem with their phones iPhone 5 or Sumsung Galaxy S5.  Then I took back recharged so its performance is very short wait duration the same as before.  So, I tested it with my iPad Mini 3 and performance return to normal standby time.

    So, it can be concluded for only problem is with the Z3. But once again with the mating with the other headset BT Jabra Tag2, stanby time is within the normal range (4-5 days).  When that happens?  I am very confused. Should I give up on PlayStation?

    Thank you for your time,

    Simply upgrade to 5.0.2 lolipop and hope this will help me on this issue.

  • Problem with Top SQLs report

    Hello

    I have a big problem with Top SQLs reports, when I generate a report of high SQLs, SQL, the value text is not end, I know that there is a "The SQL text size" setting on the properties of the agent (this configuration is also on the collections setting ' Ta maximum size in characters of the short collects text of the SQL statement is ") on the two options , I've incremented the value of 256 (default) 1500, but when I generate the Top SQLs postpones continue it problem, once the changes I restarted the agent but the problem persists, I generate the report on the different formats, but result is the same, could you help me please.

    Thank you.

    Best regards.

    I see this in support KB article https://support.software.dell.com/kb/109536

    "

    • Title

      SQL in DB2 Top instructions are truncated in the delivered report of Top SQL

    • Description

      SQL in DB2 Top instructions are truncated in the delivered report of Top SQL

    • Resolution

    • Resolution A DDB-3673 request improvement with Support software Dell to show the full text of SQL high in the report Top SQL for DB2.

      Workaround At this point you should be able to make a custom report by cloning the Top SQL existing and then customizing report. »

    I know that this is not the solution, more of an explanation and guidance on how to solve this problem by using customizations.

    Golan

  • Strange problem with HorizontalFieldManager - it does not show on real device bitmap

    I have a rather strange problem with the HorizontalFieldManager on my Blackberry 8820, which I did not on the Simulator, or done other blackberries that I tried to install my game.

    The problem is that bitmaps that I add, do not appear on the actual device, as in the images below. The code is provided below as well. No idea how to debug, or resolve is appreciated.

    Here's what I see on Simulator and some devices

    Here's what I see on the real blackberry:

    Code:

    ......

    OK, I found the solution - the problem is that there seems to be a bug where you can't put more fields button radio on a horizontal layout manager with 4.2.2.x.

    The solution is to extend the RadioButtonField field and replace the positioning method:

    RadioButtonField radioField = new RadioButtonHack ("", textureGroup, isSelected);

    SerializableAttribute public class RadioButtonHack extends RadioButtonField {}

    public RadioButtonHack() {}
    Super();
    }

    public RadioButtonHack (String label, group RadioButtonGroup,
    Boolean selected, long style) {}
    Super (label, group, selected, style);
    }

    public RadioButtonHack (String label, group RadioButtonGroup,
    Boolean selected) {}
    Super (label, selected group);
    }

    public RadioButtonHack (label As String) {}
    Super (label);
    }

    Protected Sub layout (int width, int height) {}
    int temp = this.getPreferredWidth ();
    setExtent (time, height);
    Super.Layout (time, height);
    }

    }

    resolved http://supportforums.blackberry.com/t5/Java-Development/radiobuttonGroup-related-problem-in-storm/m-...

  • Strange problem with ASDM

    Hi, today we had a strange problem with one of our 5550. I worked through ASDM on it and all of a sudden I couldn't connect via asdm on the interface of management or inside interface. Nothing helps.

    When I connected with a vpn, then use asdm, it works. My ip on the network when it did not work was 1xx.xxx.81.235. When I use the vpn is a 1xx.xxx.55.1 from a different ip address. I can build a connection on the inside interface with asdm (with vpn).

    I tried closed and without stop the interface of man, that does not.

    It may be that the things asa, I am an intruder and dynamically blocks my netwerk range? If yes where can I find this info.

    Other users of our team had the same problem.

    I also checked the syslog nothing.

    THX,

    Marc

    Although I've ever experienced this myself, but if the running-config has not changed and worked before its possible that the ASA

    may have shunned your connection?

    To the CLI:

    # sh shun

    look if your IP address is present, if any make:

    # claire shun

    http://www.Cisco.com/en/us/docs/security/ASA/asa80/configuration/guide/protect.html#wp1058270

    More than likely it is do to a change to the running configuration, I would start by looking at a previously working with the gift of running-config running-config.

  • strange problem with the database link

    Hello world

    I have a strange problem with the link of database in Oracle 11 g Express Edition;
    There are two computers: computer-server and the client computer. Tnsnames.ora are the same on both computers IE.

    CT =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = krzysztof) (PORT = 1521))
    )
    (CONNECT_DATA = (SERVICE_NAME = XE)
    )
    )

    I created the database link:

    Create database link zdalny
    Connect to < user_id > identified by < password >
    using "CT".

    Customer cannot connect with server when I do not use above the command. But when I change 'use' for using "krzysztof:1521" or by using "krzysztof" or "server IP:1521" - everything is ok.

    Why I ask. Because in all the materials that I read about Oracle command with the help of "CT" should work correct. But there is no. Do you know why?

    Thanks in advance and apologize me for my English.

    Rgds
    Krzysztof

    Here's the tnsnames of your server, but to connect to the oracle server db (any client or to another instance of db oracle), you must install oracle client.
    However, in your condition, you want to connect the DB1 Oracle OracleDB2 using a link db, I'm right? In this case you should always set the entry in the tnsnames.ora
    To verify that you can connect to Oracle DB2 from DB1 Oracle, you can use tnsping in the command line.
    In your case

    c:\tnsping CT
    

    Krzysztof Szymaniak wrote: CT =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = krzysztof) (PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    )
    )

    Check your tnsnames entry in the machine, you are trying to connect to. And check if the tnsping is successful.
    Sometimes the error message says not everything, which means that you need to troubleshoot yourself and learn from the experience.
    Always in the opposite case, refer to the documentation.

    See you soon.

    Published by: Spongebob December 14, 2011 09:30

  • Strange problem with find/replace

    I'll have a little strange problem with find/change in InDesign CS4 Mac.

    The document is a data merge.  In the worksheet, there are two fields that contain either a '@' or a '&', depending on the context.  These are just placeholders - the plan was to convert glyphs of the police 'Wingdings 2' after creating the merged document.  We do it this way because we couldn't figure out how to get the glyphs themselves in the .csv file.  Two glyphs are < FO54 > and < FO56 >.

    First I used find/replace to change all the '@' symbols to < FO54 >.  That has worked well. But then when I tried to change the symbols "&" < FO56 >, I got the < FO54 > again instead.  In fact, now I ask what glyph, I get < FO54 >.  Find/replace always normally works for normal text... it of just that he seems to have decided that if I ask a glyph, I get < FO54 >, anything.

    I tried to shut down and restart, but the bug is still there.

    Any thoughts?

    I used the tabs of glyphs in find/replace when I tested it, but what you describe seems to work as well.

  • Strange problem with the formatting of the text

    Hello

    I had a strange problem with the formatting of the text. I created a document in Polish language and the strange thing happens when it divides the word to the next line. For example here on this part of the page, I have a word "umieszczamy", which should be divided "' u - CEF - szcza - my", but my Indesign divides in umi-eszczamy (as shown on the picture). " How can I fix it so it divides the word correctly?

    Concerning

    forum.jpg

    What language is awarded when you select the text? Hyphenation, but also the spelling, is controlled by the dictionary that is assigned to the text.

    If the language is correct, you might have to change the hyphenation in the user dictionary.

Maybe you are looking for