Wildcard search for numeric values using select ?

Hi,
I want do wildcard search for numeric fields of the table.
For charcter/string i have used - select * from XX_TABLE where param1 like 'SS%'. But this query doesnt work when para1 is numeric. Please let me know first whether this is possible ? if yes how to achieve it ?
Thanks in advance,
Shrinivas

Hi Jack,
The numeric field is of  8 digits, so when i give search critera as '66', it should return values 66000000, 660000, 6600 etc. so i was not able to give between some range. I also tried storing all these values in internal table and the segregate the values it contains '66*'. This worked well but requires lot of coding effort.Please suggest if you guys have any better method ?
Thanks,
Shrinivas

Similar Messages

  • Searching for numeric values in a text field / SQL Server

    Hi all,
    here's a problem that I've been trying to solve for several days: I try to select rows from an MS SQL Server via JDBC that contain a certain numeric value at a certain position in a long varchar field.
    I'm using queries like
    select * from table where substring(field_1, 37, 7) like '1011234';Those queries always return an empty ResultSet. If I use the same queries in WinSQL, I get correct results (several rows).
    The application code is working in principle; if I search for a text instead of a numeric value, for example select * from table where substring(field_1, 4, 5) like 'Paper'; , I get a complete ResultSet.
    I've tried many variations (= instead of like, search in the entire field (without substring but with like '%1011234%'), with or without ', and more), but that didn't change anything.
    It's also most probably not caused by the JDBC driver; I have tried JTDS first, and then the MS driver (newest versions) - no difference.
    One idea was that the sort order is not correct, tried some COLLATE settings, but that didn't help so far. In this context I'd like to know how to determine the collation sequence of a certain column.
    Another thing I tried was using CAST, for example SELECT * FROM table WHERE CAST(SUBSTRING(field_1, 37, 7) as bigint) = CAST('1011234' as bigint); or SELECT * FROM table WHERE CAST(SUBSTRING(field_1, 37, 7) as bigint) = CAST(1011234 as bigint);, but that didn't help either.
    Some facts:
    Server: Microsoft SQL Server, version 09.00.2047
    Driver in WinSQL: SQLSRV32.DLL, version 03.85.1117
    JDBC-Driver:
    - JTDS, version 1.2
    - Microsoft SQL Server 2005 JDBC Driver, Version 1.2
    JVM: jre1.5.0_11
    I didn't find anything on Google, or in this forum, or other forums. I really hope someone here can help me. Thanks in advance!
    Best regards,
    Uica

    Your note suggests to me that this is a coding problem, not a JDBC or SQL problem unless you are hitting a bug in the SQL Server JDBC driver. Others may have ideas from what you have written, but I think it would be helpful to see the actual code that you are executing that does not bring back the results that you are expecting (don't forgot to use code tags to format your code correctly).
    It might also be helpful to execute a query (from within your Java code) to ensure that you are connecting to the right database, accessing the correct table and that your substring is using the correct offset. The query would look something like this (and then of course display the list of results):
    SELECT substring(field_1, 37, 7) from table

  • Is there any way to search for a term using the Firefox search field, and have the results automatically open in a new tab?

    Is there any way to search for a term using the Firefox search field, and have the results automatically open in a new tab? When there was support for Google Toolbar, I was able to do this; now, whenever I want to search for something, I have to open a new tab to do it, and cut-and-paste my search into the search field in the new tab. I used to be able to highlight, drag, and drop something into the search field and have it automatically open in a new tab. This is enough for me to switch to Chrome . . .

    Set a preference to have searches from the Search Bar (upper right) automatically open all searches in a new tab
    #type '''about:config''' in the URL/Location/Address bar and press the Enter key
    #if you see a warning, accept it (promise to be careful)
    #Filter = '''browser.search.openintab'''
    #in the lower panel, double click the item (or right-click and choose "Toggle") to change the value to "true"
    #close the about:config tab and test
    #See:
    #*For help with opening/using about:config, also see: http://kb.mozillazine.org/About:config
    #*Also see: http://kb.mozillazine.org/About:config_entries (click on "Browser", scroll down to browser.search.openintab)
    '''Search Bar''': http://support.mozilla.com/en-US/kb/Search+bar
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    About Google toolbar............
    Google decided that they will no longer produce the Google Toolbar for Firefox 5 and newer version. It is best to move on to other alternatives than to try any "hacks" to the toolbar that may or may not perform in the future. Future versions of Google toolbar will only work with IE7-9. Google Toolbar is not available on any other browser, even Google's own browser.
    *http://googletoolbarhelp.blogspot.com/2011/07/update-on-google-toolbar-for-firefox.html
    *https://support.mozilla.com/en-US/kb/google-toolbar-not-compatible-firefox?s=google+toolbar&r=0&as=s
    *http://www.google.com/support/toolbar/bin/answer.py?answer=1342452&topic=15356%29
    *Google Toolbar 8 FAQ (IE only): https://www.google.com/support/toolbar/bin/answer.py?hl=en&answer=1111588
    '''''To access your Google Bookmarks visit''''' www.google.com/bookmarks.
    Alternatives:
    *http://kb.mozillazine.org/Using_Google_Toolbar_features_without_toolbars
    *https://addons.mozilla.org/en-US/firefox/addon/googlebar-lite/
    *https://addons.mozilla.org/en-US/firefox/addon/gbookmarks-google-bookmarks-fo/

  • How to make wild card search for a file using utl_file

    Hi Everyone,
    I want to write to a table from flat file.im using 9i release 2. can i perform filename* (wildcard) search n write to the matching files.
    Regards
    Manish

    Sorry can i write from those files which matches the search criteria i mean the wildcard search
    for e.g COVhj*

  • How to search for multiple values with Bex Prompts

    Hi,
    I would like to know  if it is possible to search for multiple values at the same time with Bex Prompts instead of searching one value at a time (please see the screen shot below). I searched the forum couldn't find any relevant answers. please let me know  how  to achieve?
    Thanks,
    Charvi.

    Hi Charvi,
    You can use wild card search to ensure you get multiple similar values listed as search output.use * for multiple characters and ? for single character.
    For Example, Ravi * would result you all employees with first name as Ravi
    You can use various search formats such as * Ravi * and * Ravi and Ra?? etc.
    Thanks
    Mallik

  • Display comma for numeric values

    Hi,
    I want to display comma for numeric values.I know we can use strlen and concatenate, but any one can give me an example.
    Ex: 1,234  and 12,234 , 1,22,500  ( iam expecting)
    Thanks,
    Veeru

    it depends on ur data...
    if it is currency then u can use
    WRITE.... CURRENCY...
    if it is qty then u can use
    WRITE....UNIT....
    or u simply pass it to a packed field and it will take the default decimal settings of the user profile...
    Reward points if helpful

  • How to search for a value in an iterator in Jdev 10.1.2?

    Hi!
    I need to search an iterator named "PermitYrIterator1" for a year value (e.g. 2009) that is stored in bindings.Yr in my jsp. How do I do this in my jsp's DataForwardAction Code) in Jdev 10.1.2?
    I need this in my "Create page." I need to search for this value because I want to check if I should re-execute the "PermitYrIterator1" so that it shows the newly added year in bindings.Yr or not. If bindings.Yr is found in the iterator then I do not need to re-execute the iterator. But if the newly entered year cannot be found then I need to re-execute the iterator.
    I hope you can help me immediately! Thanks!

    Hi,
    Anyone can help me on this please?

  • How do I search for a value in an Excel sheet using ActixeX

    I am already accessing my excel sheets however I need to be able to search the sheet for a certain value and return the row/cell location. Is there an activeX control that can do this?

    You will need a reference to the range to search. This can be the entire sheet if you wish. Just wire that to the method node Find. Here you can specify all of the typical search options. Wire your string or number into the What input. For the what to LOOKAT value, use -4163 for Value and -4123 for formulas.
    The reference returned is the range of the found value. You can wire it into the property node Row and Column to get the location.
    Michael Munroe
    www.abcdef.biz
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

  • Searching for a substring using Regular Expression

    I have a lengthy String similar to repetetion of the one below
    String str="<option value='116813070'>Something1</option><option value='ABCDEF' selected>Something 2</option>"I need to search for the Sub string "<option value='ABCDEF' selected>" (need to get the starting index of sub string) and but the value ABCDEF can be anything numberic with varying length.
    Is there any way i can do it using regular expressions(I have no other options than regular expression)?
    thanks in advance.

    If you go through the tutorial then you will find this on the second page:
    import java.io.Console;
    import java.util.regex.Pattern;
    import java.util.regex.Matcher;
    public class RegexTestHarness {
        public static void main(String[] args){
            Console console = System.console();
            if (console == null) {
                System.err.println("No console.");
                System.exit(1);
            while (true) {
                Pattern pattern =
                Pattern.compile(console.readLine("%nEnter your regex: "));
                Matcher matcher =
                pattern.matcher(console.readLine("Enter input string to search: "));
                boolean found = false;
                while (matcher.find()) {
                    console.format("I found the text \"%s\" starting at " +
                       "index %d and ending at index %d.%n",
                        matcher.group(), matcher.start(), matcher.end());
                    found = true;
                if(!found){
                    console.format("No match found.%n");
    }It's does everything you need and a bit more. Adapt it to your needs then write a regular expression. Then if you have problems by all means come back and post them up here, but first at least attempt to solve it yourself.

  • Search for specific values (no *) in RSUSR070

    I want to find all activity groups that contain a specific entry for authorization object P_ORGIN, Personnel Area field.  I want to search for FL02 for example, but if I type FL02 in the selection field, I will also get any activity group that contains * as the value for Personnel Area.  I tried putting FL02 in single quotes but that did not work either.
    Any ideas?
    Thanks,
    Cindy

    Alex69 wrote:
    Thanks for the answer…
    I thought maybe I'm doing something wrong or this is because i excluded the Time Machine volume from spotlight, but ok, not my fault, but an apple "feature"
    I could search for specific E-mails using a finder search and then switch into Time Machine, but since Mail is called a Time-Machine-Aware Application I felt there should be a direct way to do this in Mail…
    Yes, there "should be a direct way to do this."
    The approach you describe above will work for email that still currently resides on your Mac, for example an email that has been "Replied" back and forth and you wish to retrieve an earlier version of the conversation. Or perhaps a "Draft" email that has undergone changes over time, of which you need to retrieve an earlier version. In these cases using Time Machine is relatively straight forward.
    My problem with Mail/Time Machine is with a specific email that has since been deleted. Unless you know exactly what mailbox that email had been in, and at what time the email had existed, then it can be like searching for a needle in a haystack. In this case the Time Machine interface needs to have a search box added to the "time travel" windows for faster retrieval of specific items, the location of which the user doesn't remember.
    I'm convinced, though, that the usability of Time Machine in such instances will improve over time. Particularly as more app become integrated with it.
    Glenn

  • Wildcard search for field PLKO-PSPNR

    Hello Experts,
    I am using field PSPNR from table PLKO in my selection selection screen. So when i search with F4 buton ,it works , but when i use wildcard  search i.e  B1   , it doesnt work. The reason for this is PSPNR field uses conversion routines within .
    But then my user wants this wildcard search in the report. Is this possible ? Please advice.
    Thanks and Regards,
    Swapnil

    Hi Swapnil,
    <li>Define select-options for PLKO-PSPNR like below.
    TABLES:PLKO.
    SELECT-OPTIONS: s_pspnr for plko-pspnr NO INTERVALS no-EXTENSION.
    <li>The above select-options looks like parameter and then now pass this s_pspnr in the WHERE condition like below
    SELECT * FROM PLKO INTO TABLE it_plko WHERE pspnr IN s_pspnr. "Like that ..
    Thanks
    Venkat.O

  • How do I search for a value in a db?

    I have a mysql-db which is connected to a java-program.
    It is an applet with a JTextField and a JButton.
    When I write something in the JTextField and presses the JButton I want to search for the word in my database and return some other values.
    This works properly if I write the exact String.
    How shall I do if I want to be able to only write the beginning of the word and retrieve all values that begins with these letters?
    Instead of writing "ABC123" I would be able to write "ABC" and retrieve all values that begins with ABC.
    Any suggestions?

    Yep,
    String sql ="select * from tablename where VALUE like '"+textfield.getText()+"%'";That should do.
    HTH

  • How to search for a value within a tolerance in an array?

    I am trying to search in an array for a value of say 10 plus or minus 2. In other words, I want a value of true if there is any value in the array between 8 and 12.

    canadian;
    LabVIEW includes with a VI called In Range and Coerce. You can test the value using that VI.
    I also created a VI for exactly that. You can download it from here:
    http://www.jyestudio.com/lview.shtml
    It is called Search 1D array using conditions. Let me know if it is useful. Even more efficient, you can look at the code of that VI and then extract the functionality you want for your application.
    Regards;
    Enrique
    www.vartortech.com

  • Unable to search for first record using the Preview tree

    Post Author: TheBig1980s
    CA Forum: General
    Hello:
    Users are unable to search for the first record in the Preview tab's tree.  The reason for this is because the first record is within the first page header of the report.  My guess is that, by design, Crystal takes the end user to whatever the first instance of the record iseven if that first record is in a page header.  That's not "good".  I want the user to be taken to the first record within the details of the reportnot within the page header.
    I have suppressed the page header to not print on the first record by using OnFirstRecord.  But, I still get the same issue where end users cannot select the first record in the tree without being taken to the page header.  Very strange.
    Can anybody think of any other ideas?
    Thanks!
    TheBig1980s

    Thank you Dave Merchant and try67 for your responses. As per my previous post, I contacted the company re the catalogue and they have responded favourably. I'll include their response because it gives the reason for the search failure as document compression which you might find interesting. I'll await their new catalogue and see if they have fixed the problem.
    Company response:
    Thank you very much for your input.  And yes, you are correct, the compression we used for the current catalogue's PDF format does strip out text included in the catalogue.  We used the compression settings we did with the intention of minimising download time, however I take your point about including text for search purposes (which I also utilise when I'm scanning through PDFs).
    We will actually be posting out our new catalogue next week and we'll release the new PDF version on the website at the same time.  I've asked our graphic designer to ensure that the PDF we use for the new catalogue includes searchable text.

  • Mainframe data loaded into Oracle tables - Test for low values using PL/SQL

    Mainframe legacy data has been copied straight from the legacy tables into mirrored tables in Oracle. Some columns from the mainframe data had 'low values' in them. These columns were defined on the Oracle tables as varchar2 types. In looking at the data, some of these columns appear to have data that looks like little square boxes, not sure but maybe that is the way Oracle interprets the 'low values' in the original data into varchar. When I run a select to find all rows where this column is not null, it selects these columns. In the results of the select statement, the columns appear to be blank, however, in looking at the data in the column using SQL Developer, I can see the odd 'square boxes'. My guess is that the select statement is detecting that something exists in this column. Long story short, some how I am going to have to test this legacy data on the Oracle table using Pl/Sql to test for 'low values'. Does anyone have any suggestions on how I could do this????? Help! The mainframe data we are loading into these tables is loaded with columns with low values.
    I am using Oracle 11i.
    Thanks
    Edited by: ncsthbell on Nov 2, 2009 8:38 AM

    ncsthbell wrote:
    Mainframe legacy data has been copied straight from the legacy tables into mirrored tables in Oracle. Not a wise thing to do. Mainframe operating systems typically use EBCDIC and Unix and Windows servers use ASCII. The endian is also different (big endian vs little endian).
    Does anyone have any suggestions on how I could do this????? As suggested, use the SQL function called DUMP() to see the actual contents (in hex) of these columns.

Maybe you are looking for