Best way to extract strings

Hello

I need to extract the value of the strings for REQUEST_GROUP_CODE and REQUEST_GROUP_APPL_SHORT_NAME. As you can see I have to deal with differences in whitespace, case differences etc. I need the values between the quotes for each of them. I expect to get ACCOUNTANTS and AR procedures for the first example. I use db 11g r1 version.
Thank you.
WITH TEST AS 
(SELECT 'REQUEST_GROUP_CODE="ACCOUNTING" REQUEST_GROUP_APPL_SHORT_NAME="AR" TITLE="AR:AR_SRS_TITLE_ACC_RPTS"' str FROM dual
UNION ALL
SELECT 'REQUEST_GROUP_CODE = "PRINT_CONSINV"REQUEST_GROUP_APPL_SHORT_NAME = "AR"TITLE = "AR:AR_CONS_INV_WINDOW_TITLE"' FROM DUAL
UNION ALL
SELECT 'REQUEST_GROUP_CODE="JL_CO_MG_REQUEST_GROUP"                                           REQUEST_GROUP_APPL_SHORT_NAME="JL"  TITLE="JL:JL_CO_GL_MG_WINDOW_TITLE"' FROM DUAL
UNION ALL
SELECT 'Request_Group_Code="OE_CONC_PROGRAMS" Request_Group_Appl_Short_Name="OE" Title="OE:OE_SRS_TITLE_CONC_PROGRAMS"' FROM DUAL
UNION ALL
SELECT 'TITLE="INV:INV_INVENTORY_COSTS_REPORTS" USE_ORG="Y" REQUEST_GROUP_APPL_SHORT_NAME="INV" REQUEST_GROUP_CODE="INV_COST_REPORTS_GUI" PROGRAM_APPL_SHORT_NAME="BOM"' FROM DUAL
)
SELECT str
  FROM TEST
Published by: Vortex13 on June 20, 2012 09:12
SQL> WITH test AS
  2  (SELECT 'REQUEST_GROUP_CODE="ACCOUNTING" REQUEST_GROUP_APPL_SHORT_NAME="AR" TITLE="AR:AR_SRS_TITLE_ACC_RPTS"' str FROM dual
  3  UNION ALL
  4  SELECT 'REQUEST_GROUP_CODE = "PRINT_CONSINV"REQUEST_GROUP_APPL_SHORT_NAME = "AR"TITLE = "AR:AR_CONS_INV_WINDOW_TITLE"' FROM DUAL
  5  UNION ALL
  6  SELECT 'REQUEST_GROUP_CODE="JL_CO_MG_REQUEST_GROUP" REQUEST_GROUP_APPL_SHORT_NAME="JL" TITLE="JL:JL_CO_GL_MG_WINDOW_TITLE"' FROM DUAL
  7  UNION ALL
  8  SELECT 'Request_Group_Code="OE_CONC_PROGRAMS" Request_Group_Appl_Short_Name="OE" Title="OE:OE_SRS_TITLE_CONC_PROGRAMS"' FROM DUAL
  9  )
 10  SELECT regexp_substr(str, 'REQUEST_GROUP_CODE\s*=\s*"(.*?)"', 1, 1, 'i', 1) as REQUEST_GROUP_CODE
 11       , regexp_substr(str, 'REQUEST_GROUP_APPL_SHORT_NAME\s*=\s*"(.*?)"', 1, 1, 'i', 1) as REQUEST_GROUP_APPL_SHORT_NAME
 12  FROM test
 13  ;

REQUEST_GROUP_CODE             REQUEST_GROUP_APPL_SHORT_NAME
------------------------------ ------------------------------
ACCOUNTING                     AR
PRINT_CONSINV                  AR
JL_CO_MG_REQUEST_GROUP         JL
OE_CONC_PROGRAMS               OE
 

Tags: Database

