Selecting only normal character data from column

Hi,
We have a table column which stores party names and this could consist of non english characters. Would anyone know how do we just select regular english character rows from the table using a select query and not include the rows which have non-english characters?
Thanks

There iare two points with the suggestion by Frank.
First i think he missed an +
and secondly it doesnt work for example with german umlauts.
with data as (
select 'SERPI!! GAB' s from dual union all
select 'SE£ GRA' from dual union all
select 'ARA%%& sa' from dual union all
select 'dasssädsa' from dual union all
select 'ara€ ssa' from dual union all
select 'gabriele dsa' from dual
SELECT     *
FROM     data
WHERE     REGEXP_LIKE ( s
              , '^[A-Za-z]+$'
no rwos selected
with data as (
select 'SERPI!! GAB' s from dual union all
select 'SE£ GRA' from dual union all
select 'ARA%%& sa' from dual union all
select 'dasssadsa' from dual union all
select 'ara€ ssa' from dual union all
select 'gabriele dsa' from dual
SELECT     *
FROM     data
WHERE     REGEXP_LIKE ( s
              , '^[A-Za-z]+$'
S
dasssadsa
(without umlaut)
so perhaps you will give translate a try e.g.
with data as (
select 'SERPI!! GAB' s from dual union all
select 'SE£ GRA' from dual union all
select 'ARA%%& sa' from dual union all
select '@dass äsadsa' from dual union all
select 'ara€ ssa' from dual union all
select 'gabriele dsa' from dual
select s
,  translate(
    lower(s)
    ,'@abcdefghijklmnopqrstuvwxyz1234567890 '
  ) t
from data
where
length(
  translate(
    lower(s)
    ,'@abcdefghijklmnopqrstuvwxyz1234567890 '
< length(s)
S T
SERPI!! GAB !!
SE£ GRA £
ARA%%& sa %%&
@dass äsadsa @ä
ara€ ssa € porjection is just for explanation purpose
regards

Similar Messages

  • How to move only subset of data from one database to another?

    Both source & destination are Oracle11g databases.
    The requirement details are as below,
    1) The database contains static as well as transactional data for telecom domain.
    2) We have to move region-wise data from one database to another.
    3) There are around 10 regions.
    4) The region wise data extraction from source db is based on around 40 to 50 tables. Rest of the tables contains
    static data & it will not change.
    5) The volume is around 1 million subscribers per region.
    6) The migration is required because
    a) The client is upgrading its base product which uses this database
    b) There is a change in structure of static tables
    c) Hardware upgrade
    d) The client want to start with single region on new database & rest of the regions will be operated from old
    database.
    7) Keep execution time to very minimum.
    I am thinking to have solution as below,
    1) Create destination database with upgraded db structure (as mentioned in 6b)
    2) Create database links to access source db in destination db.
    3) Write SQL queries to fetch data from all the respective tables for a specific region
    4) Write separate PL/SQL blocks for each table to fetch data from source db & insert into respective table in
    destination db
    a) Use FOR ALL & bulk collect to improve the performance
    b) Divide table data into multiple chunks & execute parallel batches (around 10) to insert the data
    5) Validate pre & post counts to verify the success of migration
    Is there any other better way?
    Regards,
    Sandeep

    How to move only subset of data from a partiular table by using transportable tablespace?
    E.g. SUB table using SMP_SUB tablespace contains subscriber data in source database.
    The indexes defined on SUB table are under SMP_IDX_SUB tablespace
    The subscribers data can be categorized by different regions, say region_id column. Then how to move data & indexes of SUB table from source db to destination db?
    any specific example would be helpful.

  • Select only first 10 chars from the field in a table while writlng a selec

    hi experts,
    In a table  one field contains a value of above 10 characters (ex 10 or 15 or 20 characters).But i want to select
    only first 10 characters from this field while writing a select statement.
    This logic should be included in select statement.
    please gime immediate solution.
    My question is understood.

    Hi,
    Try this one
    data : begin of itab occurs 0,
            maktx(10) type c,
    end of itab.
    " though the length of MAKTX is 40 you only get 10 chars
    select maktx from makt into table itab up to 10 rows.
    if sy-subrc is initial.
    endif.
    " Suppose the field name of table you want to select is MAKTX then declare
    " Your internal table in the above manner, it will automatically fit into it and will get 10 Chars only
    " Instead of burding the select query / DB interface use the above.
    Cheerz
    Ram

  • How to trim data from column

    Morning gurus
    I have two tables, with column matching data, BUT i need to trim the columns of one of the tables
    the data appears in xpq_log table as follows
    LOG_DATE                     LOG_PTR     LOG_HDR
    01/06/2011 00:00:00     0609pro     0609IN002C_06
    04/06/2011 00:00:00     0609pro     0609IN002C_06
    05/06/2011 00:00:00     0609pro     0609IN002C_06
    06/06/2011 00:00:00     0609pro     0609IN002C_06
    07/06/2011 00:00:00     0609pro     0609IN002C_06
    09/06/2011 00:00:00     0609pro     0609IN002C_06
    10/06/2011 00:00:00     0609pro     0609IN002C_06
    12/06/2011 00:00:00     0609pro     0609IN002C_06
    01/06/2012 00:00:00     0609pro     0609IN002C_06
    02/06/2012 00:00:00     0609pro     0609IN002C_06
    03/06/2012 00:00:00     0609pro     0609IN002C_06
    06/06/2012 00:00:00     0609pro     0609IN002C_06
    07/06/2012 00:00:00     0609pro     0609IN002C_06
    08/06/2012 00:00:00     0609pro     0609IN002C_06
    09/06/2012 00:00:00     0609pro     0609IN002C_06In printpdf table as follows
    PDF_REPORT     PDF_DESCRIPTION
    IN002C                     STOCK FILE PURGE - PRINT WH CONTROLHow can i trim data from column(log_hdr) to match column(pdf_report)?
    Any help will be much appreciated

    Alberto,
    Even we can use regexp_substr to something fix string( Known part of a string).
    Like:-
    SQL> ed
    Wrote file afiedt.buf
      1  WITH xpq_log AS
      2  (
      3     SELECT '0609IN002C_06' log_hdr FROM DUAL
      4  )
      5* SELECT REGEXP_SUBSTR(log_hdr,'[[:alnum:]]+[C$]',1,1) PDF_REPORT FROM xpq_log
    SQL> /
    PDF_RE
    IN002C
    Thanks!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Selecting a range of data from a file

    Is it possible to only display a selected range of data from a binary file? I can read in my binary files but I would like to only send data within a user defineable range to the data portal for viewing. This range may be over multiple binary files also. I can concatenate these files already but I need to select a range to insert into the data portal.
    Thanks,
    AJL

    OK AJL,
    This sounds good. It's convenient to have the start and stop time of each segment file in the name of that file. By the way, you want to check that in the DataPlugin and "Call RaiseError()" if the data file is not named that way, otherwise you will try to read DIAdem *.DAT files with your custom DataPlugin. DIAdem will try each DataPlugin that is registered with the file's extension (i.e. *.DAT) one after the other, until one of them does not give an error. So you should always check for some identifying characteristic in your data file and "Call RaiseError()" if you don't find it, in order to abort DIAdem using that DataPlugin for files it was never intended for.
    Now to your point. How do you know which series of segment files to read from? Does your VBScript ask the user to select a particular directory that contains all these segment files? I'm going to assume so. My recommendation is that your VBScript also create a time slice configuration file in that directory that contains the information about the time slice you want to read in (start and stop times). Then your DataPlugin can look for that file name in the directory passed to it-- if it finds none it will just load the file path it was passed outright, but if it does find the time slice file it will load any and all *.DAT files in that same directory which correspond to that time slice. This includes loading only parts of one or more of the existing binary files.
    It is straightforward enough to pick out the section of the binary file you want to load with the DataPlugin, once you know the time slice information inside the DataPlugin's callback. Use the File.Position property to move the file cursor to the position of the first data point in the time slice, and use the Block.BlockLength property to specify the number of values to read in each of the channels from that starting point (to exclude the values after the desired time slice). I assume that your binary data is stored interleaved and that you are using DirectAccessChannels to read the values in your DataPlugin.
    Finally, for time slices that span multiple segment files, you will need to load these to separate groups in the Data Portal with the DataPlugin. Then the VBScript can consolidate these channels into long concatenated channels in a new group and delete the temporary segmented groups. In a future version of DIAdem the DataPlugin API will have the ability to do this mapping for you, but not yet. I also have VBScripts that do this concatenation already-- you can download them from www.ni.com/support/diasupp. They're designed for concatenating channels from multiple ASCII/Excel/DAT files.
    Let me know what else you need,
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Input predetermined date from column in Numbers

    Hi!
    I'm trying to calculate my worked hours by inputing Time in in cell C and Time out in cell D, and having Numbers calculate the numbers of worked hours in cell E, by using =Cell D - Cell C and it is working fine.
    My problem is that Numbers automatically choses the current date and inputs it into all cells that are formated to show time only, Cell C and Cell D.
    In Column B, I've typed in the correct date, eg. 16 augusti 2012.
    My question is:
    How to I get Numbers to choose the date from Cell B instead of todays date?
    I've tried to input a formula =Date(cellB) which is working, but it stops me from inputing a time.
    For example, in Cell B, I've typed in 16 augusti 2012 and in Cell C I've typed in =Date(cellB)+time(09:00:00) but get a syntax error.
    To complicate matters, I'm using Numbers in Sweden, with the language set to Swedish... I don't know if that changes how to input a formula.
    BR,
    Jemma

    Jemsann wrote:
    Most of my time in and out occurrs on the same day, but not always, so hopefully I'll be able to find a formula that works for both instances.
    Your formula seems to bypass the date issue althogeter. Does that mean that Numbers have no (rather simple) way of getting a date from another cell?
    If I use the formula used in E2 and E3, then I might as well have the current date as my hidden datevalue, or does it function in an another manner?
    Hi Jemma,
    Use Badunit's version fo the formula if you have shifts that cross the midnight boundary. That version will work for for shifts of up to 23 hours and 59 minutes (and 59 seconds). For any shift less than 24 hours in length, the shift will have started and ended on the same calendar day if the starting time (of day) or TIMEVALUE is smaller than the finish time (of day) or TIMEVALUE, and will have started on the previous calendar day if the start TOD or TIMEVALUE is greater than the finish TOD or TIMEVALUE.
    If you need to retrieve the Date from one cell (B6 in the formula below) and combine it with the Time part of the Date and Time value in a second cell (C2 in the example), try:
    =TIMEVALUE(C2)+DATEVALUE(B6)
    The Function Browser says DATEVALUE converts a date presented as a text string to a Date and Time value, but it seems to also read the date part of a full Date and Time value and convert this to a Date and Time value with the Time set to 00:00:00 (as it would be if you entered only the date part).
    Regards,
    Barry

  • Select query to read data from a view

    Hi friends,
    We have been using a query to read data from a custom view which used to work perfectly. Now the program sits at that select query forever. We are able to extract same data from se16. Not sure what could be the problem.
    Thanks in advance.

    Dev
    Have a look at the Table Index for the tables involved in the View... I think there is some change in the Indexes.. (Add / Remove / Change)
    Thanks
    Amol Lohade

  • How do i select last 5 minutes data from table

    there is table called 'x' which has cron job set of interval=5 min,i want to select last 5 min data and delete rest of the data in it or save in one of the table say 'y'.how do i going to do it???kindly help out please??
    Edited by: user10341747 on Sep 24, 2008 10:20 AM

    this is just explanation of other members reply
    insert into Y
    select * from X where timestamp_variable between systimestamp - 5/(24*60) and systimestamp
    this select gives last 5 min data out of that table x .
    members can correct me if iam wrong.
    Thank you.

  • How to fill a table with data from columns & rows from a txt file

    I am trying to fill say:
    Myname     Myclass     Mycollege
    Mohan     MD     Stanford
    from a txt file into 3 columns of a table. I can easily do it into a textarea component by
    clicking a button:
    try{
    FileReader fr = new FileReader("F:/CreatorProjects1/stan.txt");
    BufferedReader br = new BufferedReader(fr);
    String s1="";
    String s="";
    stantxtarea.setValue(s);
    while((s=br.readLine())!=null) {
    s1 = s1+s;
    s1=s1+"\n";
    stantxtarea.setValue(s1);
    br.close();
    fr.close();
    } catch(Exception e) {
    e.printStackTrace();
    return null;
    All table components seem to need a database. I do not use any database. I run exe files that give output to txt files. How to solve it?
    I appreciate any help in this regard...
    dr.mohan rao

    there may be another way. This is some thing some thing I can recommend. You can create property type of ObjectListDataProvider in session or application based on the scope you required. Create web bean class with property you want to show in the column (say col1, col2, col2). Initialize the list property like similar below
    List dataList = new ArrayList();
    ObjectListDataProvider mytableprops = new ObjectListDataProvider();
    try {
    //start loop read data from your txt file
    //create instance of web bean for each line
    //add web bean instance into dataList
    //end of loop readind data from txt file
    oldpins.setList(dataList );
    oldpins.setObjectType(NotificationProfileBean.class);
    } catch (Exception ee1){;}
    return oldpins;
    Sri Thuraisamy

  • How to Group Data from column?

    Hi All,
    Can any one solve my problem please?
    I have Two Column "Age" and "Employee ID".
    I want to Group "Number of Employees" for specific AGE range Like:
    Age | Number of Employees
    20 to 30 | 06
    31 to 40 | 13
    41 to 50 | 16
    51 to 60 | 03
    And data in Columns are fallowing
    Age | Employees ID
    30 | 002
    38 | 008
    33 | 298
    22 | 213
    54 | 083
    24 | 098
    So on.
    Waiting for your HELP.
    In advance Thank you very much...
    Take care

    Here you go..
    Drag any column in Answers and name it as Age and in its fx write
    case
    when tablename.age between 20 and 30 then '20 to 30'
    when tablename.age between 31 and 40 then '31 to 40'
    when tablename.age between 41 and 50 then '41 to 50'
    when tablename.age between 51 and 60 then '51 to 60'
    end
    Drag any column in Answers and name it as "Number of Employees" and in its fx write
    Count(tablename.EmployeeID)
    This would give you the desired Report
    Hope its helpful...
    Thanks
    Ashish Gupta

  • Query to select value for max date from a varchar field containing year and month

    I'm having trouble selecting a value from a table that contain a varchar column in YYYY-MM format. 
    ex.
    Emp_id Date Cost
    10264 2013-01 5.00
    33644 2013-12 84.00
    10264 2013-02 12.00
    33644 2012-01 680.0
    59842 2014-05 57.00
    In the sample data above, I would like to be able to select the for each Emp_id by the max date. Ex. For Emp_id 10264, the cost should be 12.00.

    create table test (Emp_id int, Date varchar(10), Cost decimal (6,2))
    insert into test values(
    10264, '2013-01', 5.00 ),
    (33644, '2013-12', 84.00 ),
    (10264, '2013-02', 12.00 ),
    (33644, '2012-01', 680.0 ),
    (59842, '2014-05', 57.00 )
    Select Emp_id,[Date],Cost FROM (
    select *,row_number() Over(Partition by Emp_id Order by Cast([Date]+'-1' as Datetime) Desc) rn
    from test)
    t
    WHERE rn=1
    drop table test

  • Getting only 3 byte data from Bodypart -  mail.jar 1.4

    I am using jdk 1.4
    my code is like
    BodyPart part = multipart.getBodyPart(index);
    with mail.jar 1.4 when i tried to retive the content from part its returning only 3 byte
    but when i have used mailapi.jar 1.3 its returning correct data may i know what is problem with mail.jar 1.4 .

    The issue is that you are mapping "Data Value" to amount in the Target Application import format:
    SELECT SCENARIO "Scenario" 
      ,YEAR "Year"
      ,PERIOD "Period"
      ,DATAVIEW "View"
      ,DATAVALUE "Value"
      ,ACCOUNT "Account"
      ,ENTITY "Entity"
      ,ICP "ICP"
        ,UD2 "Area"
        ,UD1 "Tail"
        ,UD3 "Special"
        ,UD4 "Facility"
      ,AMOUNT "DataValue"
      FROM AIF_HS_BALANCES
      WHERE LOADID = 300
    You need to map AMOUNT to "AMOUNT" in the HFM Application.  Check that the dimension mapping is correct for the class in the target application and that your import format is going to the proper target dimension(Amount).    

  • Using xsgl:insert-request to insert non-English character data from HTML form

    I tried to insert a text written in French and pasted into an HTML form into my database following the recipe from the XSQL release notes.
    The table:
    create table content_object (
    id number(9) constraint pk_content_object primary key,
    author number(9),
    title varchar2(256),
    abstract varchar2(1024),
    object_type_id number(9),
    content_meat clob,
    XML file the form is posted to:
    <?xml version="1.0"?>
    <xsql:insert-request connection="demo"
    xmlns:xsql="urn:oracle-xsql"
    table="content_object"
    transform="article_form_to_content_object.xsl"/>
    article_form_to_content_object.xsl:
    <?xml version = '1.0'?>
    <ROWSET xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0">
    <xsl:for-each select="request/parameters">
    <ROW>
    <TITLE><xsl:value-of select="title_field"/></TITLE>
    <ABSTRACT><xsl:value-of select="abstract_field"/></ABSTRACT>
    <CONTENT_MEAT><xsl:value-of select="content_field"/></CONTENT_MEAT>
    </ROW>
    </xsl:for-each>
    </ROWSET>
    The result was:
    <ROW num="2">
    <ID>6</ID>
    <TITLE>Le go</TITLE>
    <ABSTRACT>Vin bouchonn</ABSTRACT>
    <CONTENT_MEAT>Des conditions de conservation au tant d</CONTENT_MEAT>
    </ROW>
    All strings were cropped at the point where the first accented character appeared.
    Any idea why this is happening? With English texts it works just fine.
    Maciej

    Another user hit this problem this week. I debugged it and posted the reply in the discussion thread:
    http://technet.oracle.com:89/ubb/Forum11/HTML/002799.html
    It's a JDK bug in character set conversion that has a simple workaround, just indicate the ISO-8859-1 encoding on your XSQL page. See the end of this other thread for details.

  • Selecting recent doc by date from ekko

    I have Vendor (EKKO-LIFNR) & Company code (EKKO-BUKRS)
    I want to select EKKO-EBELN checking that Validity start date (EKKO-KDATB) & Validity end date (EKKO-KDATE) are valid i.e. today date is within the above date range.
    Also if there is more than one doc for this combination for Vendor & Company code then we I need to select the doc which is the most recent one. (EKKO-AEDAT is the most recent).
    Any one please help me how to fetch the recent doc
    I have tried  with MAX( aedat ) but its not working.
    If possible please provide the select statement.
    Thanks ain Advance
    Dhananjay.

    Hi,
      Try the below logic:
    Select ebeln into l_f_ebeln
    FROM EKKO
    UP TO 1 ROWS
    where lifnr =  l_f_vendor
         and bukrs =  l_f_bukrs
         and kdatb <= sy-datum
         and kdate >= sy-datum
    ORDER BY aedat descending.
    endselect.
    This will give you right result.
    Edited by: Ramesh Hirial on Dec 18, 2007 2:02 PM

  • How to read and select only a specific lines from a CSV file. Pls help

    I have a java application to read a CSV file. I've already managed to read them all and output it to System.out.println(). Now the problem is I want to select a specific row of the records. How do I do it? Below is the codes i've typed.
    FileReader fr = new FileReader(fileName);
    BufferedReader inFile = new BufferedReader(fr);
    StringBuffer buf = new StringBuffer();
    String line = null;
    while ((line = inFile.readLine()) != null) {
    buf.append(line);
    buf.append("\n");
    String inString = buf.toString();
    System.out.println(inString);
    This is the record that i want to read. For example, I want to select n print out line "80,2.90,3.00,3.10,3.20,......."
    [Factor1]
    Time [s],0.00,0.10,0.20,0.30,0.40,0.50,0.60,0.70,0.80,0.90,1.00,1.10,1.20,1.30,1.40,1.50,1.60,1.70,1.80,1.90,2.00,2.10,2.20,2.30,2.40,2.50,2.60,2.70,2.80,2.90,3.00,3.10,3.20,3.30,3.40,3.50,3.60,3.70,3.80,3.90,4.00,4.10,4.20,4.30,4.40,4.50,4.60,4.70,4.80,4.90,5.00,5.10,5.20,5.30,5.40,5.50,5.60,5.70,5.80,5.90,6.00,6.10,6.20,6.30,6.40,6.50,6.60,6.70,6.80,6.90,7.00,7.10,7.20,7.30
    Phi-0 [dB],-0.86,-0.80,-0.80,-0.99,-0.56,-0.53,-0.95

    If you know how many bytes each line is, you can use RandomAccessFile to skip directly to the byte position corresponding to your desired line. Otherwise, you'll have to read each line and just ignore the ones you don't want.

Maybe you are looking for

  • App to convert Voicemail to text?

    Can anyone recommend a good app (preferably cheap or free!) which will convert spoken voicemails into text format? I am on an iphone 5. I am hard of hearing and struggle to pick out words in a quickly spoken message. Thanks

  • How do I move a folder from one user to another

    I copied folders and files from a PC to my new Mac Pro (running Yosemite).  I am now trying to figure out how to move some some of the folders transferred in from my old PC from one user to another on the Mac.  I am a first time user of a Mac desktop

  • No Audio on Saved File

    First and Formost, I know nothing of computer jargon.  My operating system is Windows Vista and I'm using Premiere Elements 4.0.  I'm making a fan video with lots of video clips choreographed around a song.  I have to save the file to my computer bef

  • [SOLVED] Pacman issue after -Syu

    Hello guys, This morning I did a full update with "pacman -Syu", before that, I also did an installation for gnome and gnome-extra as well as openoffice. There were some connection loss during the update and perhaps some packages failed to be retriev

  • How do I stop firefox as my main brower

    I don't want Firefox as my main browser how do I change back to IE I have checked and not able to change please help thank you