Question about correct use of WM_CONCAT

Good morning,
I'm trying to accomplish the following:
starting with this
     ENAME
     ADAMS
     ALLEN
     BLAKE
...and ending with this
     OLD_NAME   NEW_NAME
     ADAMS      AADMS
     ALLEN      AELLN
     BLAKE      ABEKL
...basically, alphabetically sorting the characters inside each name. I have an intermediate step that looks promising
select e.ename oldname, substr(e.ename, iter.pos, 1) newcharpos
  from emp e,
       (select rownum pos from emp) iter
where iter.pos <= length(e.ename)
order by e.ename, substr(e.ename, iter.pos, 1);The above yields
OLDNAME    NEWCHARPOS
ADAMS      A
ADAMS      A
ADAMS      D
ADAMS      M
ADAMS      S
ALLEN      A
ALLEN      E
ALLEN      L
ALLEN      L
ALLEN      N
BLAKE      A
BLAKE      B
BLAKE      E
BLAKE      K
BLAKE      L
...the individual characters are in the right sequence, I figured all I had to do was to use WM_CONCAT (and replace the comma it inserts with the empty string) and I'd be done. I figured this would do it: (replace of comma left out for clarity)
select oldname,
       wm_concat(newcharpos) newname
  from (
        select e.ename oldname, substr(e.ename, iter.pos, 1) newcharpos
          from emp e,
               (select rownum pos from emp) iter
         where iter.pos <= length(e.ename)
         order by e.ename, substr(e.ename, iter.pos, 1)
  group by oldname;but the sequence of newcharpos gets messed up in the process and, instead of the expected result, I get this:
OLDNAME    NEWNAME
ADAMS      A,S,M,D,A
ALLEN      A,N,L,L,E
BLAKE      A,L,K,E,B
...My question is, how do I structure the last query so the character order stays as calculated in the inner query ?
Thank you for your help,
John.

Or
SQL> select   oldname,
       wm_concat(newcharpos) keep (dense_rank last order by null)  newname
  from (
        select e.ename oldname, substr(e.ename, iter.pos, 1) newcharpos
          from emp e,
               (select rownum pos from emp) iter
         where iter.pos <= length(e.ename)
         order by e.ename, substr(e.ename, iter.pos, 1)
  group by oldname
OLDNAME    NEWNAME                      
ADAMS      A,A,D,M,S                    
ALLEN      A,E,L,L,N                    
BLAKE      A,B,E,K,L                    
CLARK      A,C,K,L,R                    
FORD       D,F,O,R                      
JAMES      A,E,J,M,S                    
JONES      E,J,N,O,S                    
KING       G,I,K,N                      
MARTIN     A,I,M,N,R,T                  
MILLER     E,I,L,L,M,R                  
SCOTT      C,O,S,T,T                    
SMITH      H,I,M,S,T                    
TURNER     E,N,R,R,T,U                  
WARD       A,D,R,W                      
14 rows selected.Or (11gR2)
SQL> select ename oldname, column_value newname
  from emp,
       xmltable(('string-join(for $i in (' || rtrim(regexp_replace(ename, '(.)', '"\1",'),',') || ') order by $i return $i, "")'))
OLDNAME    NEWNAME                      
SMITH      HIMST                        
ALLEN      AELLN                        
WARD       ADRW                         
JONES      EJNOS                        
MARTIN     AIMNRT                       
BLAKE      ABEKL                        
CLARK      ACKLR                        
SCOTT      COSTT                        
KING       GIKN                         
TURNER     ENRRTU                       
ADAMS      AADMS                        
JAMES      AEJMS                        
FORD       DFOR                         
MILLER     EILLMR                       
14 rows selected.

Similar Messages

  • Question about Automator using Spaces.

    I don't think this is the right place for this question, but I figured I am probably going to need to write an applescript to do what I want, so I decided to put it here.
    I have an automation to open some Word documents on my idisk, then open Dictionary, then open Safari with some tabs. But the problem comes in with spaces. I have Word and Dictionary open on Space 1 and Safari open in Space 3. When the automation ends, I end on Space 3 and would like to know how I add a function to set the focus back to Space 1. It's not all that detrimental to the success of my Automation, but I only use Safari for research and would like to focus to end back on word. I have tried switching which apps open first, but I still end up on the 3rd Space.
    My other question is, where can I go for reference to commands in Xcode and AppleScript that deal with Spaces? I love using that function and I have had some ideas about scripts that could help me with them, but I don't even know were I would start with commands.

    There are several solutions to this.
    The first option would be to send the appropriate key command to switch to space 1. If you've left your preferences as the defaults then you can:
    <pre class=command>tell application "System Events" to keystroke "1" using {control down}</pre>
    Which will send a Ctrl-1 and switch to space 1.
    An alternative, which may be even better, is to activate the application you want to be frontmost:
    <pre class=command>tell application "Microsoft Word" to activate</pre>
    This should activate the application and switch to that application's space.

  • I have a question about ' correct for aspect ratio'

    I have recently completed a wedding video, and the bride and her family have expressed disappointment that my footage make them ' look like a group of dwarves....  small and fat'.
    My initial reaction to this was to say there is nothing I can do about their shape, however I did agree to investigate further. I have checked my cameras to ensure that I am filming in 4:3 aspect ratio.
    I have noted tonight however that final cut (I use Final Cut Express 4.0.1) has a tool that allows you to 'correct for aspect ratio'. I cannot find reference to this in the user manual (although I am sure it is there). When I apply this to any clips, it does appear to stretch the images upwards/ vertical.
    Should I be using this all times before editing?
    Is this perhaps the cuase of the dwarf effect on the final footage? I have never had any complaints before.
    Any help or experience would be appreciated.

    Here is a screen shot of the clip properties. Pixel aspect is PAL- CCIR 601.

  • Question about forum use regarding an error I am receiving

    I am looking for an answer to the proper process I should follow when running into issues with Azure Storage. As I don't want to annoy folks with tossing questions into this forum regarding errors I'm running into that are more usage related instead
    of technical in scope.
    For instance this morning I was attempting to view some details about a particular Storage item and was greeted with the following screen in the Azure Portal.
    I was able to accomplish what I needed to (downloading some files out of this particular storage account) within the Manage.WindowsAzure.com site without issue. So this seems to be connected to the portal itself and it's interactions with Storage
    (perhaps). I now have access to the above Storage item via the portal site, but for about 15 minutes I continually received the message above. Even after logging out, clearning cache, trying different browsers etc.
    So my question(s) are; Are these forums the proper place to be posting information about issues we run into? If not what is the preferred method for reporting items like those above and getting help with remediating them in a timely manner?
    I'm happy to put them here, just want to make sure there isn't a better place as I'm new to this.

    Hi Darren,
    You can post your issue with Azure Storage in here. Just make sure that you do not give out any PII data.
    Also, the above portal which you are viewing is still in preview. You may use "manage.windowsazure.com" portal to access your resource.
    Regards,
    Manu

  • Question about design - use patch-panels or switches in racks?

    I'm trying to suggest should I use patch-panels in server 19" racks and use stand-alone telecomm racks for access layer switches
    OR
    should I install 2-3 access layer switches in every server rack?
    First version looks more correct, but than I have to use MUCH MORE cables, organizers etc - all of it eats place in data-center.
    Maybe someone saw some guides for that question?
    Thanks!

    2 or 3 access layer switches in every server rack? Considering typical stand-alone rack switches offer 24 or 48 ports, how many servers per rack or how big are these racks?! Or, were your intended access layer switches only 4 port switches?! (laugh)
    The main disadvantage of rack switches, you either run out of ports or have too many ports. Since server hosts often push bandwidth harder than user hosts, you also have the issue of how much aggregate bandwidth you need to move out of an individual rack. These issues are better addressed by your suggestion of using patch panels from each rack that come to a network switch rack.
    You're correct, all the cables, and their organization, has an expense, but this has to be considered against switch costs. Assuming you intend to use Enterprise switches that offer gig to the servers and perhaps 10 gig uplinks, there's a cost to having extra swiches by deploying to each rack. Also switches per rack would disallow the advantages you might find with a chassis switch in a switch rack. Further, depending on performance to provide, do you want to be limited by uplink bandwidth from each rack, or pay for high bandwidth from each rack that's usually underutilized.
    Besides "looking right", the foregoing is often why there are server rack patch panels, etc.
    One design, that I found interesting, was using the 3750 "stacked" across racks (guess you could do same with newer 2975s).

  • Question about planning using serialization point in transaction S2L

    Hello colleagues!
    Iu2019ve try to implement the supply of production line (supply area) just in sequence. R/3 received dependent requirements and backflushes of serialization point behind target Supply Area from APO.
    Then I got a few dependent demands with indicator u201CXu201D in u201Crequirement is serializedu201D field in transaction S2L. I started the automatic planning  but replenishment proposal was created to cover all dependent demands. from the selection horizon  (with ind. u201CXu201D and without ). But I need to cover dep. demands only with ind. X in u201Crequirement is serializedu201D field. I looked through SAP help and SPRO but I couldnu2019t find helpful information.
    Please, help me to find solution.
    Thanks.
    Ivan.

    Thanks for the feedback. I followed the link but I guess I just don't understand about the extended file system. Is HFS+ the same as Mac OS extended (Journaled).
    Basically, yes.
    I understand that I guess that case sensitive means just that, but what is the difference between journaled and extended? Does it mena that a log file is only saved for the journaled system?
    When a filesystem is journaled, all changes to it are written to a log.
    Do most people just format as Extended without journaled? I am about to reformat my iMac and install Leopard on there and I was wondering if I should format using the extended or the extended with journal?
    Using the journaling option slightly decreases the amount of space on the drive usable by you and increases the chance of recovering data from the drive if a problem occurred. If you want, you can use the Disk Utility to turn it on and off without erasing the drive again.
    (25598)

  • Question about Correcting Errors in the Converted Model

    Hi,
    I've used SQL Developer (v1.5.1) to capture (offline) the DDL from a Sybase 12 DB and have converted this to Oracle, which all seemed to run ok. However, I noticed some errors in the Migration Log. None of them have the prefix 'Parse Exception' so, according to the online help, no manual intervention is required to resolve them.
    I don't even know if the contents of the migration log are a problem, generally they can be grouped under one of the three headings below.
    "*Multiple Limitations for Stored Procedure* extUpdateExtSuccess 03-SEP-08-16:09:41"
    "*Translation limitation* '@@ERROR' encountered on Stored Procedure CorporateActions.dbo.extBMDeleteBatchSchedule line 14 column 4 03-SEP-08-14:53:23"
    "*Index* 'XPKSpinOffExt' on table 'SpinOffExt' *has been dropped as it is a duplicate of a constraint* 03-SEP-08-14:39:26"
    Are these errors something I need to do something about before I try generating the DDL? Are they related to Sybase (which I know very little about).
    Online help is not very helpful on this subject.
    Thanks,
    Antony

    Hi, Hareesh
    I agree. But that is how it is defined now by someone else. It is hard to change it as he defines the same structure on the receiving side. I didn't want to change the receiving structure as it touches the proxy code too. So I want to make something short and sweet.
    Basically the data looks like this:
    11,222
    55,666
    The result xml should be something like:
    <JOB>
      <Msg>
         <Transaction>
            <DATA>
               11
               222
            </DATA>
         </Transaction>
         <Transaction>
            <DATA>
              55
              666
            </DATA>
          </Transaction>
      </MSG>
    </JOB>
    I know either the DATA has no meaning and it's giving me a headache ... but that's how it's done and I don't want to rock the boat too much. There are lots of mapping that I have changed otherwise.
    Thanks,
    Jonathan.

  • Qosmio G40-10Z: Question about energy use in sleepmode

    When I turn my new Qosmio G40-10Z in sleeping mode, with full battery (and off the AC power), I can't start the computer next day. I can only start it up after connecting it to AC power. I get a message windows Vista wasn't closed properly and I am asked to start in normal way or safe mode.
    After starting the battery indicates only 2% power. So, what is using power in sleeping mode? Why isn't the sleep mode not transferred to hibernation state when the battery is almost empty?
    (New notebook, only vista and office installed and only television antenna is connected)

    Hello guys
    At first I just want to write a little bit about theory. Microsoft has implemented standby/Hibernation mode to offer PC users comfortable OS usage and make switch ON/OFF time much shorter.
    According to the definition standby mode should be used for short time (launch, meeting and if you must leave the notebook for few hours). Hibernation mode should be used if you leave the notebook over the night or maybe day or two. In standby mode all data will be written in RAM and to keep them notebook needs power. In Hibernation mode all data will be saved on to HDD and notebook can be switched OFF. In hibernation mode the notebook does not need permanent power supply.
    For me it is really strange that you use standby mode with battery and almost 20 hours. With this I do not want to say that described battery issue is normal but for 20 hours it is logic to use hibernation mode.
    Back to battery issue: only 20 hours under standby mode is really to short. I have tested it with my Tecra and after 5 days I was able to switch ON notebook as usual (only battery power supply.
    In your case I see only two explanations:
    1. Somehow notebook can not switch into standby mode properly and stays running (I do not believe this because you can see if something like this happen)
    2. The battery is defective
    What you should do is to contact Authorized service partner in your country. Make a call and explain the situation. Maybe you will get new battery or they should test it using your battery.
    Sorry for this long posting. I wish you luck and hope you will clarify this issue very soon.
    Bye and good luck!

  • Question about Parallels using Bootcamp partition

    I was about to install XP on bootcamp but i would mainly be using parallels to run XP from the bootcamp partition. What i was wondering is that if i was to make any changes to xp like install a software and create a new folder through parallels, would it reflect on the actual bootcamp partition when i load into the actual XP partition using bootcamp? Basically, do the changes made to windows using parallels carry over to the bootcamp partition given you are using the bootcamp partition on parallels?
    Thanks

    Thanks a lot. While i am at it, if i use the bootcamp partition with Parallels, i cannot suspend the VM right?
    Parallels will behave the same, whether it has its own copy of Windows, or is using that on the Boot Camp partition.
    The only difference is backup. If you use Parallels with Windows in a disk image file (Preferably a sparse bundle), Windows can be backed up with Time Machine. If Windows is on its own partition, Time Machine can't handle it.

  • A question about correct SEU in Virtex4 LX25 FPGA

    I have a problem when I scrube the DSP, IOB, CLK, CLB using the data stored in the Flash to correct the SEU in Virtex4 LX25 FPGA. This is my flow chart:
    step1: read the state register to verify the state register
    step2:  read the control register to verify the control register
    step3:  write a 32bit data to FAR register and read FAR register to virify the FAR register
    step4:  scrube the DSP, IOB, CLK, CLB logic in the Virtex4 LX25 FPGA using the data stored in the Flash(I shield the LUT RAM and SRL16).
    Problem: when the step4 is done, if I immediately implement the step1 the scrube programe can influence the CLB logic. But when the step4 is done, if I delay 0.1s to implement the step1 the scrube programe has no influence on CLB logic.
    Is this means that I should wait a minute when I begin the next scrube process? Thank you in advance. 
     

    Hi Lesea, Virtex4 is not supported by Soft Error Mitigation (SEM) Core, and I need to protect the Virtex4 LX25 FPGA by simple scrubbing. The configuration management engine I designed is the same as that in Correcting Single-Event Upsets in Virtex-4 FPGA Configuration Memory. I also do the fault injection experiment, and the configuration management engine can correct the faults in the Virtex4 LX25 FPGA.
    On my board: digital signal A---->encode---->D/A---->A/D---->decode---->digital signal B
    When I don't scrubbing the FPGA, the signal B is always the same as the signal A, so I think my board and the software in the FPGA operate well. When I scrubbing the FPGA too frequently, the signal B is not always the same as signal A(I only scrubbing the DSP, IOB, CLK, and CLB logic and I shield the LUT RAM and SRL16 logic). So I think the problem is caused by my configuration management engine.
    I also find that the time between two scrubbing process can not be too short. For instance, if I delay only several clks(2.3825MHz) before the next scrubbing process, the signal B is not always the same as the signal A. But if I delay 0.1s, 1s or 10s before the next scrubbing process, the signal B is always the same as the signal A. So how can I solve the problem? I can do experiment to find the minimal time between the two scrubbing process that have no influence on my software. I want to know what causes this problem. Thank you:)
    Regards,
    Zhiyuan Peng
     

  • Questions about Military use

    Hey all, my wife is going on her second deployment to Kosovo and this time we were told they have WIFI in their rooms! Awesome! So through the wonders of ebay I bought us both iSight cams for our macs. They work great with iChat.
    I was wondering if there are any issues we should look for? Or maybe a different messenger service we should have as a back up?
    Anyone have any experience with this?
    Thanks in advance!
    -Stephen

    Hi,
    Like CodLBi has said it is going to be about Firewalls or at least which ports the LAN has open and the Connection speed and the Bandwidth share that are going to effect this the most. (Not to mention any "Security" concerns about apps that can send files and Pics)
    If it is the Miltary that control the LAN and Internet link then they might move on the ports (they have in the Gulf).
    As to Bandwidth that will depend on how many other people are using the LAN At them same time and what they are doing on-line.
    I presume it is not the Mac Pro she is taking
    That could run Windows XP with Boot Camp or Paralleles and would be one way round as AIM on a PC moves it's ports around and that may have provided a solution.
    See the links 5-9 on this section of my page 5.
    10:56 AM Friday; June 29, 2007

  • Question about the use of the logger

    I am trying to use the logger but it seems that unless i create a location named: "myview.class", i will not be able to see it? is this correct.
    This code is generated automatically:
    <b>private static final com.sap.tc.logging.Location logger =
    com.sap.tc.logging.Location.getLocation(myView.class);</b>
    And i can not change it, so if i dont have the location i can not use it.
    <b>logger.errorT("myMessage"); - this will not be seen.</b>
    The only way i could see my log messages was if i did this:
    com.sap.tc.logging.Location.getLocation("ExistingOldLocation").errorT("mymessage");

    Hi Erez,
    You have to create a location like this. E.g. I have class
    com.dbeisert.Hello that has logger.
    public class Hello{
    private static final com.sap.tc.logging.Location logger =
    com.sap.tc.logging.Location.getLocation(Hello.class);
    If you create a location with the name of "com.dbeisert"
    everything in this package and each subpackage will be logged to this location. So just create location with the package prefix of your application and logging will work for each class under this package. It is basically like Log4J.
    rgds
    David

  • Some questions about the use of the relay

    I connect Relay coil  to the AC power source,but  the switch always act.Is there any suitable relay for ac power ?
    and when I replaced time delay relay in simulation, there was an error.  I don't know how to get the right parameter setting ?
    please help.
    Attachments:
    time_delay relay.png ‏5 KB

    Hi there,
    Thank you for your question. There are two ways to do this, for your origianl circuit you can connect the time delay relay in this way:
    Set the frequency of the source to 1Hz and simulate, then you can see the NC and NO switch back and forth.
    Second method: Instead of using a AC relay, we can use an AC coil which can be found at Electro_Mechanical-->COILS_RELAYS-->ENERGIZING_COIL_AC
    In addition, we can add a normally closed (NC) contact or a normally open(NO) contact spicified for this AC coil(say K1)
    Just type RELAY_CONTACT_NC or RELAY_CONTACT_NO to place the components and then place them under K1.
    Change the Controlling device reference as shown in the picture below,
    Now the AC relay can be constructed in this way.
    For time delay, we can use TIME_DELAY_NC and TIME_DELAY_NO contact
    Hope these two methods help!:-)
    Best,
    Chen_T
    National Instruments

  • Question about the use of asdoc

    I want to use asdoc to compile the flex SDK documentation myself. The reason is I need it in another format, and for a specific SDK (4.5.1).
    I simply cannot get it to run. Out of the box, what should the command line look like if I'm in the bin the bin folder? Everything I try just keeps throwing errors.

    1002099 wrote:
    +"When an application completes, you need to close any connections that you have created. Failure to close a connection can cause resources not to be released by the JMS provider. Closing a connection also closes its sessions and their message producers and message consumers.+
    +queueConnection.close();+
    +topicConnection.close();+
    +Before your application can consume messages, you must call the connection's start method; for details, see Section 3.5, "Message Consumers." If you want to stop message delivery temporarily without closing the connection, you call the stop method."+
    Should I close the connection as the last paragraph say?. If so, I don't know how to do it without lose the service, because if I call "close" method on the connection and immediatelyi start it, i will lose all my consumers and producers for a little time.
    You should close a connection when you have no further use for it as this will release resources.
    You must start a connection if you want to receive messages from it.
    Most applications don't use stop(). However if your application needs to temporarily pause delivery of messages (to the application) for some reason, call stop(). When your application wants delivery of messages (to the application) to restart, call start() again.
    Nigel

  • Question about the use of JMS connections

    Good Morning,
    I'm a new user of JMS technology. I'm having some problems with the performance of my application. Specifically, i'm developing a 24x7 application. We are using MessageListener for all consumers.
    Doing performance and continuity tests I detected memory leaks in certain JMS classes. After passing a profiler tool, I saw a large amount of ObjectMessage and Message instances. We are not closing the session, MessageListeners, MessageConsumers or Connetion instances because we want to reuse them all the time, and we can't close them because we lose the high availability service.
    Reading, the JMS tutorial, I'm saw this paragraph in the "Connection" section:
    +"When an application completes, you need to close any connections that you have created. Failure to close a connection can cause resources not to be released by the JMS provider. Closing a connection also closes its sessions and their message producers and message consumers.+
    +queueConnection.close();+
    +topicConnection.close();+
    +Before your application can consume messages, you must call the connection's start method; for details, see Section 3.5, "Message Consumers." If you want to stop message delivery temporarily without closing the connection, you call the stop method."+
    Should I close the connection as the last paragraph say?. If so, I don't know how to do it without lose the service, because if I call "close" method on the connection and immediatelyi start it, i will lose all my consumers and producers for a little time.
    Any suggestion?
    Thank you in advance,
    Regards

    1002099 wrote:
    +"When an application completes, you need to close any connections that you have created. Failure to close a connection can cause resources not to be released by the JMS provider. Closing a connection also closes its sessions and their message producers and message consumers.+
    +queueConnection.close();+
    +topicConnection.close();+
    +Before your application can consume messages, you must call the connection's start method; for details, see Section 3.5, "Message Consumers." If you want to stop message delivery temporarily without closing the connection, you call the stop method."+
    Should I close the connection as the last paragraph say?. If so, I don't know how to do it without lose the service, because if I call "close" method on the connection and immediatelyi start it, i will lose all my consumers and producers for a little time.
    You should close a connection when you have no further use for it as this will release resources.
    You must start a connection if you want to receive messages from it.
    Most applications don't use stop(). However if your application needs to temporarily pause delivery of messages (to the application) for some reason, call stop(). When your application wants delivery of messages (to the application) to restart, call start() again.
    Nigel

Maybe you are looking for