Similar Questions

  • Best way to transfer strings, arrays and clusters

    Hi, I just want to know the best way to transfer strings, arrays and clusters between a PC and a computer-RT (compactRIO) if I want to use them in deterministic loops:

    For a string should I use a published network shared variable flow or network?

    For an array of doubles should I flatten the array in a string and the string of transfer? or should I send it as a picture?

    The same for clusters, should I flatten the cluster or the transfer as a cluster?

    Thank you!

    Transfers on the network are not deterministic.  You ask how to use the data in a deterministic way, once it arrives on the RT system.  Usually, you would create a separate loop, not critics of time to deal with network communications.  The data arrives it is copied in real-time-safe structures such as RT-FIFO to put at the disposal of the evanescent loop.

    I can't give you specific advice on network variables and network flows; Finally, I did this kind of transfer over TCP, until these other options were available.

  • Best way to extract an accountant of HFM

    Hi all

    Anyone know if there is an easy way to extract the metadata in hierarchical format as (opposed to flat file)?

    The options that we have (extracted elements app, export of LCM) seem to be limited to the production of flat files...

    Are there utilities consultant who can give us our cumulative?

    Thanks to all in advance

    Juan

    Hey Juan,.

    You can do this by EPMA and classic using the Toolbox utilities Application Oracle provides with installation.  A csv file for each dimension can easily be created that looks like this:

    The Toolbox of the Application exists with other utilities:

    Otherwise, there are many macros are created by different people who take an app file and create an output similar.

    Thank you

    Erich

  • best way to extract a portion of the audio of a video DVD?

    Thank you

    Import the vob in first and just use audio.

  • Best way to create transparent 2d cutting trees?

    What is the best way to extract the trees out of real photographs. I want to make cuts excellent transparent tree 2D to my work. I used the technique of edge refine but it gives good results. I find myself using the eraser to clean stuff. One of the biggest problem I encounter is the sky which is visible between the small gaps of the foliage of the trees.

    So, what is the BEST way to cut a 2D transparent trees?

    There is no better way. It's simply hard manual cleaning.

    Mylenium

  • Best way to remove the apostrophe from the string when loadiing

    Salvation by using an insert statement to load the data some string apostrophe.

    Please make sure that all aposrophe of removed from these channels on loading.

    What is the best way to reach EThis.

    Uisng 11.2.0.3


    Thank you

    One way:

    with data as
    (
      select 'some '' data' col from dual
    )
    select col, replace(col, '''', '') rep
      from data;
    
    COL         REP
    ----------- -----------
    some ' data some  data 
    
  • Best way to cast to a string

    Hello

    I want to convert item.someNumber to a string to count this char in length. If it has a single tank, I prepend a '0', otherwise I don't touch it.

    What is the best way to do it?

    item.someNumber.toString)

    String (Item.someNumber)

    (String) item.someNumber

    ?

    Thank you.

    If (someNumber<>

    {

    someString = '0' + someNumber;

    } else {}

    someString = String (someNumber);

    }

    or a Variant if you handle negative numbers

    If (someNumber < 10="" &&="" somenumber=""> 0)

  • best way to find out: string in number and &gt; 0

    What is the best way to determine whether the input string (which is surely not null) is a whole number greater than zero and positive without a comma.
    The correct values are: 1, 2,...,

    To determine if the string is a whole number, I can do this way:

    Select decode (REGEXP_INSTR ('1 ',' [^ [: digit:]]'), 0, 'NUMBER', 'NOT_NUMBER') of double;

    But I do not know how to change the regular expression so that it would fail to zero to be the first tank.

    Or is there a better way?
    SQL> with t as (select '-1' s from dual
               union all
               select '0' from dual
               union all
               select '109' from dual
               union all
               select '0109' from dual
               union all
               select '1.5' from dual)
    select t.s, case when regexp_like (s, '^[1-9]+[0-9]*$') then 'NUMBER' else 'NOT A NUMBER' end test
    from t
    /
    S    TEST
    ---- ------------
    -1   NOT A NUMBER
    0    NOT A NUMBER
    109  NUMBER
    0109 NOT A NUMBER
    1.5  NOT A NUMBER
    
    5 rows selected.
    
  • What is the best way to obtain a string that represents a date in the format mm/dd/yyyy

    What is the best way to obtain a string that represents a date in the format mm/dd/yyyy

    It would be good if I could generate this string using the static methods of a class.






    You can use date formatter:

    Import mx.formatters.DateFormatter;
    ...

    var trainer: DateFormatter = new DateFormatter();
    formatter.formatString = "YYYY/MM/DD JJ:NN:SS;
    var today: Date = new Date();
    trace (formatter.format (now));

  • Large enough string - what is the best way to apply

    Hi guys,.

    I have user agreement which is about 1300 characters, could someone please tell me the best way to store and retrieve? and also view it.

    I don't want to cramp, the memory of the blackberry. I build on the JDE version 4.5.

    Thanks in advance.

    the solution that I opted for a similar problem had to include the agreement, entirely in the format, in html format in the project.

    I use the browser to view it then.

  • What is the best way to get a customized version # from an ESXi host?

    Each quarter, we generate a sequence of updates (including patches and security scripts) which are performed manually on our 5.0 ESXi hosts. I don't have an internet connection and so I have to do it this way.  I would like to be able to identify the last quarterly update that has been run on the vCenter servers and/or Client VI.

    Right now, I think adding the quarter, example 1 Q 13 on the DCUI message, then help PowerCLI, vCenter to retrieve the message DCUI, crawled and paste the quarter in the field host Annotations on vCenter.

    Kind of ugly, but I cannot find a cool way to get data like this outside of the host.  I don't want to rely on my user manually set to nothing, for example the field of Annotations on vCenter that is also subject to errors.

    I really want something that can also be seen on the VI Client, too, as the annotations are only on vCenter.

    I have ideas about the best approach to tackle this problem.

    Thank you

    Not sure if this is the best way, but that's what I ended up doing.   It feels like there should be a better way.

    I've updated my quarterly script to add the version number at the bottom of the file, / etc/vmware/welcome, whenever it is run on an ESXi host (e.g. myScript version: v1.0 Date: 04June2013).  This file appears under the banner DCUI.

    Then, I wrote a script powerCLI to roughly the following:

    foreach ($vmHostObj in Get-VMHost-name *) {}

    # Get the full message of DCUI in/etc/vmware/welcome

    $msgObj = echo $vmHostObj | Get-VMHostAdvancedConfiguration-name Annotations.WelcomeMessage

    # Convert a hash of a string table welcome message

    $msgTxt = echo $msgObj.Item ("Annotations.WelcomeMessage")

    # find the clue for the string containing my script information, which is at the end of the welcome message.

    # This is important because the substring below function will extract everything after the index.

    $idx = $msgTxt.IndexOf ("version myScript :")

    If ($idx - gt 0) {}

    $label = $msgTxt.Substring ($idx)

    Set Annotation - remarks on the entity $vmHostObj - CustomAttribute - value $label

    }

    }

    This replaces the Notes field for each host, one day I can go back and make it more user-friendly where it replaces the version leaving the rest of the field notes intact.

  • Best way to code structure to control several instruments

    Hello

    I am a novice but not inexperienced labview programmer. I'm writing a labview code to control a physical optical experiement. This involves writing a GUI which of your interfaces then with a variety of instruments (such as motorized turntables, lock-in amplifiers, power supplies, Renault, etc...) all connected to the computer through various means. All the instruments are delivered with their own labview drivers to complete their most important functions. Essentially, the instruments will operate independently, but occasionally, will be a set of steps involving several instruments (such as move, take a step, move again,...)

    My question is what is the best way to structure the top level VI where all GUI controls? I have currently the code structured so that each instrument has an event structure that manages keys and commands for it. Simple events like the movement are dealt with in the cases where structures themselves while queues and occurrences are then used to handle more complicated events in external loops. It is an appropriate way to handle this scenario, or is it that most commonly architecture?

    Thank you for the help

    You play with fire when using several structures of the event. My preferred method for executing an instrument that has a 'stream' mode (example: a spectrometer where you always see the spectrum), is to provide that it is a clean line, with a dequeue item. The 'element' may have a message part (or State) in the form of an enum or string, as well as some data in the form of a Variant. You want to set a parameter, you could send a cluster containing the enum "Set the parameter" as well as the value of the parameter in the form of a Variant. The default case would be to get a spectrum and update a graph (or send another message to a user interface management loop that updates the chart).

    You can open the project template QMH who comes with LabVIEW to see how a line would work, and then you can add multiple queues for different instruments. I keep the new loops in their own SubVIs and reference to the queue in a global functional to clean the main schema.

    Here is an example of what your data of the module flow record might look like (the string constant empty considered double quotes is by default to expire the message dequeue)

  • What is the best way to correct the registry errors without the use of a registry cleaner in XP?

    I am sorry to raise this issue that so many people who have asked me.  I read pages and pages of discussions on the MS forum on this subject, and without exception, all the experts said Microsoft registry cleaners are completely unnecessary and that junk in the registers has no performance impact at all.  Instead, they say, to do x, y and z.  I am running Windows XP on my desk for five years, and gradually, he got so slow it's almost unbearable.  It takes 10-15 minutes just to start, and sometimes it takes 2 minutes or more just to open a window of browser (IE8) or go to the previous page by using the arrow to the left.  Before you tell me all the things it could be, please let me say that:

    1. my PC has not always been this slow!  It is getting worse.

    2. all my Windows software is up to date.  I have automatic updates on.

    3. I have a lot of disk space, almost 75% of free space on a hard drive of 80 GB.

    4. my PC is free of viruses, spyware and Trojans.  I have McAfee antivirus running and I also sometimes run Malwarebytes and Trojan Killer, because they always find things that don't have McAfee.

    5. I defragment my hard drive on a regular basis.

    6. I regularly delete all my temporary files by using the Windows Disk Cleanup utility.

    7. I have very little, if any "Add-ons".  No toolbar Yahoo or Google (or Bing!).

    8. I removed nearly every program that I start, so that they are not running in the background.

    9. I uninstalled all the programs that I don't use.

    However, I still have a slow ever-more computer.  Sometimes, when I see ads on TV to increase the speed of my PC, I download the 'free' software, and they claim to find hundreds or thousands of "registry errors.  When I look at the newspapers, I see many entries in registry for 'Netscape' and 'Google Earth', which I uninstalled years ago, as well as entries for the videos that I downloaded, seen once, and deleted a long time ago.

    So, what's the problem?  If it's not related to my registry (which Trojan Killer says has more 6 000 entries!), what else could be?  I would appreciate greatly any advice you can give, because there are dozens of companies on their touting their registry cleaners and the uninstall (for a price) programs, and after reading reviews of the MS MVPs, I'm skeptical of their claims.  Thank you.  :)

    I can't disagree with a lot of things have already been said.

    I'm willing to accept that your machine does actually takes 10 to 15 minutes on the clock. It's completely absurd.

    Some people call your "Windows Rot" problem. Becomes just the slower windows over time. It is a collection of things that are happening in the background. Yes I believe that the register contributes. Using a registry cleaner is not a "magic" solution But it can help a little.

    The PC care program/process you described is above average.  I suggest you add CCleaner. Disk Cleanup is not bad, CCleaner is better, cleaning of other stuff which does not resemble the DC. It won't be a significant difference because disk space is not your problem, but it will help a little.

    'Play' with the registry is VERY risky. If you decide to go ahead, I would say that first make you a copy of the full image backup using a utility that can be started and run from a CD/DVD. Just in case the registry cleaner breaks of your machine.

    Registry cleaners is that they take a "best estimate" to what is no longer necessary. Sometimes they think wrong. And each vacuum cleaner will clean slightly different sets of places.  If the tool does not provide a way to back up the registry before you start cleaning, do not use it. He is not careful enough.

    If vacuuming offer 'levels' of cleaning, enjoy. Open for more aggressive cleaning, with resetting and long series of normal use between cleanings.

    You are looking for a tool which also makes registry "defragmentation". The registry is a database that get disorganized by additions and deletions. Defragmentation will be re - organize and get rid of a 'lost' space, making it the smallest file, afterwards faster to read.  It is not something you need to do frequently, but since you've never done it in 5 years, it would help, after cleaning registry.

    Another place to find CPU and RAM wasted resources is Windows Services. These are small programs that start at boot time. They run in the background and provide support services to all applications or specific applications.  Many applications services are running even though you don't really need them. You can find information on which you can set by Googling for 'Windows XP hardening'. There are a lot of sites with good information. They call it hardening because by disabling unnecessary stuff, you leave less possible openings for the "bad guys" to the attack.

    Ultimately, I think your best bet will simply bite the bullet and re - install windows and all your applications. It's the best way to restore your computer to almost any performance fees factory. (It is not exactly factory fresh because you need to add a ton of Windows updates).

    Before you re-install, do copy image 1 or more full backups. At least one must be done using a tool that will easily allow you to extract the files. You data backup files separately to make it easier to restore the reinstallation. IE, copy it to a USB key.

    Many "experts" actually expect to, and do, re - install windows every 6-12 months!  I think it's a bit exaggerated, but they swear by it.

    Once you do your re - install, create a copy of the magnified image
    Install a firewall application (before the windows updates)
    Once you do all updates of windows, create a copy of the magnified image
    After that you re-install all your apps, create another copy of the complete picture.

    In this way, in the future, you have more current points to restore your computer to. It will reduce the time you spend to get back to the current configuration.

    On a 5 year old XP machine, you have probably 512 MB - 1 GB of RAM. You might also consider taking in the shop (or DIY) and bump the RAM up to at least 2 GB or better still max out.  The current versions of the applications use much more memory than they did 5 years ago. Even XP will be since he has been seriously corrected since then.

  • check registartion early? best way to implement

    Hey guys,.

    I tried to determine the best way to make my request to verify a valid registration on startup key and if the key is valid, the tracks of the app.  If the key is not there, or invalid, it has a pop up screen to enter a registration code.   Any help would be appreciated in pointing me in the right direction.

    (I have already created screen pop-up)

    You do this verification early in the process. Try something like this:

    public class MyApp extends UiApplication {
    
      public static void main(String[] args) {
        final MyApp app = new MyApp();
        app.invokeLater(new Runnable() {
          public void run() {
            app.doStartupWork();
          }
        }
        app.enterEventDispatcher();
      }
    
      void doStartupWork() {
        if (!registered()) {
          PopUp popUp = new PopUp();      pushModalScreen(popUp);      if (popUp.registrationFailed()) {        System.exit(0);      }    }
        pushScreen(new AppMainScreen());  }
    
      boolean registered() {
        // check for existing registration key
      }
    }
    
  • What is the best way for foglight consume a webservice

    I hope that this is has not been replied that a bazillion times and if it is please send me the link I'm open to that.  What is the best way for foglight consume a Web service and respond with an alarm if the response from the Web service is not what is expexted.

    for example, calls Foglight webservice to acme.com/areuup and he responds with correct status in json format process.  If it does agree return, then foglight must send alerts to correct individuals.

    Thank you

    Kaleb

    in the end, we have used a perl script to capture the webservice and treat it and tables configuration.  Here is what has been written and created an agent custom.

    I apologize to all those who find the bulky comments, but it's my edition of journal of the script. I removed the comments once the script has been published and used.

    ===

    #! / usr/bin/perl

    #############################################################

    # Author: Kaleb J. Albee

    # Depandancies: SOA webservice

    # Engineers: Marc and Manu

    # Date: 28/02/2013 perl: (v5.14.2) built for x86_64-linux-gnu-thread-multi

    # Operating system: Linux 3.2.0 - 29-generic eam-ops-test #46 - Ubuntu SMP Wed Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

    #############################################################

    use strict;

    use warnings;

    use Try::Tiny;

    use SOAP::Lite;

    use SOAP::WSDL;

    Use Time::Local;

    My = @soaenvs ('BSE - dev', 'BSE test', 'BSE-scene', 'BSE');

    # parameters: $_ [0] receives a call of SOAP client object.

    #

    void toStr {return $_ [0] == 1?} 'up': 'down' ;}

    void getBusResults {}

    # $_ [0] will be the $client spent

    # create a different buses SOAP connection.

    my $result = $_ [0]-> (getMessagingEngineHealth)

    # arg0 is used to set the setting for what is expected on the soa web service.

    SOAP::Data-> name (arg0 => $_ [1]));

    # $_ [1] will be the bus happened in

    return (Lk ($result) "started" eq? 1: 0);

    #return $result;

    }

    # Start sampling.

    My $curTimeStamp = "";

    my $count = 0;

    Print "LdsEsbBusHealth5\nSTART_SAMPLE_PERIOD\n TABLE";

    foreach my {$soae (@soaenvs)

    my $client is SOAP::Lite-> service ("put the url of the webservice here.");.

    $count ++;

    # create an object to inspect objects. My $insp = Data new::Inspect->; Download the time stamp for this.

    my ($sec, $min, $hr, $day, $mon, $year) = localtime;

    # format the year correctly for useage.

    My $curyear = 1900 + $year;

    # the hand to the fglam agent fields at the tables.

    My $soacei = getBusResults ($client, "messaging.000 - CEI.esb.BUS");

    My $soaapp = getBusResults ($client, "messaging.000 - SCA.APPLICATION.esb.Bus");

    My $soasys = getBusResults ($client, "messaging.000 - SCA.SYSTEM.esb.Bus");

    $curTimeStamp = ' $curyear$ MON$ day$ hr$ min$ s ";

    Print "SoaEnv.String.id=$soae\n";

    Print "CeiBusNum = $soacei\n";

    Print "AppBusNum = $soaapp\n";

    Print "SysBusNum = $soasys\n";

    Print "CeiBusStr.StringObservation.obs =". toStr ($soacei). "\n";

    Print "AppBusStr.StringObservation.obs =". toStr ($soaapp). "\n";

    Print "SysBusStr.StringObservation.obs =". toStr ($soasys). "\n";

    Print "Daterun.StringObservation.obs=$curTimeStamp\n";

    If ($count<=>

    Print ("NEXT_SAMPLE\n");

    }

    } {$soae foreach (@soaenvs) #.

    Print "END_TABLE\n";

    Exit 0;

    ===

    I hope this helps someone out there!

    Bravo!

Maybe you are looking for