Search one column for value in another column

Hello,
I am trying to take the whole value from one column, and see if that string appears anywhere in another colmn. So if one row in one column has the value "cat", I want to see if that string appears anywhere in any row in another column: so a row with the value "The cat sat on the mat" would return true.
I have tried:
select term from pic_lib_keywords, csv
where contains (csv.nhm_field_asset_description,pic_lib_keywords.term) >0;
But I get the error:
ORA-20000: Oracle Text error:
DRG-50901: text query parser syntax error on line 1, column 32
20000. 00000 - "%s"
*Cause:    The stored procedure 'raise_application_error'
was called which causes this error to be generated.
*Action:   Correct the problem as described in the error message or contact
the application administrator or DBA for more information.
Can you use 2 columns in this way, or does the search term have to be a literal? Any suggestions would be appreciated.
Thank you.

It works for me, as shown below.
SCOTT@orcl_11gR2> select * from v$version
  2  /
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE     11.2.0.1.0     Production
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
5 rows selected.
SCOTT@orcl_11gR2> create table csv
  2    (nhm_field_asset_description  clob)
  3  /
Table created.
SCOTT@orcl_11gR2> insert all
  2  into csv values ('The cat sat on the mat.')
  3  into csv values ('The dog sat on the mat.')
  4  select * from dual
  5  /
2 rows created.
SCOTT@orcl_11gR2> create table pic_lib_keywords
  2    (term  varchar2(30))
  3  /
Table created.
SCOTT@orcl_11gR2> insert all
  2  into pic_lib_keywords values ('cat')
  3  into pic_lib_keywords values ('mouse')
  4  select * from dual
  5  /
2 rows created.
SCOTT@orcl_11gR2> create index test_idx
  2  on csv (nhm_field_asset_description)
  3  indextype is ctxsys.context
  4  /
Index created.
SCOTT@orcl_11gR2> select term
  2  from   pic_lib_keywords, csv
  3  where  contains
  4             (csv.nhm_field_asset_description,
  5              pic_lib_keywords.term) >0
  6  /
TERM
cat
1 row selected.
SCOTT@orcl_11gR2>

