How to search a string from the database?

how to search a string from the database? starting with some character

If you're trying to do this in a SELECT, you can use the LIKE verb in your WHERE clause.
Here's an Example
  SELECT obj_name FROM tadir
    INTO prog
    WHERE pgmid = 'R3TR'
      AND object = 'PROG'
      AND obj_name LIKE 'Z%'.
In this case it will select every row that obj_name starts with Z. 
If you wanted to find every row that the field obj_name contains say... 'WIN'  you use LIKE '%WIN%'.
Edited by: Paul Chapman on Apr 22, 2008 12:32 PM

Similar Messages

  • How to select alternate entries from the database table

    Hi Experts,
    can u help me, how to select alternate entries from the database table.
    Thanks

    As there is no concept of sequence (unless there is a field specifically included for the purpose), there is no meaning to "alternate" records.
    What table do you have in mind, what data does it hold, and why do you want alternate records?
    matt

  • How I can transfer data from the database into a variable (or array)?

    I made my application according to the example (http://corlan.org/2009/06/12/working-in-flash-builder-4-with-flex-and-php/). Everything works fine. I changed one function to query the database - add the two parameters and get the value of the table in String format. A test operation shows that all is ok. If I want to display this value in the text area, I simply drag and drop service to this element in the design mode
    (<s:TextArea x="153" y="435" id="nameText" text="{getDataMeanResult.lastResult[0].name}"  width="296" height="89"  />).
    It also works fine, just a warning and encouraged to use ArrayCollection.getItemAt().
    Now I want to send the value to a variable or array, but in both cases I get an error: TypeError: Error #1010: A term is undefined and has no properties..
    How can I pass a value from the database into a variable? Thank you.
    public var nameTemp:String;
    getDataMeanResult.token = authors.getDataMean(arrayOfNumber[0], dir_id);
    nameTemp = getDataMeanResult.lastResult[0].name;
    public var nameArray:Array = new Array();
    for (var i:uint=o; i<3; i++){
    getDataMeanResult.token = authors.getDataMean(arrayOfNumber[i], dir_id);
    nameArray[i] = getDataMeanResult.lastResult[0].name;
    And how i can use syntax highlighting in this forum?

    Astraport2012 wrote:
    I have to go back to the discussion. The above example works fine when i want to get a single value of the database. But i need to pass an array and get an array, because i want to get at once all the values for all pictures tooltips. I rewrote the proposed Matt PHP-script and it works. However, i can not display the resulting array.
    yep, it won't work for Arrays, you'll have to do something slightly more intelligent for them.
    easiest way would be to get your PHP to generate XML, then read that into something like an ArrayList on your HTTPService result event (depends what you're doing with it).
    for example, you could have the PHP generate XML such as:
    <pictures>
         <location>test1.png</location>
         <location>test2.png</location>
         <location>test3.png</location>
         <location>test4.png</location>
         <location>test5.png</location>
         <location>test6.png</location>
    </pictures>
    then you'll read that in as the ResultEvent, and perform something like this on it
    private var tempAC:ArrayList = new ArrayList
    protected function getStuff_resultHandler(event:ResultEvent):void
        for each(var item:Object in event.result.pictures)
           var temp:String = (item.@location).toString();
           tempAC.addItem(temp);
    in my example on cookies
    http://www.mattlefevre.com/viewExample.php?tut=flash4PHP&proj=Using%20Cookies
    you'll see an example of how to format an XML structure containing multiple values:
    if($_COOKIE["firstName"])
            print "<stored>true</stored>";
            print "<userInfo>
                    <firstName>".$_COOKIE["firstName"]."</firstName>
                    <lastName>".$_COOKIE["lastName"]."</lastName>
                    <userAge>".$_COOKIE["userAge"]."</userAge>
                    <gender>".$_COOKIE["gender"]."</gender>
                   </userInfo>";
        else
            print "<stored>false</stored>";
    which i handle like so
    if(event.result.stored == true)
                        entryPanel.title = "Welcome back " + event.result.userInfo.firstName + " " + event.result.userInfo.lastName;
                        firstName.text = event.result.userInfo.firstName;
                        lastName.text = event.result.userInfo.lastName;
                        userAge.value = event.result.userInfo.userAge;
                        userGender.selectedIndex = event.result.userInfo.gender;
    depends on what type of Array you're after
    from the sounds of it (with the mention of picture tooltips) you're trying to create a gallery with an image, and a tooltip.
    so i'd probably adopt something like
    <picture>
         <location>example1.png</location>
         <tooltip>tooltip for picture #1</tooltip>
    </picture>
    <picture>
         <location>example2.png</location>
         <tooltip>tooltip for picture #2</tooltip>
    </picture>
    <picture>
         <location>example3.png</location>
         <tooltip>tooltip for picture #3</tooltip>
    </picture>
    etc...
    or
    <picture location="example1.png" tooltip="tooltip for picture #1"/>
    <picture location="example2.png" tooltip="tooltip for picture #2"/>
    <picture location="example3.png" tooltip="tooltip for picture #3"/>
    etc...

  • How to have a multilanguage from the database

    Hi,
    I have an application under jdev 11g.
    I am using the locale and the bundle for the multilanguage.
    My problem is with the data from the database.(i.g. select on choice with the items dynamic from the database)
    Also if i am displaying for example the customer info in af:outputtext i want his name to be displayed in english , arabic and other according to the locale choice
    The Fusion Web guide on specifies the resource bundle issue.
    Any hints, doc or sample regarding this issue.
    Best Regards
    Emile BITAR
    Edited by: ebitar on Jun 11, 2009 8:24 AM

    Hi,
    resource bundles work for labels but not data. If you have such a requirement then you need to add this using a discriminator column when querying it. Say you maintain the display data in multiple languages, then you would have a column that holds the language. The query would then be for the language the user expects. If you have static data - in the select one choice case - you can use
    http://thepeninsulasedge.com/frank_nimphius/2007/09/05/adf-faces-localizing-selectonechoice-labels/
    Frank

  • OMBPLUS - How to import a table from the database

    I have a table that is out of sync with its database definition. In OWB, I would go to the Tables section and select Import and re-import the file in. How do I script this in OMBPLUS.

    If I do the OMBRETRIVE TABLE 'CUSTOMER' GET COLUMNS then all I get is a list of columns displayed in OMBPLUS. Doing a OMBCOMMIT does not modify the table in the OWB repository. It still does not have the new columns.
    Also, when I import a table from the GUI, I UNCHECK the two advanced options of: 'Preserve repository added constraints' and 'Preserve repository added columns'. I also get to select from the GUI I get to choose how many levels of foreign key constraints to retreive. How do I specify these in the OMBPLUS script as well.

  • How to paste an image from the database by creating a new page?

    Hai,
    i'm trying to paste more than 6 images in two pages...
    The condition is that i want to paste only 3 images in a page.
    When the first 3 images were pasted... i want a new page to be automatically created and the next or 4th image will be pasted on the
    next page...
    i have codings for creating a new page and for pasting the image...
    But how shall shall i paste the 4th image in the next page...
    Can any one plzz explain me...

    >
    Hi, I'd like to display a dynamic image from the web inside a JLabel or any other swing component it could work in. I've been looking on the Swing tutorials and others forums, all I can have is that a JLabel can load an Icon object, defined by an image URL, but can this URL be like "http://xxxxx/image.jpg" somehow or can it only be a local image URL?>
    I do not know why you start talking about an image on the web then go on to show concerns about whether it will work for a 'local' URL.
    But perhaps this answer will cover the possibilities.
    So long as you can from an URL to the image, and the bytes are available for download (e.g. some web sites wrap a direct call to an image in HTML that embeds the image), the URL based icon constructors will successfully load it.
    It does not matter if that URL points to
    - a web site,
    - a local server ('localhost'),
    - an URL representation of a File on the local file system, or
    - it is inside a Jar file that is on the application's run-time classpath.
    How you go about forming a valid URL to a 'local resources' (or indeed what you regard as local resources) is another matter, depending on the form of the project, and how the resources are stored (see list above).
    Probably the main reason that examples use images at a hard coded URL on the net is that it makes an 'image example' self contained. As soon as we compile and run it, we can see the result. I have posted a few examples like that on these forums.
    Edit 1:
    BTW - Welcome to the Sun forums
    Edited by: AndrewThompson64 on Apr 21, 2009 12:15 PM

  • How to get Chinese string in the database?

    Hi,
       My dear friends.
       I successfully connect the database, the data in the table as shown below
      When I try to get "小明", but the following results were obtained
    Does anyone know why, and how to get the correct result?
    Thank you.

    You need to be aware of character conversions. Look at WideString, it support UTF32 chars.

  • How to send an email from the database

    i have create a post insert trigger at the database level for the emp table and that trigger call a procedure and that procedure send a email to the new employee, i the trigger send the firt name , second name , last name and the email address to the procedure .so my questions is about the command that will send the email to the new employee ,and the send email will look like this
    Dear "fist name "second name" "last name"
    welocme to..........................................................

    This thread could help answer some of your questions:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:2391265038428
    C.

  • How to retrieve characters like '£' from the database and write to xml file

    Hi ,
    I have a requirement to retrieve the data from database and write to files in XML format.
    I am able to do so successfuly by using XMLElement tag and writing to file through UTL_File package.
    All characters like <&@^ get converted properly, but when it comes to multibyte chars like '£', they are not able to get converted as it is.
    Can somebody please advise me how to go ahead.
    Regards

    Thanks odie.
    The nls_charset for my database is WE8ISO8859P1 and database version is Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi.
    The data (with pound sign) is sitting in one of the columns of the table and when i query it directly, I am able to view it properly.
    However when I use the below code to retrieve in XML format and print it to file, it gets changed. This file is also passed to one of the application GUI where this XML gets processsed and it is not visible properly.
    below id the sample abstract of code I am using.
    Declare
    l_file UTL_FILE.FILE_TYPE;
    l_clob CLOB;
    l_buffer VARCHAR2(32767);
    l_amount BINARY_INTEGER := 32767;
    l_pos INTEGER := 1;
    Begin
    SELECT XMLElement("case",
    XMLElement("comments",
    XMLElement("comment",
    XMLElement("comments",a.COMMENTS)
    ).getClobVal() val1 into l_clob
    FROM TO_COMMENTS a
    l_file :=
    UTL_FILE.fopen (XMLDIR,
    test.xml,
    'w',
    32767);
    LOOP
    DBMS_LOB.read (l_clob,
    l_amount,
    l_pos,
    l_buffer);
    UTL_FILE.put_line (l_file, l_buffer);
    l_pos := l_pos + l_amount;
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.NEW_LINE('Reached end of file');
    END;
    The comments column given contains the character like pound.
    And once the file is generated and i see using the vi editor, the char is not viewable properly like £
    And when the same is passed to GUI application to be processed, its not viewable propely in GUI from IE as well like �.

  • How to modify data recieved from the database and displayed in a DG

    Hello, it's me again with a simple question :
    i've got the SQLi request who returns multiples rows.
    In this row i have for example :
    Reward --> 1
    How to, instead of displaying  1 in the datagrid, change this value to "YES"
    I follow this lead :
    private function onResultStats(event:ResultEvent):void
                    ServerStatsArr = new ArrayCollection(event.result.source);
                    for (var i:int=0; i < ServerStatsArr.length;i++)
                        if (ServerStatsArr[i].abonnement ==  304){
                            ServerStatsArr[i].abonnement = 'Premium';
                        }else{
                            ServerStatsArr[i].abonnement = 'Non';   
                        if (ServerStatsArr[i].transparence ==  1) {
                            ServerStatsArr[i].transparence = 'Oui' ;
                        }else{
                            ServerStatsArr[i].transparence = 'Non' ;
                    ServerStatsArr.refresh();
    Why this method is working for abonnement when (ServerStatsArr[i].abonnement ==  304) it displays Premium but it's NOT working for transparence ?
    i tested (ServerStatsArr[i].transparence ==  1) and (ServerStatsArr[i].transparence ==  '1')
    Thank you

    hi Again,
    private function setLabel(item:Object,column:DataGridColumn):String
    switch(column.dataField)
    case "transparence":
    if (item.transparence == "1")
    return ("yes")
    else
    return ("no")
    break;
    case "abonnement":
    if (item.abonnement == "304")
    return ("premium")
    else
    return ("none")
    break;
    default:
    return("");
    and the adjustments to your grid - add the labelfunction to the following columns
    <mx:DataGridColumn headerText="transparence" dataField="transparence" labelFunction="setLabel"/>
    <mx:DataGridColumn headerText="abonnement" dataField="abonnement" labelFunction="setLabel" />
    I hope we get a distinction credit for this assignment ...
    David.

  • How to search for pictures from the net

    and display them in jsp?
    I would like to write a jsp file that searches pictures on the net and displays them in the browser.
    what is the code for searching the net?
    should i download the pictures or can i link to them?
    thank you

    and display them in jsp?
    I would like to write a jsp file that searches
    pictures on the net and displays them in the
    browser.
    what is the code for searching the net? I thought you wanted to write a JSP for that? Now you want the code given to you?
    Google makes an API to use their search engine. Look it up.
    >
    should i download the pictures or can i link to
    them?
    thank you

  • How to search this value in oracle database to find out the table

    Hi expert,
    I know there is a value in oracle database, please show me how to search this value in oracle database to find out the table holding this value.
    Many Thanks,

    918440 wrote:
    Hi friends,
    this question is really practical, I already know there is value from application saved in database, I want to search the whole database to figure out which table the value is contained.write SQL that writes SQL to query every table.
    Handle:     918440
    Status Level:     Newbie
    Registered:     Mar 2, 2012
    Total Posts:     20
    Total Questions:     10 (10 unresolved)
    why do you waste time here when you NEVER get any answer to any question you post?

  • How do I remove a row from the database?

    Guys and Gals,
    I'm using Studio Edition Version 11.1.1.3.0.
    The code below will delete a row from my table, but how do I actually delete the row from the database as well?
        DCBindingContainer dcbc = (DCBindingContainer)getBindings();
        DCIteratorBinding dcib = dcbc.findIteratorBinding("TipsSelectorIterator");
        dcib.removeCurrentRow();
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("Commit");
        Object result = operationBinding.execute();
        AdfFacesContext adffacesctx = AdfFacesContext.getCurrentInstance();
        adffacesctx.addPartialTarget(this.getQueryTable()); In this post, I believe Frank sums up what I should do: Remove row from af:table
    >
    The problem in your case is that this removes the row from the iterator but not your business service. EJB exposes explicit methods to remove an entity. A method lime removeEmployees(employee) >expsed on the EJB model must be called.
    You can drag and drop the "removeEmployees" method then as a button to your page. Rename the text label to "Remove" or "Delete". In the opened dialog box, point the method argument to the >following EL #{bindings.iteratorName.currentRow.dataProvider}. Next time you press the button, the row is deleted from the iterator and the business service
    Huh? So to delete the row, I need to expose a method. But where? Do I do this in the AppModuleImpl so I can expose it to the Client Interface? But then how do I access entities? And what data type is the #{bindings.iteratorName.currentRow.dataProvider}?
    If anyone could point me in a general direction, it'd be great.

    Frank and Shay,
    Thank you both for your posts. I'm amazed there's such a great place to get help. Between the forums, ADF code corner, Not Yet Documented ADF Samples, various blogs and tutorials, it's obvious you guys really care about what you do.
    On my example, that approach doesn't seem to work. I tried following it like so in one of the video tutorials by Shay: http://blogs.oracle.com/shay/2010/04/doing_two_declarative_operatio.html. Following Shay's approach, in my particular case, deletes only from the table. Perhaps it is due to my iterator / collection setup?
    TipsSelector (1 to 1) -> TipsView (1 to *)-> DependentBom -(1 to * Recursive)> RecursiveBom
    TipsSelector references the same View Object as TipsView, but it is set as a 1 to 1 relationship so that I can show TipsView on the page one record at a time. This is the same setup as Tuhra2's hierarchy veiwer example. TipsView / DependentBom is a classic parent / child setup. RecursiveBom is DependentBom referencing itself. Think of it as departments within departments within departments etc...
    I have dragged TipsSelector's Named Criteria (All Queriable Attributes) onto my page and created an ADF Query with Table. A remove button on the table's toolbar calls the two actions, Delete (from TipsSelector's iterator) and then Commit. I have modified the code slightly from my previous post but the end result seems to be the same.
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("Delete");
        operationBinding.execute();
        bindings = getBindings();
        operationBinding = bindings.getOperationBinding("Commit");
        operationBinding.execute();
        AdfFacesContext adffacesctx = AdfFacesContext.getCurrentInstance();
        adffacesctx.addPartialTarget(this.getQueryTable());Page Def file
        <action id="Commit" InstanceName="AppModuleDataControl"
                DataControl="AppModuleDataControl" RequiresUpdateModel="true"
                Action="commitTransaction"/>
        <action IterBinding="TipsSelectorIterator" id="Delete"
                InstanceName="AppModuleDataControl.TipsSelector"
                DataControl="AppModuleDataControl" RequiresUpdateModel="false"
                Action="removeCurrentRow"/>On ppr of the query table, the row is gone. However, when I press the Search button on the query again, the record reappears.
    This is beyond me. Am I somehow deleting from the query results but not the database?

  • How to get first 10 records from the database using JSP

    i want ot get first 10 records from the database and then after clicking the next button in the page,it must show the next precceding 10 records from the database.i am getting the first 10 records .but how to post to the same page to get another preceeding 10 record.

    Search the forums - this has been asked a lot. I usually recommend experimenting with tops and order bys until you're satisfied.
    Kind regards,
      Levi

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

Maybe you are looking for