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 whitespace differences, case differences etc. I need the values between the quotes for each one. I would expect to get ACCOUNTING and AR for the first example. I am using db version 11g r1.
Thanks.
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 TESTEdited by: Vortex13 on Jun 20, 2012 9:12 AM

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

Similar Messages

  • HT1338 best way to extract a video from a website?

    what is the best way to extract a video from a website? THANKS!

    how bout a bit more thought on this one, some people are trying to pull a video clip from their 15 seconds of fame on channel 7 news,
    or perhaps a short intro video clip, on a site they own becuase it is playing as flash. since they never had hard copy of the video clip, its difficult to ask themselves for permission, if they don't know how, which is, i'm sure, why this fellow did indeed ask.
    no such thing as dumb questions...just helpful ones that others may also wonder.

  • Best way to extract XML value wiith an xpath

    Hello,
    I wonder what is the best way to extract text value from XmlType with an xpath.
    I need to insert a row inside a table where the row's data come from xpath extractions of an XmlType. I do a lot of (approximative 20) :
    EXTRACTVALUE(var.myxmltype , '/an/xpath/to/extract/elem1').
    EXTRACTVALUE(var.myxmltype , '/an/xpath/to/extract/elemI').
    EXTRACTVALUE(var.myxmltype , '/an/xpath/to/extract/elem20').
    inside the insert statement
    Is this way is the best or is there a more optimal way ?
    For example extracting the node '/an/xpath/to/extract/' and sarting from this node extracting "elem1", ... , "elemI", "elemN" children.
    Thanks for your help,
    Regards,
    Nicolas

    Hi Nicolas,
    The answer depends on your actual storage method (binary, OR, CLOB?), and db version.
    You can try XMLTable, it might be better in this case :
    SELECT x.elem1, x.elem2, ... , x.elem20
    FROM your_table t
       , XMLTable(
          '/an/xpath/to/extract'
          passing t.myxmltype
          columns elem1  varchar2(30) path 'elem1'
                , elem2  varchar2(30) path 'elem2'
                , elem20 varchar2(30) path 'elem20'
         ) x
    ;

  • Best way to extract all images from Messages?

    My iPad freaked out earlier today and unfortunately I had to do a recovery and restore (from iCloud backup).  I say unfortunately because I was 90% certain I was not backing up photos/video (and there was no way to check before doing the restore).  And indeed I had photo/video backup turned off.
    I'm mostly back to normal now, except for all the lost photos/videos.  I've gone through some of Messages to Save ones I sent there. 
    What is the best way to extract all images from past Messages so I don't have to tediously load earlier messages?   I understand there are some programs that allow one to go through a local backup and go through messages.  But for this I suppose I'd first need to make a local backup of everything, no?  Are those programs able to extract just images I've sent or do they grab everything (i.e. images others have sent me?)
    Related, before I did the initial restore could I have easily retrieved the photos/images on the device through some third-party solution?
    Lastly, and semi-off topic.. What determines the image name for an image in Messages?   For example, I Copied a photo someone sent me via Messages and Pasted it three times back to her (all at the same time).   The image filenames are IMG_6447.jpg,  IMG_4820.jpg, IMG_0291.jpg.  

    Thanks Kirby.  I utilize Aperture 3 by reference instead of a compiled library.  So I have individual folder/projects stored on my laptop.  By exporting as a library, does Aperture bring these folders and related images "with it"?
    What I don't want to lose is any post processing I do in the field which creates separate versions and/or .PSD files.
    Thanks for your continued assistance.
    Chris

  • Best way to extract data from archived cube

    Hello Experts,
    Can anyone tell me best way to extract data from archived cube.
    Basically I am trying to pull all the data from archived cube and then load it into another brand new infoprovider which is in different box.
    Also I need to extract all the master data for all infoobjects.
    I have two options in my mind:
    1) Use open hub destination
    or
    2) Infoprovider>display data>select the fields and download the data.
    Is it really possible to extract data using option (2) if records are too high and then load it into another infoprovider in new system.
    Please suggest me the pros and cons for the two options.
    Thanks for your time in advance.

    Hello Reddy,
    Thanks a lot for your quick reply.
    Actually in my case I am trying to extract archived infocube data and then load it into new infoprovider which is in different system. If I have connectivity I can simply export data source from archived infocube and then reload into new infoprovider.
    But there is no connectivity between those two systems (where archived cube is and new infoprovider) and so I am left with the two options I mentioned.
    1) Use Open Hub
    or
    2) Extract data manually from infoprovider into excel.
    Can anyone let me know which of the two options is the best and also I doubt on how to use excel in extracting data as excel have limit of no.of records 65536
    Thanks
    Edited by: saptrain on Mar 12, 2010 6:13 AM

  • Best way to extract XML data to DB

    Hello,
    In our work we need to extract data from XML documents into a database. Here are some extra notes:
    + There is no constant schema for the XML documents.
    + Some processing on the XML files is required.
    + The XML documents are very big.
    + The database is Oracle 8i or 9i (Enterprise Edition both) and our framework is NET.
    Our questions are:
    1. What is the best way to extract the data into the database under the above circumstances ?
    2. In case there was a constant schema for the XML documents, would there be a better way ?
    3. Is writing the data to text files first, and then loading it via SQL-Loader is an effective way ?
    Any thoughts would be welcome. Thanks.

    Hi Nicolas,
    The answer depends on your actual storage method (binary, OR, CLOB?), and db version.
    You can try XMLTable, it might be better in this case :
    SELECT x.elem1, x.elem2, ... , x.elem20
    FROM your_table t
       , XMLTable(
          '/an/xpath/to/extract'
          passing t.myxmltype
          columns elem1  varchar2(30) path 'elem1'
                , elem2  varchar2(30) path 'elem2'
                , elem20 varchar2(30) path 'elem20'
         ) x
    ;

  • Best way to extract this info?

    Hello:
    I have information stored in xmltype as follows:
    <INFO>
    <ASG>
    <LMT id="A1">
    <LMT_VAL>7</LMT_VAL>
    </LMT>
    <LMT id="B1">
    <LMT_VAL>6</LMT_VAL>
    </LMT>
    </ASG>
    </INFO>
    The above info may be dynamic. Example, for some types, There may be additional LMT element with a value of C1 and D1. So what is the best way to extract all of them (A1, B1, C1, D1) - even though in some cases only A1 and B1 may be present?
    Do I have to extract like:
    select ...
    where
    t1.xml.col.extract('/INFO/ASG/LMT/LMT_VAL/@id').getStringVal() = 'A1'
    Do I have a condition like this where ... = A1
    Any help appreciated.

    Hi,
    one left round bracket is missing
    TABLE(xmlsequence(extract (<b> (</b><---missing SELECT xml_column FROM your_table)....If you have more then one row in the table it's not working!
    SQL> CREATE TABLE test_xml(
      2   id NUMBER
      3  ,xml_col XMLType)
      4  /
    Table created.
    SQL> INSERT INTO test_xml VALUES(1,xmltype('<INFO>
      2  <ASG>
      3  <LMT id="A1">
      4  <LMT_VAL>7</LMT_VAL>
      5  </LMT>
      6  <LMT id="B1">
      7  <LMT_VAL>6</LMT_VAL>
      8  </LMT>
      9  </ASG>
    10  </INFO>'))
    11  /
    1 row created.
    SQL> INSERT INTO test_xml VALUES(2,xmltype('<INFO>
      2  <ASG>
      3  <LMT id="A1">
      4  <LMT_VAL>7</LMT_VAL>
      5  </LMT>
      6  <LMT id="B1">
      7  <LMT_VAL>6</LMT_VAL>
      8  </LMT>
      9  </ASG>
    10  </INFO>'))
    11  /
    1 row created.
    SQL> SELECT extractvalue(column_value, '/LMT/@id') new_id,
      2         extractvalue(column_value,'/LMT/LMT_VAL') new_value
      3  FROM TABLE(xmlsequence(extract ((SELECT xml_col FROM test_xml), '/INFO/ASG/LMT')));
    FROM TABLE(xmlsequence(extract ((SELECT xml_col FROM test_xml), '/INFO/ASG/LMT')))
    ERROR at line 3:
    ORA-01427: single-row subquery returns more than one row
    SQL> spool off;

  • What is the best way to extract/consume HR data to and from Peoplesoft?

    I have to do integration between Peoplesoft and Oracle ERP to send HR data from Peoplesoft to Oracle HRMS. I will use Oracle Fusion Middleware for building the interface. I don't have much experience in working with Peoplesoft tools, like PeopleTool, App Engine, Integration Broker, Component Interface and Oracle adapter for Peoplesoft. Can somebody please let me know what is the most popular or recommended or best way to extract HR data from Peoplesoft.
    The second interface will consume some HR data from Oracle. Once again I need to know different ways to insert data into Peoplesoft.
    I appreciate if you can share your experience for the above two scenarios.

    If you plan on buying a apple laptop you have two options. You can use time machine or pull the data off of it directly and put it onto the external. I advise the second choice. This way you do not have stuff that you dont need filling up the space on your new drive. Get your applications, music, documents, photos, videos and perhaps downloads and desktop; Put all of these on your external. And then reinstall osx onto your drive.
    *** If buying a windows machine next check the format of the drive in disk utility. You will need a program called Paragon NTFS to format the drive window compatibility. You have to pay for the free version but can download a trail version for free.
    http://www.paragon-software.com/home/ntfs-mac/
    Did i leave anything unanswered?

  • SD reporting- best way to extract SD contracts data

    Hi All,
    I want to know what is the best way of extracting the SD contracts data from the VEDA table & the technical objects attached to the contracts(which are in tables like SER02, OBJK etc..). Is it possible to enhance the 2LIS_11_VAITM datasource with these fields? or there is a better way of doing this? Is there a standard datasource that can be used?
    Any helpful information will be appreciated.
    Thanks,
    Shilpa

    You can create a User Exit in CMOD for the 2LIS_11_VAITM DataSource to get the data. There should be a 1:1 (equi or inner join) or 0:1 (outer join) relationship of the data that you want to include, so that you don't create duplicate data.
    Another option would be to create generic DataSources and join the data in BW.

  • FB: best way to extract CSS from a project created in Catalyst

    I'm posting this on behalf of a question on the Catalyst forum (http://forums.adobe.com/message/2324233#2324233): Once I import a Catalyst project into FB, what's the best way to go about extracting CSS from it so that all the styles aren't inline?

    Any help or pointers will be greatly appreciated.
    thanks,
    Fu

  • Best way to extract lines from a log file in Linux

    My query is that I have a log file which is around 7 GB and I want to extract lines between a certain time range which should total up to half of the size to 3.5 GB. The lines start with a time range like                        “2014-03-11 17:35:00”. I want to extract the lines between “2014-03-11 17:35:00” to “2014-03-11 18:05:00”. What should be the best way as there may be a grep command or a sed command to do it.
    I hope, my question is clear.
    Please revert with the reply to my query.
    Regards

    How about the following:
    awk '/2014-03-11 17:35:00/, /2014-03-11 18:05:00/' infile > outfile

  • Please Suggest best way to pass Strings in a pipeline

    I'm working in a project in which a line passes in a pipeline kind of situation.
    The String is passed between different modules and each module adds some more data to it (or may even remove some of it).
    Which is the best way to pass the String? I think java.lang.String might not be an efficient method because the String i'll be passing will be modified many times.
    Thanx

    Yes. StringBuffer or StringBuilder you can use.
    String string = "test";
    StringBuffer sb = new StringBuffer(string);later you will add some more strings to the StringBuffer
    sb.append("Hello World");No additiional String object will be created.

  • Best way to store string resources for localization?

    My midlet has alot of string resources that I want to be able to easily customize, and I wonder what is the best way to do this using J2ME? To make the code easy to localize I would like all strings to reside in a single file (either a class file or a file system file). It doesnt seem that there is an easy way to do this (eg a "resource file" or some such). Do I just need to create a class that defines a bunch of static final String objects?
    Thx,
    Fred

    [HypnosFred],
    My midlet has alot of string resources that I want to
    be able to easily customize, and I wonder what is the
    best way to do this using J2ME? To make the code easy
    to localize I would like all strings to reside in a
    single file (either a class file or a file system
    file). It doesnt seem that there is an easy way to do
    this (eg a "resource file" or some such).Perhaps you might want to utilise the MIDP RMS record store feature i.e. javax.microedition.rms.* classes instead to store the string objects.
    Do I just need to create a class that defines a bunch of static
    final String objects?Declaring the String object variables as static final String objects upfront may help too but cannot be shared between MIDlets in a MIDlet suite though.
    Thx,
    FredHTH.
    Allen Lai
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • Whats the best way to extract hex data from control code a Intel format

    Does anyone know an easy way to extract the green set of data from this EEPROM dump?
    :020000040000FA
    :10420000110022003300440055006600770088004A
    :104210009900AA00BB00CC00EE00FF00FF00FF00E9
    :10422000FF00FF00FF00FF00FF00FF00FF00FF0096
    :10423000FF00FF00FF00FF00FF00FF00FF00FF0086
    :10424000FF00FF00FF00FF00FF00FF00FF00FF0076
    :10425000FF00FF00FF00FF00FF00FF00FF00FF0066
    :10426000FF00FF00FF00FF00FF00FF00FF00FF0056
    :10427000FF00FF00FF00FF00FF00FF00FF00FF0046
    :10428000FF00FF00FF00FF00FF00FF00FF00FF0036
    :10429000FF00FF00FF00FF00FF00FF00FF00FF0026
    :1042A000FF00FF00FF00FF00FF00FF00FF00FF0016
    :1042B000FF00FF00FF00FF00FF00FF00FF00FF0006
    :1042C000FF00FF00FF00FF00FF00FF00FF00FF00F6
    :1042D000FF00FF00FF00FF00FF00FF00FF00FF00E6
    :1042E000FF00FF00FF00FF00FF00FF00FF00FF00D6
     :10430000FF00FF00FF00FF00FF00FF00FF00FF00B5
    :10431000FF00FF00FF00FF00FF00FF00FF00FF00A5
    :10432000FF00FF00FF00FF00FF00FF00FF00FF0095
    :10433000FF00FF00FF00FF00FF00FF00FF00FF0085
     :10434000FF00FF00FF00FF00FF00FF00FF00FF0075
     :10435000FF00FF00FF00FF00FF00FF00FF00FF0065
    :10436000FF00FF00FF00FF00FF00FF00FF00FF0055
    :10437000FF00FF00FF00FF00FF00FF00FF00FF0045
    :10438000FF00FF00FF00FF00FF00FF00FF00FF0035
    :10439000FF00FF00FF00FF00FF00FF00FF00FF0025
    :1043A000FF00FF00FF00FF00FF00FF00FF00FF0015
     :1043B000FF00FF00FF00FF00FF00FF00FF00FF0005
    :1043C000FF00FF00FF00FF00FF00FF00FF00FF00F5
     :1043D000FF00FF00FF00FF00FF00FF00FF00FF00E5
     :1043E000FF00FF00FF00FF00FF00FF00FF00FF00D5
     :1043F000FF00FF00FF00FF00FF00FF00FF00FF00C5
     :02401200FF3F6E
     :00000001FF

    rolfk wrote:
    crossrulz,
    Intel Hex Format is a text format describing binary data, usually used for chip programming devices. Besides records for the actual data itself it also allows for addressing records, such that you only need to have the data in the file that needs to be written to the chip, even if the various areas are all over the address range of the chip. Since it is a well known format for hardware developers, some people coming here assume that everybody knows what it is. Of course many true softies may never have heard of it.
    rolfk, thanks for the information.  I was not aware of this.  I guess I am a true softie even with my EE background.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Best way of extracting Akai-CD for use in Kontakt

    What's the best way of doing it so it preserves the original data? Google only shows old results.

    Page 87 of the Kontakt manual (that's Kontakt 4).
    Might be an idea to post something like this on a Native Instruments forum ;-)

Maybe you are looking for

  • Cant update payment info for Photoshop CC

    I have a subscription to Photoshop CC Photography Program. Recently changed my Credit card after the ADobe Security Fiasco and now I get an error message each time I load up Photoshop CC telling me my subscription is about to expire in XX Days. Now c

  • Adobe Photoshop CC 2014 Help TAB Photoshop Online Help - LINK IS BROKEN

    My Adobe Updater installed Photoshop CC 2014, and all seemed well, until I attempted to get online help via: Help TAB > Photoshop Online Help This LINK is apparently BROKEN! Here is the resulting error on Firefox (version 32.0): XML Parsing Error: un

  • Creating Po

    Dear Experts 1) Once Purchase Requisition Approved ,what are the sources you can create Purchase Order? (Manually and auto create ) Other than this any way to create po? 2) What are the chances Person Not able to create Purchase order?

  • Symbian Anna Email client fonts

    I get overlapping characters when zooming in with the Nokia email client after Anna update. See screen shot. Attachments: Scr000002.jpg ‏32 KB

  • POP3 connection error

    Trying to unload POP mails, for a POP and IMAP defined account, I read the following error from syslog: Oct 15 18:02:42 servername Mail[75465]: -[POP3Connection fetchMessages:totalBytes:] failed: Error Domain=NSPOSIXErrorDomain Code=54 UserInfo=0x11a