Similar Messages

  • Power shell search one column of a csv file and replace text in that column

    I have a huge CSV file.
    Column J has number which represents states.
    I would like to search through column J of output.csv and replace the number with the state name.
         J
    State
    233
    219
    233
    210
    Becomes
       J
    State
    NC
    TN
    NC
    SC
    I have tried several methods that seem to do noting or erase everything in my csv file or at best searches every column and if a phone number has 210 in it, it changes it to SC.
    Can any one point me in the correct location?
    Thanks!
    R White

    Thanks so much
    I gave it a try using this
    Import-Csv C:\temp\outfile.csv| ForEach-Object {
    if ($_.State.tostring() -like '256') { $_.State.tostring().replace('256', 'Somethingelse256')}
    if ($_.State.tostring() -like '257') { $_.State.tostring().replace('257', 'Somethingelse257xx')}
     } | export-csv C:\temp\outfileNEW.csv
    it produced a C:\temp\outfileNEW.csv
    with only a column A that had this all the way down it
    #TYPE System.String
    Length
    16
    16
    16
    16
    16
    16
    16
    R White

  • Id from one table showing value from another

    I have an article id (rs_comments.id_com) but I would like it
    to take this data and collect the value from another table.
    I have joined the two tables with:
    SELECT * FROM blg_comment_com INNER JOIN blg_article ON
    idart_com=id_art
    WHERE valid_com=1
    ORDER BY date_com DESC
    rs_comments.idart_com needs to be equal to rs_comments.id_art
    displaying the value from rs_comments.title_art
    How would I go about doing this. There only seems to be an
    option in DW to do this with a dynamic list/menu but I just want to
    display the text without option to change it.
    Any help much appreciated.

    i was stupid. The answer was staring me in the face. No
    wonder no-one bothered to reply...

  • How to assign One Dimension Property value to another Dimension ID

    Business senario:
    There are two dimensions Entity and Plant. Plant also has a property Entity.
    In my Input Form, I need to derive Entity Property based on PLANT selection and should map it to ENTITY Dimension.
    I have selected PLANT Dimension and ENTITY Dimension in Page Axis. I have updated EPMOLAPMember() formula with EPMMemberProperty() for deriving Entity values. When I tried to save data an error message appears saying TOT_Code is not a base level member. So I checked Edit Report window and found that ENTITY Dimension is automatically moved to default left panel from Row Axis and Entity Dimension Context Menu is mapped to TOT_Code which is the top node of the total hierarchy.
    I tried EPMMemberOverride() function to overwrite ENTITY Dimension values with Entity Property of PLANT Dimension but unable to overwrite it.
    In Simple Words:
    ENTITY Dimension = PLANT Dimension (Entity Property)
    Is there any way to map/assign property value to another dimension??? Please help me.
    Thanks in advance.

    Hi,
    see please this thread for a possible solution http://scn.sap.com/thread/3230754
    Regards
         Roberto

  • Can applescript search one file for non-matches in another file?

    I'd like to know if it's possible for Applescript to do the following:
    Take a text file with 600+ URLs and compare it to another text file with 100,000+ URLs and set out as a result any URL from the first small list that is NOT included in the second larger list?
    If it is possible to do this, is there anyone out there willing to create such a script for a modest fee?

    Hard to read the screenshot. next time cut and paste the test into the reply. Also select Replies as the display for the window in Applescript.
    The error you get, the no such file or directory are you sure that the file exists? Looks like the file is called List and it is in your desktop?
    Just tried it here and it is working OK
    Here is another copy just in case something got messed up in the first one:
              The patteren file is the smaller file with the URLs that we will lok for in the URL file
    set file1 to POSIX path of (choose file with prompt "Select patteren file:" default location alias (the path to desktop folder as text))
    set file2 to POSIX path of (choose file with prompt "Select URL file:" default location alias (the path to desktop folder as text))
    do shell script "grep -o -E '(https?|ftp|file)://.+' " & file1 & " > ~/patternFile"
    do shell script "grep -o -E '(https?|ftp|file)://.+' " & file2 & " > ~/urlFile"
    do shell script "grep -v -f ~/patternFile ~/urlFile > ~/missingUrlFile"
    --- stop copying above this line
    Just so you can see what the output in the Replies window of Applescript will look like:
    tell current application
      path to desktop as text
      --> "Mac OS Lion:Users:frank:Desktop:"
    end tell
    tell application "AppleScript Editor"
      choose file with prompt "Select patteren file:" default location alias "Mac OS Lion:Users:frank:Desktop:"
      --> alias "Mac OS Lion:Users:frank:Desktop:f1"
    end tell
    tell current application
      path to desktop as text
      --> "Mac OS Lion:Users:frank:Desktop:"
    end tell
    tell application "AppleScript Editor"
      choose file with prompt "Select URL file:" default location alias "Mac OS Lion:Users:frank:Desktop:"
      --> alias "Mac OS Lion:Users:frank:Desktop:f2"
    end tell
    tell current application
      do shell script "grep -o -E '(https?|ftp|file)://.+' /Users/frank/Desktop/f1 > ~/patternFile"
      --> ""
      do shell script "grep -o -E '(https?|ftp|file)://.+' /Users/frank/Desktop/f2 > ~/urlFile"
      --> ""
      do shell script "grep -v -f ~/patternFile ~/urlFile > ~/missingUrlFile"
      --> ""
    end tell
    Result:
    Message was edited by: Frank Caggiano - See Tony's post below

  • HT3354 how can i use one table for reference to another

    how can i use a table for a referance to another eg when i type a word in a cell, i will like it to match the word with another table then return the information in the cell i am using

    you can use vlookup() (or any of the lookup family of functions) to locate an item based on a key value:
    Here is an example of something you can do with two tables:
    The table on the right is title "Data" and stores a list of names with age and favorite color.
    The table on the left uses the value in the first column to lookup up information in the table Data
    in the table on the left:
    B2=IFERROR(A2&" is " & VLOOKUP(A2, Data :: A:D, 2, 0)&" years old and likes the color "& VLOOKUP(A2, Data :: A:D, 3, 0), "NOT FOUND")
    I know this look complicated.  so I'll break it up into smalled pieces:
    first the "&" is called the concatenate operator and joins two strings.  like this:
    a string is a set of characters between double quotes.
    so "string 1" & "string 2" becomes "string 1string2"  or "Sam " & "Jones" becomes "Sam Jones"
    you can use cell references instead of strings directly in which case the concatenation is performed on the contents of the cells.
    so if cell A1 contains "Hi " and the cell A2 contains "There"  then A1 & A2 will result in "Hi There"
    so you could add the formula
    A3=A1 & A2
    this is short hand for select cell A3 then type everything including the A3 so that A3 contains "=A1 & A2" (omit the double quote)
    OK.  So the formula I provided concatenates several items together:
    it concatenates A2, then the string " is " then a formula, then the string " years old and likes the color " then a formula
    the two formulas (highlighted in blue) perform a lookup of the value in cell A2 in columns A thru D of the table named "Data".  If if finds the value in cell A2 in the first column of the lookup range in the table Data (column A) then it returns the value from the same row but in the second or third column.
    all that is in a function calld iserror() to trap the condition where the calue you enter in A2 does not exist in the table Data:
    You will find the Numbers users guide and function reference helpful.  You can download then from Apple here:
    http://support.apple.com/manuals/#productivitysoftware

  • One chapter for video and another for images on same DVD?

    Hello,
    I don't yet have a Mac, but am very close to buying a MacBook. I do have a question about iDvd. Is it possible to create a theme or template or to even do this. I want to on a regular basis have a short 5-7 tops 10 minute video and 100-200 pictures. I'd like it so the user has the option to click one chapter and watch the video. Click the other and view the images with an option to browse the disc and save the images for uploading to their target of choice such as FB. Is this possible with iDvd?
    Thanks,
    BK

    Hello and Welcome to the discussions!
    Congratulations on being an 'almost' Mac purchaser!
    Yes, you can do what you want in iDVD.
    You will have theme templates that come with iDVD to use to make a nice theme for your projects.
    You will have the options to have the videos play individually by placing them on the menu one at a time, or to put them in iDVD the way you place a slideshow and have them play consecutively. Here is a link to a visual from Old Toad showing just that. Remember to look at this again when you get to this point:
    http://homepage.mac.com/toad.hall/.Pictures/Forum/iDVD8movieSS.png
    Another option for videos is to put them all into one iMovie and make chapters for each video. However, the chapters will not appear on the main menu, but in a separate submenu.
    You can then put the photos in iDVD as their own separate slideshow.
    When your DVD is viewed, the options will be to select to play the video slideshow or play the photo slideshow. You can rename these titles whatever you wish.
    If you make an iMovie, the options for it will be 'Play Movie' and 'Scene Selection' ( to link to the submenu with the iMovie chapter choices) and the same photo slideshow.
    In additiion, you can utilize the DVD-ROM option to have the photos and videos available for downloading to computer. This option will not be seen when the DVD disk is viewed on a set-top DVD player. iDVD's Help File says:
    +In iDVD, you can easily make it possible for viewers to download the photos and movies that appear in your slideshows. This is a nice feature for viewers who may, for example, want to print the photos for permanent display.+
    +The photos and movies are added to the DVD-ROM portion of your DVD, and viewers can access them when they insert the DVD into the drive on a computer. (The files are not accessible from a TV.)+
    Get the MacBook! Good luck with your projects. Take the time to do all the tutorials Apple offers for its iLife applications. Spend time here in the discussions for the apps you are using. Utilize the Search function to see if someone else has asked and received answers to a problem similar to yours. You will learn a lot and find answers that even the Apple Genius bar people do not have!
    Message was edited by: Beverly Maneatis

  • Costing run activity one materieal is value double another materieal  corec

    Dear gurus,
    we run costing run in 20 materieal code insted of 20  materieal  one materieal is showing  double value remaining materieal is showing perfect.
    we chacked BOM and routing in workcenter which is same for all materieal codes,
    please replay as soon as posible i want release materieal cost.
    Thank you!
    Regards,
    Pradheep.

    Hi,
    see product cost estimates is calculated using cnsumption qty mention in BOM multiplied by the price maintained in the material master + std direct activity qty mentioned in workcenter/routing and indirect activities related cost center multiplied by the activity rate maintained in KP26.
    Now i am amazed that how could be BOM / ROUTING can be same for all the material, if this is the case means all the material and its cost will come as same if there is no difference in indirect activity qty and rate.
    So plz check the BOM Components there might be double std qty entered for the consumption else there would be the line repetion for the qty. U can also check for the direct activity qty and activity calculation formula.
    Regards / Ashok verma

  • HT204053 Now I've got it totally screwed up.  I have one address for iCloud and another for iTunes.  I would rather have only 1 but can't make the forms fill out correctly to do that.  What now?

    I've just bought my iPhone and have had an iTunes account for some time.  While setting up the iPhone - Apple ID - the form would not allow me to use my currect primary email address.  I had to insert another one because of the iTunes email address apparently.  Now I can't seem to get it straightened out.  I need my primary email address to be the only one and use a secondary address for the "rescue" address. How can I manage this without making everything worse?

    Welcome to the Apple Community.
    You need to use the original Apple ID you used for iTunes with iTunes and iCloud on your new device. What problems did you encounter when you tried to do this.

  • I have an ipad 2 and want to have one account for home and another for work, how do i do this?

    I have an Ipad 2 and use it for work, I want to run a second account for home, how do I do this?

    What kind of accounts? Multiple email accounts are supported.
    Multiple user accounts are not.
    If you are saying you would like to have one set of apps, media, etc
    for work and a different set for home, and switch between the 2
    depending on network login or location, this is not a feature of iOS.
    If this is not what you are asking, please post more details so someone
    may offer a solution.

  • Back Button works one way for execute and another for enter

    I created a custom program that includes a selection screen and a detailed list/table output.  When a user enters their selection criteria and hits enter (instead of execute) they'll go to the next screen, and when they are ready to back out, it goes back to the selection screen, which is correct.  But when a users enters their selection criteria and hits the Execute button, they'll go to the detailed screen and when they press the back button, it backs out of the program completely.  I don't understand why their is a difference between the two and how it would affect the back button.  Also, I don't know how to get the execute button and the enter key to act the same way.  Can any one offer any suggestions?

    For the create program the selection screen logic is as follows:
    parameters: s_matnr1 like mara-matnr,
                 s_kunnr like kna1-kunnr.
    start-of-selection.
    at selection-screen on s_matnr1.
      if s_matnr1 is initial.
        message i080(zc) with 'Material number is required' .
        flag_error = 'Y'.
      endif.
    LOOP at s_matnr1 to flag all invalid materials. Display message.
      select matnr
        from mara up to 1 rows
         into mara-matnr
         where matnr eq s_matnr1.
      endselect.
      if sy-subrc ne 0.
        message e080(zc) with 'Invalid Material'.
      endif.
      clear:   process_kunnr,
               process_matnr,
               zkotg903_excpts_tab,
               no_kunnr.
      refresh: process_kunnr,
               process_matnr,
               zkotg903_excpts_tab.
    at selection-screen on s_kunnr.
      if s_kunnr is initial.
        no_kunnr = 'Y'.
      else.
        no_kunnr = 'N'.
        select kunnr from kna1 up to 1 rows
           into kna1-kunnr
           where kunnr eq s_kunnr.
        endselect.
        if sy-subrc ne 0.
          message e080(zc) with 'Invalid Customer'.
        endif.
      endif.
      perform get_material.
      loop at process_matnr.
        move process_matnr-matnr to zkotg903_excpts_tab-matnr.
        if no_kunnr = 'N'.
          select kunnr
            from kna1
            into  table process_kunnr
             where kunnr eq s_kunnr.
        endif.
        if sy-subrc = 0.
          loop at process_kunnr.
            select *
              from zkotg903_excpts
              where matnr = process_matnr-matnr
              and   kunnr = process_kunnr-kunnr.
            endselect.
            if sy-subrc <> 0.   
      move process_kunnr-kunnr to zkotg903_excpts_tab-kunnr.
              zkotg903_excpts_tab-datbi = '99991231'."validity end date
              zkotg903_excpts_tab-datab = sy-datlo.  "validity begin date
              zkotg903_excpts_tab-zzuname = sy-uname.
              append zkotg903_excpts_tab.
            else.
              message i318(zc) with process_kunnr-kunnr
                 process_matnr-matnr.
              flag_error = 'Y'.
            endif.
          endloop.        "endloop for kunnr
        else.
          message i190(zc) with s_matnr1+3.
          flag_error = 'Y'.
        endif.
      endloop.           "endloop for matnr
    if there isn't a customer, append material to zkotg903_excpts_tab.
      if no_kunnr = 'Y'.
        append zkotg903_excpts_tab.
      endif.
      if flag_error = 'N'.
        call screen '100'.
      else.
        call selection-screen 1000.
      endif.
    The maintenance program is a little less involved as I am sure you know.  If you would like to see that code as well, I can post it.

  • Setting up IPad on one machine for use on another

    Next week my wife and I celebrate our Ruby aniversary and I am surprising her with an IPad2 on to which I hope to put a video-card that my Daughter in Law has compiled and edited.  That last bit is relatively easy, the hard bit is getting the Ipad synched with my wife's three other apple devices without her knowing.  For the record she has a MacPro, a Macbookpro and an IPhone (3GS) all of which are in use at some time during the day.  The 'normal' way is to attach the Ipad to the user's machine and to set it up for them, but if I do that then I know that she will see a confirmation mail from Apple - she rarely leaves her machines outside of
    How do I do this so that she won't know until she opens the IPad box?
    I too have three Apple devices - Ipad2, Macbookpro and IPhone (4). 
    So, for example, can I synch and upgrade the IOS on my macbookpro then change the identity just before I give it to her or is there some other way.  BTW we both have me.com accounts too - quite an orchard what!  I would like to get it set up and to test that the video runs ASAP, so your help and guidance would be cratefully received.
    Uncle H

    Yes. Let the user configure on the user's machine and not on a different computer.

  • COB1 Batch Search Startegy for Component in another plant

    Is there a way to build Batch Search Strategy (COB1) for components in another plant?  We use Batch Search Strategy in PP-PI process orders. If so, what is the configuration?

    Resolved in EAM forum

  • Need to compare values in two columns of one table against values in two columns in another table

    Hi, as the title reads, I'm looking for an approach that will allow me to compare values in two columns of one table against values in two columns in another table.
    Say, for instance, here are my tables:
    Table1:
    Server,Login
    ABCDEF,JOHN
    ABCDEF,JANE
    FEDCBA,SEAN
    FEDCBA,SHAWN
    Table2:
    Server,Login
    ABCDEF,JOHN
    ABCDEF,JANE
    FEDCBA,SHAWN
    In comparing the two tables, I'd like my query to report the rows in table1 NOT found in table2. In this case, it'll be the 3rd row of table one:
    Server,Login
    FEDCBA,SEAN
    Thanks.

    create table Table1([Server] varchar(50), Login varchar(50))
    Insert into Table1 values ('ABCDEF','JOHN'),('ABCDEF','JANE'),('FEDCBA','SEAN'),('FEDCBA','SHAWN')
    create table Table2([Server] varchar(50), Login varchar(50))
    Insert into Table2 values ('ABCDEF','JOHN'),('ABCDEF','JANE'), ('FEDCBA','SHAWN')
    select [Server] ,Login from Table1
    Except
    select [Server] ,Login from Table2
    select [Server] ,Login from Table1 t1
    where not exists(Select 1 from Table2 where t1.[Server] = t1.[Server] AND Login=t1.Login)
    drop table Table1,Table2

  • Update one column while getting the value in another column

    Is it possible to in one single SQL statement update two columns in a table while at the same time obtaining the value of another column, on the same row, in the same table, and independently (that is, the update of the columns has nothing to do with the data that I want from another column)*?* Of course, I can do this in two operations, one being a "select" and the other one being an "update", but since I am in the same table and even on the same row, is it really necessary to make TWO database calls? That's why I want to combine the the two SQL-statements, for reasons of presumed effiency.

    jsun wrote:
    Is it possible to in one single SQL statement update two columns in a table while at the same time obtaining the value of another column, on the same row, in the same table, and independently (that is, the update of the columns has nothing to do with the data that I want from another column)*?* Of course, I can do this in two operations, one being a "select" and the other one being an "update", but since I am in the same table and even on the same row, is it really necessary to make TWO database calls? That's why I want to combine the the two SQL-statements, for reasons of presumed effiency.Two statements != two database calls.
    At least not in terms of SQL.
    JDBC requires a 'statement' but in SQL (depending on the data source) that can include multiple statements. An obvious example of this is a stored proc but there are other ways as well.

Maybe you are looking for

  • Text Caption - Different Color

    Hi There, I have looked through the posts and have not found a question like this, but that may be because folks already know they can't do it. The question is can I set an existing text caption - like Adobe Blue to have a different background color?

  • Installing additional 32bit printer drivers on Windows Server 2008R2

    Hi, I'm trying to add additional printer drivers (32bit) on a 64bit server so that 64bit and 32bit clients can add printers from the print server. I have found several posts about this and none has helped me so far. I found one from GeorgeLawr that I

  • Cursor Vs Select statement

    Hi, Please let me know what is the difference between using OPEN CURSOR and SELECT statement WITH PACAKGE additon. Praneeth

  • Songs cutting short, play for 1st few seconds and s

    Hi, I noticed some of my songs that I've transferred into my muvo v00 are cutting short and would only play for the first 0 or so seconds. I've got the latest firmware and I know that there isn't anything wrong with these songs when I play it on my o

  • Summarize total for Row items in pivot table

    Hi, I have a certain number of row items and few fact columns. 2 of the row items are level based measures that will summarize on other conditions so I cannot have them in the Fact section. But for these 2 row items (in the Rows section) I want them