Trimming double byte space in Oracle

Dear All,
DB Version: Oracle 10g
Client : Oracle SQL Developer
How can we TRIM double byte space in Oracle without first converting it into single byte and then using TRIM function.
Sample data is :
トヨタカロ-ラナンカイ (カ 
I want to TRIM trailing double byte space.
Regards,
Vikas Kumar

untested, because of missing examples
TRIM(TRAILING doubleByteCharacter FROM sampleData)ok there is an example now, so this will work
select trim(trailing ' ' from '有限会社 ヴオーグ      ') from dual;
"     P>
{code}
Edited by: Sven W. on Aug 27, 2010 5:30 PM
Edited by: Sven W. on Aug 27, 2010 5:31 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Implementation of double byte character in oracle 10.2.0.5 database

    Hi experts,
    There is an oracle 10.2.0.5 standard edition database running on windows 2003 platform. The application team needs to add a column of the datatype double byte (chinese characters) to an existing table. The database character set is set to WE8ISO8859P1 and the national characterset is AL16UTF16. After going through the Oracle Documentation our DBA team found out that its possible to insert chinese characters into the table with the current character set.
    The client side has the following details:
    APIs used to write data--SQL Developer
    APIs used to read data--SQL Developer
    Client OS--Windows 2003
    The value of NLS_LANG environment variable in client environment is American and the database character set is WE8ISO8859P1 and National Character set is AL16UTF16.
    We have got a problem from the development team saying that they are not able to insert chinese characters into the table of nchar or nvchar column type. The chinese characters that are being inserted into the table are getting interpreted as *?*...
    What could be the workaround for this ??
    Thanks in advance...

    For SQL Developer, see my advices in Re: Oracle 10g - Chinese Charecter issue and Re: insert unicode data into nvarchar2 column in a non-unicode DB
    -- Sergiusz

  • Right Truncation, varchar in SQL Server, double-byte in Oracle

    Hi.
    We have a DB Link using DG4MSQL from Oracle 11.1.0.7.0 to a SQL Server 2005 database. The Oracle database is set up to use UTF-8 so all character fields are double-byte on the oracle side.
    On the SQL Server table we have a column defined as varchar(32). When doing a select * from this table (from Oracle, over the DB link), everything works fine if that column contains values with a length of 16 characters or less. When the column contains 17 - 32 characters we get the following error:
    Error report:
    SQL Error: ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Oracle][ODBC SQL Server Driver]String data, right truncation {01004}
    ORA-02063: preceding 2 lines from SQLUAT
    28500. 00000 - "connection from ORACLE to a non-Oracle system returned this message:"
    *Cause:    The cause is explained in the forwarded message.
    *Action:   See the non-Oracle system's documentation of the forwarded
    message.
    It looks like Oracle (or the ODBC driver) is bringing the data back as double-byte even though it is declared as varchar. If we change the column on the SQL server side to nvarchar, everything works fine.
    Is this a bug? Or is there a setting that can be specified for the gateway so that it recognizes SQL Server varchar columns as single-byte, to prevent them from coming over as double-byte and messing up the ODBC driver? Or is there anything else we should do to prevent this problem?
    Thanks

    Hi,
    I don't think it's a problem with the hs or the dblink (but I may be wrong):
    UTF-8 is double-bytes as you said. when you declare varchar2(32) it actually means you can insert up to 32 bytes --> 16 characters.
    even if you do a simple insert to the table with more than 16 characters - it will fail.
    In order to overcome this you should declare the table with varchar2(32 char) which will tell Oracle to allocate enough bytes to hold 32 chars - not bytes. In UTF-8 this means 64 bytes (2*n). If you'd be using AL32UTF-8 this would mean 4*n.
    BTW- why are you using UTF-8 and not AL32UTF8?
    Hope this helps.

  • Does Oracle XML Parser support double byte charset?

    Hi,
    Does Oracle XML Parser support double byte characters such as Korean or Chinese? If so, please tell me what version and how to construct xml/xsl files (...encoding="???")?
    Thanks for any help,
    Tuan

    Hi Raymond,
    Thank you for your help. It worked when I running in JDeveloper with your posted code. However, when I tried in my real application, it won't work.
    The problem is for localization purposes, my application using some texts display in browsers are saved in Unicode file. Later, application runs and depends on languages setting in browsers, with JavaServlet retrieves those texts and saves in formated xml StringBuffer. Then, using existed XSL Stylesheet file and OracleXMLParser to generate an output HTML.
    It has worked fine with English, France or others (single byte characters), but it can't
    for double bytes character such as Korean or Chinese. I also tried different charset in xml file.
    The following is one of returning errors:
    -- oracle.xml.parser.v2.XSLException: XSL-1004: Error while parsing input XML document (<Line 1, Column 552>: XML-0221: (Fatal Error) Invalid char in text.)
    I run this app in win2000/IIS with ServletExec3.0, JDK1.2.2 and OracleXMLParser v2.0.2.10
    Thank you for any helps,
    Tuan
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Raymond Hayes Jr ([email protected]):
    Nothing fancy 'cause I'm half asleep but I used your xml/xsl and it seemed to work. No errors anyway. This is what I put together in JDeveloper 3.2
    package demo;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import oracle.xml.parser.v2.*;
    public class CuriosityKilledTheCat extends HttpServlet {
    * Initialize global variables
    public void init(ServletConfig config) throws ServletException {
    super.init(config);
    * Service the request
    public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    try
    XSLStylesheet xsl = new XSLStylesheet( new URL ("file:///c:\\temp\\input.xsl") , null );
    XSLProcessor xp = new XSLProcessor();
    XMLDocument xd = new XMLDocument ();
    XMLDocumentFragment xf = new XMLDocumentFragment();
    xf = xp.processXSL ( xsl , new URL ( "file:///c:\\temp\\input.xml") , null );
    System.out.println ( "here" );
    xd.appendChild( xf );
    xd.print ( response.getOutputStream() );
    catch ( Exception e )
    System.out.println ( e.getMessage() );
    * Get Servlet information
    * @return java.lang.String
    public String getServletInfo() {
    return "demo.CuriosityKilledTheCat Information";
    }<HR></BLOCKQUOTE>
    null

  • Text strings from VISA read don't match identical looking text constants - could it be double byte characters"

    Our RS232-enabled instrument sends ASCII strings to COM 1 and I read strings in. For example I get the string "TPM", or at least it looks like "TPM" if I display it. However, if I send that to the selector input of a Case structure, and create a case for "TPM", whether the two appear to match varies. Sometimes it matches, and measuring its length returns 3. Sometimes it measures 7 or 11 or 12 characters long, and it doesn't match. I can reproduce a match or a mismatch by my choice of the command that went to the instrument prior to the command that causes the TPM response, but have made no sense of this clue. I have run it through Trim Whitespace, with Both Ends (the default) explicitly selected. I have also turned the string into a byte array, autoindexed a For loop on that, and only passed the bytes if they don't equal 32, or if they don't equal 0, thinking spaces or nulls might be in there, but no better.
    The Trim Whitespace function's Help remarks that it does not remove "double byte characters". But I can't find anything else about "double byte characters". Could this be the problem? Are there functions that can tell whether there are "double byte characters", or convert into or out of them? By "double byte characters", do they just mean Unicode?
    Solved!
    Go to Solution.

    Cebailey,
    The double byte characters are generally used for characters specific to languages other than English.  If you display your message in  " '\' Codes Display"  in a string indicator do you see any other characters?   You could also use Hex Display to see count the number of bytes in the message.  You are probably getting messages with non-printable characters that might need to be trimmed before using your application.  If you want more information the '\' Codes Display, there's a detailed description found in the LabVIEW Help.  You can also find the same information on our website in the LabVIEW Help.  Backslash ('\') Codes Display
    Caleb WNational Instruments

  • XSL Transform, double-byte characters and padding

    I have a stylesheet with the following variable that is being formatted to pad a parameter named textQualifierDescription to a length of 30 by calling the template called format-string.
    <xsl:variable name="textQualifierDescription2">
         <xsl:call-template name="format-string">
              <xsl:with-param name="myString" select="$textQualifierDescription"/>
              <xsl:with-param name="numbatchspaces">30</xsl:with-param>
         </xsl:call-template>
    </xsl:variable>
    <xsl:template name="format-string">
         <xsl:param name="myString" select="' ' "/>
         <xsl:param name="numbatchspaces" select="20"/>
         <xsl:param name="direction" select="right"/>
         <xsl:variable name="spacesstr" select="string('                                              ')"/>
         <xsl:variable name="padsize" select="$numbatchspaces -string-length($myString)"/>
         <xsl:variable name="spacepad" select="substring($spacesstr, 1, $padsize)"/>
         <xsl:choose>
              <xsl:when test="$direction = 'left'">
                   <xsl:value-of select="concat($spacepad,$myString)"/>
              </xsl:when>
              <xsl:otherwise>
                   <xsl:value-of select="concat($myString,$spacepad)"/>
              </xsl:otherwise>
         </xsl:choose>
    </xsl:template>I execute the xsl transform using the following statement in a stored procedure:
    transformedData := xmldata.transform(xsldata);The xsl transform works as expected until it encounters data that contains double-byte characters. My output is supposed to contain the following three fields as a single record
    textQualifierDescription - padded to a length 30
    lineNumber
    id
    If my textQualifierDescription contains a value of "Texto de posición"
    Line 1 - Texto de posición             00000001POS2005
    Line 2 - Texto de posición            00000001POS2005
    Line 1 is the expected result.
    Line 2 is the actual result. When the "format-string" function is called and even though "Texto de posición" is 17 characters in length, it looks as if oracle counts the double-byte character as 2 and calculates the string-length as 18 to come up with a padsize of 12. It then creates a spacepad of 12 spaces which is then concatenated to the 17 characters for a total length of 29. I have tested the stylesheet in xmlspy and it produces the expected result.
    Has anyone ever run into this sort of situation and is able to provide me with some sort of solution to this dilemma? This is running on 10g Release 10.2.0.4.0.

    Your searches should have also come up with the fact that CR XI R2 is not supported in .NET 2008. Only CR 2008 (12.x) and Crystal Reports Basic for Visual Studio 2008 (10.5) are supported in .NET 2008. I realize this is not good news given the release time line, but support or non support of cr xi r2 in .net 2008 is well documented - from [Supported Platforms|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7081b21c-911e-2b10-678e-fe062159b453
    ] to [KBases|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_dev/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do], to [Wiki|https://wiki.sdn.sap.com/wiki/display/BOBJ/WhichCrystalReportsassemblyversionsaresupportedinwhichversionsofVisualStudio+.NET].
    Best I can suggest is to try SP6:
    https://smpdl.sap-ag.de/~sapidp/012002523100015859952009E/crxir2win_sp6.exe
    MSM:
    https://smpdl.sap-ag.de/~sapidp/012002523100000634042010E/crxir2sp6_net_mm.zip
    MSI:
    https://smpdl.sap-ag.de/~sapidp/012002523100000633302010E/crxir2sp6_net_si.zip
    Failing that, you will have to move to a supported environment...
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Edited by: Ludek Uher on Jul 20, 2010 7:54 AM

  • Implementation of double-byte character support in the Database

    Hi experts,
    There is an oracle 10.2.0.5 standard edition database running on windows platform. The application team needs to add a column of the datatype double byte (chinese characters) to an existing table. By doing so, will we have to change the character set of the database ? Would implementing this cause any impact on the database ?
    Is it possible to change the existing single byte column to the double byte column in a table?
    Edited by: srp on Dec 18, 2010 2:21 PM

    I think you should post your request to Globalization Support forum Globalization Support with following details:
    what is the APIs used to write data ?
    what are the APIs used to read data ?
    what is the client OS ?
    what is the value of NLS_LANG environment variable in client environment
    Note that command line SQL*Plus under Windows does not display Unicode data: try to use instead SQL Developer.
    Example:
    1. run in SQL*Plus:
    SQL> desc t;
    Name                                      Null?    Type
    X                                                  NUMBER(38)
    Y                                                  NVARCHAR2(10)
    SQL> insert into t values(1, unistr('\8349'));
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t;
             X Y
             1 ■
    SQL> select dump(y, 1016)  from t;
    DUMP(Y,1016)
    Typ=1 Len=2 CharacterSet=AL16UTF16: 83,49Run in SQL Developer:
    select * from t
    X                      Y         
    1                      草       

  • How SMON coalesces free space in oracle 9i and 10g

    how SMON coalesces free space in oracle 9i and 10g?
    Is it doing same as it was behaving in oracle 7 like looking through free extent table every five minutes (sys.fet$) to see if there are any adjacent free extents that can be coalesced into a single extent, and on every 25th cycle (i.e. every two hours and five minutes) it looks at the segment table (sys.seg$) to see if there are any temporary segments that need to be eliminated, as explained by jonathan lewis?
    what are extent and segment tables available in oracle 9i and 10g like sys.fet$ and sys.seg$ in oracle7?

    >
    how SMON coalesces free space in oracle 9i and 10g?
    Is it doing same as it was behaving in oracle 7 like looking through free extent table every five minutes (sys.fet$) to see if there are any
    adjacent free extents that can be coalesced into a single extent, and on every 25th cycle (i.e. every two hours and five minutes) it looks
    at the segment table (sys.seg$) to see if there are any temporary segments that need to be eliminated, as explained by jonathan lewis?
    what are extent and segment tables available in oracle 9i and 10g like sys.fet$ and sys.seg$ in oracle7?I think you need to go and have a look at the Oracle 9i documentation here
    http://www.oracle.com/technology/documentation/oracle9i_arch_901.html
    and automatic segment management in 10g
    http://www.oracle.com/technology/pub/articles/10gdba/week15_10gdba.html
    HTH.
    Paul...
    Software - OS (+ version), Server,
    Hardware - CPU + Disk configuration.
    Please include all of the above information with database queries.
    This will help those who are trying to help you!
    Furthermore, please do not top-post and do try to trim your replies!

  • SJIS- Japan Encoding Issues(*Unable to handle Double Byte Numeric and Spec)

    Hi All,
    Problem:
    Unable to handle Double Byte Numeric and Special Characters(Hypen)
    The input
    区中央京勝乞田1944-2
    Output
    区中央京勝乞田1944?2
    We have a write service created based on the JCA (Write File Adapter) with the native schema defined with SJIS Encoding as below.
    *<?xml version="1.0" encoding="SJIS"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" xmlns:tns="http://nike.com/***/***********"
         targetNamespace="http://nike.com/***/*************"
         elementFormDefault="unqualified" attributeFormDefault="unqualified"
         nxsd:version="NXSD" nxsd:stream="chars" nxsd:encoding="SJIS">*
    Do anyone have similar issue? How can we handle the double byte characters while using SJIS encoding? At the least how can we handle double byte hyphen ??
    Thanks in Advance

    Have modified my schema as shown below and it worked well for me and i am partially successful up to some extent. Yet, not sure the workaround will resolve the issue at the final loading...
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd" xmlns:tns="http://nike.com/***/***********"
    targetNamespace="http://nike.com/***/*************"
    elementFormDefault="unqualified" attributeFormDefault="unqualified"
    nxsd:version="NXSD" nxsd:stream="chars" nxsd:encoding="UTF-16">*
    If anyone has the resolution or have these kind of issues let me know.........

  • Double-byte support in Captive 5

    I am currently creating multiple choice exams in Captivate 5 (CP5) and here is my problem.  When I paste in the translated text (localized into Chinese-Simplified) from either MS-Word, Excel or Notepad into the question and answer fields in the CP5 Question slide, CP5 is substituting some of the Chinese characters with boxes.  I paste the same information into Notepad on my windows 7 PC and everything is OK.
    Does CP5 fully or partially support Double-Byte text?  If it does, what could I be doing wrong or missing in the way of a service pack or hotfix?  My Captivate version is - 5.0.1.624.
    Thanks for your help.  Dean

    Assuming you are using the same double byte character set as your db character set, then the answer is yes. Check out this table in the 9i Database Globalization Support Guide, for more info.
    http://technet.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96529/ch2.htm#103678
    Schema objects refer to table/index/view names etc.

  • Double byte font problem

    I'm trying to track down a double byte font that's worked its way into a form. When I try and open the form in Reader I get an error message saying to download the Japanese font pack.
    In Acrobat the font shows up as KozGoPr6N-Medium Type 1 CID. I've hunted through the xml source with no luck and also taken a look at any special characters used. Being an XFA PDF I can't use my usual tools like Pitstop to track it down.
    I've seen this happen once before when trying to use some upper unicode characters but we aren't using any in this form from what I can see. Webdings and Wingdings 2 are being used for a few characters but I tried them on their own and they don't seem to be the problem. I've also tried unembedding fonts but no luck.
    Any ideas?

    Figured it out...had to print the form to a normal pdf so I could run a preflight on it.
    Form some reason Designer(?) encodes some upper unicode characters as Japanese? Or something. I ran into this a while back when trying to use a couple of up/down arrow characters in a form.
    Turns out the offending character was an N or M space. I replaced it with a Tab character and it's now fine.

  • Double byte characters in dataset

    Hi Gurus,
    I encounter an issue when writing data to dataset with fixed length.
    Company Code: US00
    Document Number: 1234567890
    Fiscal Year: 2014
    Line Item: 001 Short Text ( length 10 char): AF 16
    Line Item: 002 Short Text ( length 10 char): AF 16 
    Comment:X
    In Unix, it becomes like this:-
    US0012345678902014001AF16      X
    US0012345678902014001AF 16       X
    The X in second line item was not in correct fixed position and cause file being rejected by the receiver system.
    I have tried to calculate using the following syntax for AF 16  :
    1) strlen(bseg-sgtxt) = 7
    2) numofchar(bseg-sgtxt) = 6
    I would like to know if there is any idea to resolve the position of subsequent fields after "SGTXT" field if there is double byte characters found. I have tried to pad trailing space but it does not work.
    Expected result is where the X of two line items are located at same and fixed position:-
    US0012345678902014001AF16      X
    US0012345678902014001AF 16    X
    Thank you!

    /** returns true if the String s contains any "double-byte" characters */
    public boolean containsDoubleByte(String s) {
      for (int i=0; i<s.length(); i++) {
        if (isDoubleByte(s.charAt(i)) {
          return true;
      return false;
    /** returns true if the char c is a double-byte character */
    public boolean isJapanese(char c) {
      if (c >= '\u0100' && c<='\uffff') return true;
      return false;
    // simpler:  return c>'\u00ff';
    /** returns true if the String s contains any Japanese characters */
    public boolean containsJapanese(String s) {
      for (int i=0; i<s.length(); i++) {
        if (isJapanese(s.charAt(i)) {
          return true;
      return false;
    /** returns true if the char c is a Japanese character. */
    public boolean isJapanese(char c) {
      // katakana:
      if (c >= '\u30a0' && c<='\u30ff') return true;
      // hiragana
      if (c >= '\u3040' && c<='\u309f') return true;
      // CJK Unified Ideographs
      if (c >= '\u4e00' && c<='\u9fff') return true;
      // CJK symbols & punctuation
      if (c >= '\u3000' && c<='\u303f') return true;
      // KangXi (kanji)
      if (c >= '\u2f00' && c<='\u2fdf') return true;
      // KanBun
      if (c >= '\u3190' && c <='\u319f') return true;
      // CJK Unified Ideographs Extension A
      if (c >= '\u3400' && c <='\u4db5') return true;
      // CJK Compatibility Forms
      if (c >= '\ufe30' && c <='\ufe4f') return true;
      // CJK Compatibility
      if (c >= '\u3300' && c <='\u33ff') return true;
      // CJK Radicals Supplement
      if (c >= '\u2e80' && c <='\u2eff') return true;
      // other character..
      return false;
    /* NB CJK Unified Ideographs Extension B not supported with 16-bit unicode. Source: http://www.alanwood.net/unicode */
    }

  • Double-Byte Conversion

    Hi Everybody,
    I am Hemant Shukla working as Sr.Oracle Consultant in
    Singapore.I am facing a problem with oracle Double
    -Byte Conversion.My Software is in Oracle-9i and
    D2K-6i.My client requirement is to convert the whole
    software in Chinese language .At the same time he can
    look for english language also ....Then Malayisan then
    Thai...I tried my hand going into registry Editor
    Changing NLS_LANG into chinese with UTF-8.But can't
    get through it.Please give me solution.
    Thanks & Regards
    Hemant Shukla
    Frontier Technologies
    Singapore

    Hemant,
    &gt; But can't get through it.
    What's your problem exactly? Are you getting errors for something else? What's the value of NLS_LANG you tried?
    Regards,
    - Makoto

  • Support for Double Byte Chars in Table Names

    Can you please tell me if double byte characters are supported in table names? Thanks.

    Assuming you are using the same double byte character set as your db character set, then the answer is yes. Check out this table in the 9i Database Globalization Support Guide, for more info.
    http://technet.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96529/ch2.htm#103678
    Schema objects refer to table/index/view names etc.

  • How can Mapviewer display double-byte characters

    Hi,
    I am facing a problem using Mapviewer to display a map with a title containing double-byte characters e.g. chinese charaters. I think the problem takes place as map_Request producing the map image.
    My environment is :
    NT server 5.0(sp 3)
    Oracle 9.01
    J2EE
    IE 6.0

    are you using the mapclient.jsp demo file? there is a bug in that file that will lead to truncated map requests when the title is in chinese. it will be fixed in the next version of MapViewer (a beta version
    of which will be on OTN soon).
    Thanks,
    LJ

Maybe you are looking for

  • [Solved] [YAKA] Yet Another KDE 3.5.9+hal+ntfs-3g Automount Prob

    Ok so the basics KDE 3.5.9 from kdemod (not the full version): from desktop go to control center -> Desktop -> Behavior -> Device Symbols (3rd Tab) and make sure the box is checked (Checked) --> I got the corresponding Icons On Desktop CD-ROM/DVD-ROM

  • Getting the active role of an user in a trigger

    Hello forum!! I've been searching to find out if and how I can get the active role of an user when programming a trigger. Unfortunately I did not succeed in finding some information about this. Is it possible? If yes, how? Thanks for any hint regardi

  • Help in copying part of threaded text in InDesign CS5

    When I copy part of a threaded text box that is linked to another text box in InDesign CS5 and then paste it to another location, the text from the first text box appears in the pasted version. The remaining text that was linked from the first text b

  • How to get music from someone else's itunes library onto your

    How to get music from someone else's itunes library onto your

  • Dvd slideshow problem

    folks here the situation, using iDVD, created a thanksgiving slideshow dvd back in november, everthing went fine. worked on all 3 of my dvd players in the house. now i created a christmas slideshow dvd. using the same type of dvd, but now the dvd doe