How to seach for a particular text in comma separated values

Hi,
I have one table for eg. TB_Fruits.
In that i have one column FruitsName(Varchar)
In that column i am storing string in comma separated values.
Select FruitsName from tb_fruits;
Result: orange,banana,apple
Now the issue is suppose if i try to insert any of these fruits name again then it should not allow me to insert.
Suppose now if i try to insert ('grapes,banana')
or
('apple,grapes')
the orange,banana,apple can be in any position.
How to check if any of these names already exist or not in the column fruitsname?
I cannot use like or INstr function here. because the position is not fixed not even string.
Appreciate any help.

After doing search.
Got to know <= 3 length in word is in stoplist.
That's why the value ALL it was not searching in index.
After modifying the index this problem is solved.
CREATE INDEX
Fruitsname_idx ON tb_fruits (FruitsName)
indextype is ctxsys.context
PARAMETERS('SYNC ( ON COMMIT)
stoplist ctxsys.empty_stoplist');
But now the issue is suppose i have value with space..
i inserted one more row with value 'FRUITS YELLOW'
So in the index it is storing two rows....one is for FRUITS and second is for YELLOW.
select * from tb_fruits t where contains(t.FruitsName,'FRUITS')>0
I will get record..but actually there should be no record.
And it should allow me to insert. So i can insert the value FRUITS in more row.
Any help on how to store the value with space in one row in index??

Similar Messages

  • How to search for a particular word in a string?

    How to search for a particular word in a string?
    thanks for your help....

    This works fine.
    public class Foo {
        public static void main(String[] args) {
        String s = "Now is the time for all good...";
        String s2 = "the time";
        System.out.println(s.contains(s2));
        System.out.println(s.contains("for al"));
        System.out.println(s.contains("not here"));
    }output:true
    true
    falseYou must have something else wrong in your code.
    JJ

  • How to search for a particular word in a long document?

    How to search for a particular word in a long document?

    What program are you using to read the document?
    Good luck.

  • How to search for a particular pattern in a string

    Hi,

    Hi ,
    How to search for a particular pattern in a string?
    I heard about java.util.regex; and used it in my jsp program.
    Program I used:
    <% page import="java.util.regex"%>
    <% boolean b=Pattern.matches("hello world","hello");
    out.println(b);%>
    I run this program using netbeans and am getting the following error message.
    "Cannot find the symbol : class regex"
    "Cannot find the symbol : variable Pattern "
    How to correct the error?

  • When I import a text file(comma separated )into a numbers spread sheet all the data goes into one column. Why does the text not go into separate columns based on the commas.

    When I import a text file(comma separated) into a numbers spreadsheet all the data goes into one column instead of individual columns based on the comma separators.  Excel allows you to do this during the import..  Is there a way to accomplish this in numbers without opening it in Excel and the importing into Numbers.

    Your user info says iPad. This is the OS X Numbers forum. Assuming you are using OS X… Be sure the file is named with a .csv suffix.
    (I don't have an iPad, so I don't know the iOS answer.)

  • Custom Document for Comma Separated Values in a JTextField

    Hi,
    I tried to create a custom structured Document implementation for comma separated values (on one line) in a JTextField:
    I want to have one LeafElement for each value (to store as an attribute the Object associated with this value). So, if I plug a DocumentListener to the JTextField, I can easily see which value(s) have been added/removed (see ElementChange).
    I used the PlainDocument implementation as a starting point and replaced the logic related to the '\n' character by the ',' (see #insertUpdate).
    Then I realized that the View must be customized too. So I created a View with a custom #paint method to draw each LeafElement on the same line.
    But, now, I try to fix the ElementChange returned by the #insertUpdate and #removeUpdate methods.
    Indeed, I played with a JTextArea with two lines "Bart\nisa" and plugged a debugging DocumentListener.
    And the event I get when I type 'L' before "isa" is really strange:
    - Two elements removed,
    - Two elements added.
    In the PlainDocument#insertUpdate, the code updates the 'offset' but I don't understand the logic behind.
    Could you explain me why I got this result?
    Could you give me an hint?
    Best Regards,
    El Barto.

    When you say the offset gets updated, I assume you're talking about this bit:
         int offset = chng.getOffset();
         int length = chng.getLength();
         if (offset > 0) {
           offset -= 1;
           length += 1;
         } The result is that, if a character is added at the very beginning or end of a line, the edit gets treated as a multi-line edit, which means the LeafElements on either side of the edit get removed and reconstructed. I discovered this behavior a few years ago, and I never have figured out what purpose it serves. I think you'll just have to try overriding the method to eliminate that behavior, and see what happens.

  • How can one search SmartForms for a particular text or string?

    Hello fellow SAP developers,
    Our client has a need to search for a particular string in all of our Smart Forms and SAPScripts.  For SAPScripts I was able to write a simple Z-Program using function module u201CREAD_FORMu201D to accomplish this.  However, for SmartForms I do not see such an option.
    Could you kindly give me any advice on a similar function module I could use to search through Smart Forms for a particular string?
    Thank you so very much,
    Chris

    Hello Christopher and SAP developers,
    I would like to recover this post, since I'm exactly in the same situation: our client needs a change in its nomenclature and it would be helpful to learn an efficient way to change the string from the SmartForms.
    At the end, did you found a "smart" way to do this?
    Thank you in advance,
    Steve

  • How to search for a particular element within a XML variable using studio?

    All,
    I am using studio 7.0 to develop a webbased application. In this, i need to access
    an oracle db using a WLAI Application View from my Workflow. I get some data back
    from Oracle as an XML variable and then apply an XPath statement to access the
    individual columns returned.
    My problem arises when there are no records in the db matching my criteria and
    an empty XML variable is returned to me from the app view. In these cases my
    XPath statement fails in studio causing an improper exit.
    Does anybody know how to check for content in a XML varaible using studio? So
    that if there is content i can proceed with XPath and if there is no content,
    then i will take a different route.
    Thanks in advance
    Regards
    Sri

    If I remember correctly, the adapter will return an XML document that contains
    XML elements for each row. You can just simply check the count of these elements
    with an XPath statement: ie. count(response/row)
    "Sri " <[email protected]> wrote:
    >
    All,
    I am using studio 7.0 to develop a webbased application. In this, i need
    to access
    an oracle db using a WLAI Application View from my Workflow. I get some
    data back
    from Oracle as an XML variable and then apply an XPath statement to access
    the
    individual columns returned.
    My problem arises when there are no records in the db matching my criteria
    and
    an empty XML variable is returned to me from the app view. In these
    cases my
    XPath statement fails in studio causing an improper exit.
    Does anybody know how to check for content in a XML varaible using studio?
    So
    that if there is content i can proceed with XPath and if there is no
    content,
    then i will take a different route.
    Thanks in advance
    Regards
    Sri

  • How to search for a particular word in notes app (ios6)

    Sir,
    I can search for a note but i couldnt search for a particular word in a long note in notes app.
    (ios 6)
    is there a way to do it,or is there any app that has this 'search for word' functionality ?

    thank you for your quick reply sir.
    i am asking for other independent notable apps(not notes app) which has this functionality .

  • How to search for the particular ABAP Object

    Hi,
    I am using the SAP 4.6C machine, I need to search for the particular ABAP Object. Plz can anyone help me in this.
    Regards,
    Pralhad P. Teggi

    You'll get a better response if you ask a meaningful question.
    If you want to scan for Business Objects (BOR) use transaction SWO1
    For ABAP classes / objects use a combination of transactions SE24 / SE18 / SE19 and /or SE80
    (SE 18 /  SE 19 are for Badi's)
    Cheers
    Jimbo

  • How to search for the selected text with a non-default search engine?

    Hi,
    Before the recent update of the search bar, you could select your "current" search engine, and a search for the selected text (right-click on selection) would use that engine.
    Now, it seems that you can only search for the selected text using the default engine. If that's correct, this is a major step backwards for me. For instance, I can't have Google as my default search engine, and search for a selected text on eBay!
    Or am I missing something?
    Thanks!
    R.

    I find this extension very useful for items selected on web pages. It offers all your search engines with select>right click.
    https://addons.mozilla.org/en-US/firefox/addon/context-search/?src=search

  • How to handle comma separated values in OLE DB Source query for a parameter variable from XML file in SSIS

    Hi,
    I am using OLE DB Source to fetch the records with Data Access Mode as SQL COMMAND which is using the below query with a parameter,
    SELECT CON.Title,CON.FirstName,EMP.MaritalStatus,EMP.Gender,EMP.Title AS Designation, EMP.HireDate, EMP.BirthDate,CON.EmailAddress, CON.Phone
    from HumanResources.Employee EMP INNER JOIN Person.Contact CON ON EMP.ContactID=CON.ContactID WHERE EMP.Title in (?) 
    In this query for the parameter I am passing the value from a variable and which is configured (XML Configuration). While passing value
    Buyer it works correctly. But while passing values Accountant,Buyer
    it is not working as expected.
    How to handle while passing such multiple values Or is it possible to pass such values or not in SSIS 2012 ?
    Kindly help me to find a solution.
    NOTE: I placed the whole query in a variable as a expression as below it is working fine.
    "select CON.Title,CON.FirstName,EMP.MaritalStatus,EMP.Gender,EMP.Title AS Designation,EMP.HireDate,EMP.BirthDate,CON.EmailAddress,CON.Phone from HumanResources.Employee EMP
    INNER JOIN Person.Contact CON ON EMP.ContactID=CON.ContactID WHERE EMP.Title in ('" + REPLACE(@[User::temp],",","','")  +"')"
    Any other solution is there ? without placing the query in a variable. May be a variable can have some limitations for no. of characters stored not sure just a thought.
    Sridhar

    Putting the whole thing into a variable is certainly a valid solution.  The other involves putting the comma delimited list into a table valued variable.
    http://gallery.technet.microsoft.com/scriptcenter/T-SQL-Script-to-Split-a-308206f3
    For an odd ball approach: 
    http://www.sqlmovers.com/shredding_multiline_column_using_xml/ .
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • Unable to pass comma separated values for in clause

    I have the following query : for :P_LEG_NUM Parameter when i am passing values like 1,2,5 as string type i am getting invalid number error... I have defined in clause for it but still it does not work.. For individual values like 2, etc it works... how can i pass comma separted values for this bind variable
    select trip_number as prl_trip_number,
           flight_number as prl_f_number,
           trip_leg_id as prl_trip_leg_id,
           leg_number as prl_leg_num,
           dicao as prl_dicao,
           etd_zulu as prl_etd_zulu,
           aicao as prl_aicao,
           eta_zulu as prl_eta_zulu,
           to_char(etd_zulu,'DD-Mon-YYYY HH24:MI') as prl_cb_etd,
           to_char(eta_zulu,'DD-Mon-YYYY HH24:MI') as prl_cb_eta,
           diata as prl_diata,
           aiata as prl_aiata,
          (select client_name
           from xxwfs_trip_header_details t_h
           where t_h.trip_number = t_leg.trip_number) as prl_client_name,
          (select to_char((select systimestamp at time zone 'GMT' from dual),'YYYY-MM-DD-HH24MI')
           from dual) as prl_curr_zulu_date
    from xxwfs_trip_leg_details t_leg
    where 1=1
    and t_leg.leg_number in nvl(:P_LEG_NUM,t_leg.leg_number)
    and t_leg.trip_number = :P_trip_no

    This is the problem know as <tt>'Varying IN List'</tt> issue.
    Check this - SQL and PL/SQL FAQ

  • Comma separated values for input and return multiple values

    Hello everyone,
    I have this simple package. Can someone suggest a way to accept multiple empno as input (comma separated) and to return set of salary values for the set of employee numbers (compatible to work with lower Oracle versions). Thanks much!
    CREATE OR REPLACE PACKAGE test_multi IS
    FUNCTION GET_sal(P_empno IN emp.empno%TYPE) RETURN NUMBER;
    END test_multi;
    CREATE OR REPLACE PACKAGE BODY test_multi IS
    FUNCTION GET_sal(P_empno IN emp.empno%TYPE) RETURN NUMBER IS
    V_sal NUMBER(10,2);
    MSG VARCHAR2(200);
    BEGIN
    SELECT sal
    INTO V_sal
    FROM emp
    WHERE empno = p_empno;
    RETURN V_sal;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('No data found.');
    IF (V_sal IS NULL OR V_sal = 0) THEN
    V_sal := 0;
    END IF;
    RETURN V_sal;
    WHEN OTHERS THEN
    MSG := SUBSTR(SQLERRM, 1, 70);
    DBMS_OUTPUT.PUT_LINE(MSG);
    END GET_sal;
    END test_multi; -- End package

    A way to do this in 10g or above...
    SQL> ed
    Wrote file afiedt.buf
      1  with e as (select '7499,7698,7654,7902' as enos from dual)
      2  --
      3  select empno, sal
      4  from emp
      5  where empno in (select regexp_substr(enos,'[^,]+',1,rownum)
      6                  from   e
      7*                 connect by rownum <= length(regexp_replace(enos,'[^,]'))+1)
    SQL> /
         EMPNO        SAL
          7902       3000
          7698       2850
          7654       1250
          7499       1600
    SQL>As for Oracle 8, .... well.... like Oracle, I no longer use unsupported versions, so I'd recommend you upgrade to something that is supported.

  • How to display Error for a particular text box programaticaly

    Hello All,
    I have 5 text boxes in a form and I have a requirement where if user click on any of the text boxes then i need to pass the id to class A and show the error description related to that text box in faces message.
    I have created class A in which i need to pass the id and get the error description but the problem is that the error description is in array list so i have created list of type class B which contains description.
    Right now in class A I have :-
    id ||||||||| description <>
    it1-------1.Invalid number
    -------2.Number not in use
    -------3.Number is out of range
    it2------1.error1
    2.error2
    3.error3
    and so on.....
    *public class ClassA {*
    public String Id;
    public List<ClassB> desc = new ArrayList();
    *public ClassA() {*
    super();
    *public void setId(String Id) {*
    this.Id = Id;
    *public String getId() {*
    return Id;
    *public void setDesc(List<ClassB> desc) {*
    this.desc = desc;
    *public List<ClassB> getDesc() {*
    return desc;
    *public class ClassB {*
    public String Description;
    *public ClassB() {*
    super();
    *public void setDescription(String Description) {*
    this.Description = Description;
    *public String getDescription() {*
    return Description;
    How do I pass the id and get the description for eg:- If id is it1 then How would I show all the 3 errors in faces message on value change.
    Please Suggest.
    Thanks in advance.

    your case is not clear.
    but this link may help you
    http://mjabr.wordpress.com/2011/08/31/how-to-show-multi-lines-afmessage/

Maybe you are looking for