SPOOL the file in UTF8 Encoding

Hi
My Database supports the storage of chineese characters. I need to generate a file from my db which is used for further Processing. The file generated from the database using spool command should support chineese characters. How to generate a flat file with UTF8 Encoding using Spool command. Please do help me out.
Here i am giving the database settings.
ARAMETER VALUE
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CURRENCY $
NLS_ISO_CURRENCY AMERICA
NLS_NUMERIC_CHARACTERS .,
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD-MON-FXYYYY
NLS_DATE_LANGUAGE AMERICAN
NLS_CHARACTERSET AL32UTF8
NLS_SORT BINARY
NLS_TIME_FORMAT HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY $
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE

Theoretically, nothing special is required to spool UTF-8 characters to a spool file. You just turn spooling on, select the data you need, and it will go into your spool file.
<br>
Here is some sample code showing that it works.
<br>
SQL> !cat create_spool_file.sql
set heading  off
set feedback off
set sqlprompt ""
set echo off
spool spool_file.sql
select
  'select asciistr('' ' || unistr( '\BBBB') || ''') as result from dual;'
from dual;
spool off
set heading on
set feedback on
set sqlprompt "SQL> "
SQL> start create_spool_file.sql
select asciistr(' ë®»') as result from dual;
SQL> start spool_file.sql
RESULT
\BBBB
1 row selected.Practically however, there are a number of challenges when working with UTF-8 characters. In the example above you can see that, even though the "select asciistr(' ë®»') as ..." command looks like it has garbage characters in it, the character actually made it into the spool file o.k. The problem has more to do with viewing the UTF-8 characters than with spooling them into a file. You can find more info. in this posting cannot display unicode Hex value 25A0 in SQL Plus / 10g .
<br>
If you give a small example of what you're trying to accomplish and where you're having difficulty, perhaps we can help more.

Similar Messages

  • Windows Media Player cannot play the file after ame encode with out audio?

    strange behavior using media encoder today
    ive selected no audio when encoding an h264 for the android...every time (5x) I tried to encode I got "Windows Media Player cannot play the file" when I selected audio the error went away..
    the other issue I had was the work area only , my encodes were including the whole sequence an not the "work area only" when selected?
    buggy day ..love to edit ..
    mike d Oakland ca.
    cs6 premiere

    The export without audio is an .m4v file, which many plays have trouble with.  For now, use the audio, which creates a playable .mp4 file.

  • AQ Adapter:  Invalid UTF8 encoding.

    Hello,
    I am using the data type XMLType to enqueue data from a database to a BPEL process to integrate with other systems. We are using the AQ Adapter to receive messages from BPEL. For the most part it works, but when we are receiving multiple messages we receive less than expected. We break the result set from the query into 200 record blocks, and place those on the queue. Everything works great going to the queue. However, when the message is dequeued from BPEL, some messages fail with the error: Invalid UTF8 encoding.
    Environment:
    Oracle 10g Enterprise 10.2.0.4.0 - system nls_character_set is AL32UTF8
    Oracle SOA Suite 10.1.3.4
    Data: US English, no double byte languages - using VARCHAR2(BYTE) or VARCHAR2(CHAR) produces same results
    Below are the steps and code snipets we are executing:
    1)     Create XML base document
    <?xml version="1.0" encoding="UTF-8"?>
          <int:INTEGRATION xmlns:sfdc="http://xmlns.oracle.com/xdb/INT_AQADMIN">
          <DATA_SOURCE>' || data_source || '</DATA_SOURCE>
          <OBJECT_NAME>' || object_name || '</OBJECT_NAME>
          <MAP_ID>' || map_id || '</MAP_ID>
    </int:INT_INTEGRATION>2)     A query is run using DBMS_XMLGEN, i.e. select * from <table>, returned as XML (max of 200 records at a time),
    3)     Convert CLOB to XMLType
    4)     Append XML to base xml doc
    5)     Enqueue message
    Code excerpt:
                xml_base := xmltype(build_xml_base(data_source, object_name, map_id));  -- builds message listed above
                qryCtx :=  dbms_xmlgen.newContext (sql_query);
                DBMS_XMLGEN.setRowSetTag(qryCtx, XML_ROWSET_TAG);  -- <DATA>
                DBMS_XMLGEN.setRowTag(qryCtx, XML_ROW_TAG); -- <DATAITEM>
                DBMS_XMLGEN.setMaxRows(qryCtx, XML_MAX_RESULTSET_ROWS); -- 200
                DBMS_XMLGEN.setConvertSpecialChars(qryCtx, true);
                LOOP
                    -- save the XML into the CLOB result.
                    xmlgen_result :=  DBMS_XMLGEN.getXMLtype(qryCtx);
                    -- if no rows exist, exit prior to enqueuing data
                    EXIT WHEN DBMS_XMLGEN.getNumRowsProcessed(qryCtx) = 0;
                     select appendchildxml(xml_base,
                          '/int:INTEGRATION',
                          xmlgen_result,
                          'xmlns:int="http://xmlns.oracle.com/xdb/INT_AQADMIN"')
                    into xml_data from dual;
                    SFDC_AQADMIN.SFDC_INTEGRATION_QUEUE.ENQUEUE_SFDC_OBJECT (xml_data, correlation);
                END LOOP;When the procedure is run, the objects get placed on the queue fine. BPEL starts to dequeue the message from the queue. However, we do not get all of the messages.
    Looking at the BPEL logs describes the problem:
    <2009-10-27 10:49:16,264> <ERROR> <iCareTest.collaxa.cube.activation> <AQ Adapter::Inbound> MessageReader_ReadMessage: Problem while constructing XML document from Oracle Object payload: java.io.UTFDataFormatException: Invalid UTF8 encoding.
    <2009-10-27 10:49:16,264> <ERROR> <iCareTest.collaxa.cube.activation> <AQ Adapter::Inbound> java.io.UTFDataFormatException: Invalid UTF8 encoding. at oracle.xml.parser.v2.XMLUTF8Reader.checkUTF8Byte(XMLUTF8Reader.java:160) at oracle.xml.parser.v2.XMLUTF8Reader.readUTF8Char(XMLUTF8Reader.java:175) at oracle.xml.parser.v2.XMLUTF8Reader.fillBuffer(XMLUTF8Reader.java:120) at oracle.xml.parser.v2.XMLByteReader.saveBuffer(XMLByteReader.java:450) at oracle.xml.parser.v2.XMLReader.fillBuffer(XMLReader.java:2488) at oracle.xml.parser.v2.XMLReader.scanNameChars(XMLReader.java:1197) at oracle.xml.parser.v2.XMLReader.scanName(XMLReader.java:1910) at oracle.xml.parser.v2.NonValidatingParser.parseEndTag(NonValidatingParser.java:1358) at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1313) at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336) at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303) at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:291) at oracle.tip.adapter.aq.database.XMLEngine.stringToDOMSource(XMLEngine.java:324) at oracle.tip.adapter.aq.database.MessageReader.readMessage(MessageReader.java:478) at oracle.tip.adapter.aq.inbound.AQActivationSpecDequeuer.run(AQActivationSpecDequeuer.java:261) at oracle.tip.adapter.fw.jca.work.WorkerJob.go(WorkerJob.java:51) at oracle.tip.adapter.fw.common.ThreadPool.run(ThreadPool.java:280) at java.lang.Thread.run(Thread.java:595)
    The line below indicates the byte is not UTF-8
    Invalid UTF8 encoding. at oracle.xml.parser.v2.XMLUTF8Reader.checkUTF8Byte(XMLUTF8Reader.java:160)
    Has anyone seen this? It appears to be something with the AQ Adapter. I cannot see anything strange looking at the XML that is generated. Any help would be greatly appreciated.
    Thanks in advance,
    Jim

    Hi Mark,
    Please mail me your sample data with this character in that file. We can take this as a usecase for our testing team.

  • Force jvm to use UTF8 encoding for properties?

    hi,
    my problem is i cannot display turkish characters that are retrieved from properties file [(key, value) pair].The value may contain turkish characters.
    reference : java toc
    "..When saving properties to a stream or loading them from a stream, the ISO 8859-1 character encoding is used. For characters that cannot be directly represented in this encoding, Unicode escapes are used; however, only a single 'u' character is allowed in an escape sequence..."
    instead of iso 8859-1 or directly representing non-conforming characters in the form of UTF8 encoding , i want to use UTF8 . i dont know is there a way to enforce the encoding to UTF8 .is it possible ?
    note : javac -encoding or java -Djava.encoding has no use..
    thanx in advance

    Hi,
    I did a lot of testing with the method of my last posting and ran into the following problem: each character, that is not available in iso 8859-1 is discarded and replaced by a '?'. So when e.g. loading arabic characters you get just "?????" as your property's value.
    The only possibility to enable other encodings of Property Files is to replace the encoding of the reader to one that is better suited. So I created a customized class, that inherits from java.util.Properties, and supports loading and storing to any encoding. This class I give here:
    * Properties.java
    * Created on 11. Juni 2003, 14:08
    package xy;
    * The <code>Properties</code> class represents a persistent set of
    * properties. The <code>Properties</code> can be saved to a stream
    * or loaded from a stream. Each key and its corresponding value in
    * the property list is a string.
    * <p>
    * A property list can contain another property list as its
    * "defaults"; this second property list is searched if
    * the property key is not found in the original property list.
    * <p>
    * Because <code>Properties</code> inherits from <code>Hashtable</code>, the
    * <code>put</code> and <code>putAll</code> methods can be applied to a
    * <code>Properties</code> object.  Their use is strongly discouraged as they
    * allow the caller to insert entries whose keys or values are not
    * <code>Strings</code>.  The <code>setProperty</code> method should be used
    * instead.  If the <code>store</code> or <code>save</code> method is called
    * on a "compromised" <code>Properties</code> object that contains a
    * non-<code>String</code> key or value, the call will fail.
    * <p>
    * <a name="encoding"></a>
    * When saving properties to a stream or loading them from a stream, the
    * ISO 8859-1 character encoding can be used. For characters that cannot be directly
    * represented in this encoding,
    * <a href="http://java.sun.com/docs/books/jls/html/3.doc.html#100850">Unicode escapes</a>
    * are used; however, only a single 'u' character is allowed in an escape sequence.
    * The native2ascii tool can be used to convert property files to and from
    * other character encodings.
    * </p>
    * <p>
    * This Properties class is an extension of the default properties class an supports the
    * loading and saving from and into other encodings than ISO 8859-1.
    * </p>
    * @see <a href="../../../tooldocs/solaris/native2ascii.html">native2ascii tool for Solaris</a>
    * @see <a href="../../../tooldocs/win32/native2ascii.html">native2ascii tool for Windows</a>
    * @author  Gregor Kappler, extended the class of JDK by
    * @author  Arthur van Hoff
    * @author  Michael McCloskey
    * @version 1.64, 06/26/00
    * @since   JDK1.0
    public class Properties extends java.util.Properties {
        private static final String keyValueSeparators = "=: \t\r\n\f";
        private static final String strictKeyValueSeparators = "=:";
        private static final String specialSaveChars = "=: \t\r\n\f#!";
        private static final String whiteSpaceChars = " \t\r\n\f";
        /** Creates a new instance of Properties */
        public Properties() {
         * Reads a property list (key and element pairs) from the input stream.
         * The stream is assumed to be in the specified character encoding.
         * <p>
         * Every property occupies one line of the input stream. Each line
         * is terminated by a line terminator (<code>\n</code> or <code>\r</code>
         * or <code>\r\n</code>). Lines from the input stream are processed until
         * end of file is reached on the input stream.
         * <p>
         * A line that contains only whitespace or whose first non-whitespace
         * character is an ASCII <code>#</code> or <code>!</code> is ignored
         * (thus, <code>#</code> or <code>!</code> indicate comment lines).
         * <p>
         * Every line other than a blank line or a comment line describes one
         * property to be added to the table (except that if a line ends with \,
         * then the following line, if it exists, is treated as a continuation
         * line, as described
         * below). The key consists of all the characters in the line starting
         * with the first non-whitespace character and up to, but not including,
         * the first ASCII <code>=</code>, <code>:</code>, or whitespace
         * character. All of the key termination characters may be included in
         * the key by preceding them with a \.
         * Any whitespace after the key is skipped; if the first non-whitespace
         * character after the key is <code>=</code> or <code>:</code>, then it
         * is ignored and any whitespace characters after it are also skipped.
         * All remaining characters on the line become part of the associated
         * element string. Within the element string, the ASCII
         * escape sequences <code>\t</code>, <code>\n</code>,
         * <code>\r</code>, <code>\\</code>, <code>\"</code>, <code>\'</code>,
         * <code>\  </code>  (a backslash and a space)
         * are recognized and converted to single
         * characters. Moreover, if the last character on the line is
         * <code>\</code>, then the next line is treated as a continuation of the
         * current line; the <code>\</code> and line terminator are simply
         * discarded, and any leading whitespace characters on the continuation
         * line are also discarded and are not part of the element string. <br>
         * Note:
         * <code>\u</code><i>xxxx</i> is not supported if the encoding is not
         * ISO 8859-1!
         * <p>
         * As an example, each of the following four lines specifies the key
         * <code>"Truth"</code> and the associated element value
         * <code>"Beauty"</code>:
         * <p>
         * <pre>
         * Truth = Beauty
         *     Truth:Beauty
         * Truth               :Beauty
         * </pre>
         * As another example, the following three lines specify a single
         * property:
         * <p>
         * <pre>
         * fruits                    apple, banana, pear, \
         *                                  cantaloupe, watermelon, \
         *                                  kiwi, mango
         * </pre>
         * The key is <code>"fruits"</code> and the associated element is:
         * <p>
         * <pre>"apple, banana, pear, cantaloupe, watermelon, kiwi, mango"</pre>
         * Note that a space appears before each <code>\</code> so that a space
         * will appear after each comma in the final result; the <code>\</code>,
         * line terminator, and leading whitespace on the continuation line are
         * merely discarded and are <i>not</i> replaced by one or more other
         * characters.
         * <p>
         * As a third example, the line:
         * <p>
         * <pre>cheeses
         * </pre>
         * specifies that the key is <code>"cheeses"</code> and the associated
         * element is the empty string.<p>
         * @param      inStream   the input stream.
         * @exception  IOException  if an error occurred when reading from the
         *               input stream.
        public synchronized void load(java.io.InputStream inStream, java.nio.charset.Charset encoding) throws java.io.IOException {
            if (encoding.equals (encoding.forName("8859_1"))) {
                super.load (inStream);
                return;
            java.io.BufferedReader in = new java.io.BufferedReader(new java.io.InputStreamReader(inStream, encoding));
         while (true) {
                // Get next line
                String line = in.readLine();
                if (line == null)
                    return;
                if (line.length() > 0) {
                    // Continue lines that end in slashes if they are not comments
                    char firstChar = line.charAt(0);
                    if ((firstChar != '#') && (firstChar != '!')) {
                        while (continueLine(line)) {
                            String nextLine = in.readLine();
                            if(nextLine == null)
                                nextLine = "";
                            String loppedLine = line.substring(0, line.length()-1);
                            // Advance beyond whitespace on new line
                            int startIndex=0;
                            for(startIndex=0; startIndex<nextLine.length(); startIndex++)
                                if (whiteSpaceChars.indexOf(nextLine.charAt(startIndex)) == -1)
                                    break;
                            nextLine = nextLine.substring(startIndex,nextLine.length());
                            line = new String(loppedLine+nextLine);
                        // Find start of key
                        int len = line.length();
                        int keyStart;
                        for(keyStart=0; keyStart<len; keyStart++) {
                            if(whiteSpaceChars.indexOf(line.charAt(keyStart)) == -1)
                                break;
                        // Blank lines are ignored
                        if (keyStart == len)
                            continue;
                        // Find separation between key and value
                        int separatorIndex;
                        for(separatorIndex=keyStart; separatorIndex<len; separatorIndex++) {
                            char currentChar = line.charAt(separatorIndex);
                            if (currentChar == '\\')
                                separatorIndex++;
                            else if(keyValueSeparators.indexOf(currentChar) != -1)
                                break;
                        // Skip over whitespace after key if any
                        int valueIndex;
                        for (valueIndex=separatorIndex; valueIndex<len; valueIndex++)
                            if (whiteSpaceChars.indexOf(line.charAt(valueIndex)) == -1)
                                break;
                        // Skip over one non whitespace key value separators if any
                        if (valueIndex < len)
                            if (strictKeyValueSeparators.indexOf(line.charAt(valueIndex)) != -1)
                                valueIndex++;
                        // Skip over white space after other separators if any
                        while (valueIndex < len) {
                            if (whiteSpaceChars.indexOf(line.charAt(valueIndex)) == -1)
                                break;
                            valueIndex++;
                        String key = line.substring(keyStart, separatorIndex);
                        String value = (separatorIndex < len) ? line.substring(valueIndex, len) : "";
                        // Convert then store key and value
                        key = loadConvert(key);
                        value = loadConvert(value);
                        put(key, value);
         * Writes this property list (key and element pairs) in this
         * <code>Properties</code> table to the output stream in a format suitable
         * for loading into a <code>Properties</code> table using the
         * <code>load</code> method.
         * The stream is written using the ISO 8859-1 character encoding.
         * <p>
         * Properties from the defaults table of this <code>Properties</code>
         * table (if any) are <i>not</i> written out by this method.
         * <p>
         * If the header argument is not null, then an ASCII <code>#</code>
         * character, the header string, and a line separator are first written
         * to the output stream. Thus, the <code>header</code> can serve as an
         * identifying comment.
         * <p>
         * Next, a comment line is always written, consisting of an ASCII
         * <code>#</code> character, the current date and time (as if produced
         * by the <code>toString</code> method of <code>Date</code> for the
         * current time), and a line separator as generated by the Writer.
         * <p>
         * Then every entry in this <code>Properties</code> table is written out,
         * one per line. For each entry the key string is written, then an ASCII
         * <code>=</code>, then the associated element string. Each character of
         * the element string is examined to see whether it should be rendered as
         * an escape sequence. The ASCII characters <code>\</code>, tab, newline,
         * and carriage return are written as <code>\\</code>, <code>\t</code>,
         * <code>\n</code>, and <code>\r</code>, respectively. Characters less
         * than <code>\u0020</code> and characters greater than
         * <code>\u007E</code> are written as <code>\u</code><i>xxxx</i> for
         * the appropriate hexadecimal value <i>xxxx</i>. Leading space characters,
         * but not embedded or trailing space characters, are written with a
         * preceding <code>\</code>. The key and value characters <code>#</code>,
         * <code>!</code>, <code>=</code>, and <code>:</code> are written with a
         * preceding slash to ensure that they are properly loaded.
         * <p>
         * After the entries have been written, the output stream is flushed.  The
         * output stream remains open after this method returns.
         * @param   out      an output stream.
         * @param   header   a description of the property list.
         * @exception  IOException if writing this property list to the specified
         *             output stream throws an <tt>IOException</tt>.
         * @exception  ClassCastException  if this <code>Properties</code> object
         *             contains any keys or values that are not <code>Strings</code>.
         * @exception  NullPointerException  if <code>out</code> is null.
         * @since 1.2
        public synchronized void store(java.io.OutputStream out, java.nio.charset.Charset encoding, String header)
        throws java.io.IOException
            if (encoding.equals (encoding.forName("8859_1"))) {
                super.store (out,header);
                return;
            java.io.BufferedWriter awriter;
            awriter = new java.io.BufferedWriter(new java.io.OutputStreamWriter(out,encoding));
            if (header != null)
                writeln(awriter, "#" + header);
            writeln(awriter, "#" + new java.util.Date().toString());
            for (java.util.Enumeration e = keys(); e.hasMoreElements();) {
                String key = (String)e.nextElement();
                String val = (String)get(key);
                key = saveConvert(key, true);
             /* No need to escape embedded and trailing spaces for value, hence
              * pass false to flag.
                val = saveConvert(val, false);
                writeln(awriter, key + "=" + val);
            awriter.flush();
         * changes special saved chars to their original forms
        private String loadConvert (String theString) {
            char aChar;
            int len = theString.length();
            StringBuffer outBuffer = new StringBuffer(len);
            for(int x=0; x<len; ) {
                aChar = theString.charAt(x++);
                if (aChar == '\\') {
                    aChar = theString.charAt(x++);
                    if (aChar == 't') aChar = '\t';
                    else if (aChar == 'r') aChar = '\r';
                    else if (aChar == 'n') aChar = '\n';
                    else if (aChar == 'f') aChar = '\f';
                    else if (aChar == '\\') aChar = '\\';
                    else if (aChar == '\"') aChar = '\"';
                    else if (aChar == '\'') aChar = '\'';
                    else if (aChar == ' ') aChar = ' ';
                    else
                        throw new IllegalArgumentException ("error in Encoding: '\\"+aChar+" not supported");
                    outBuffer.append(aChar);
                } else
                    outBuffer.append(aChar);
            return outBuffer.toString();
         * writes out any of the characters in specialSaveChars
         * with a preceding slash
        private String saveConvert(String theString, boolean escapeSpace) {
            int len = theString.length();
            StringBuffer outBuffer = new StringBuffer(len*2);
            for(int x=0; x<len; x++) {
                char aChar = theString.charAt(x);
                switch(aChar) {
              case ' ':
                  if (x == 0 || escapeSpace)
                   outBuffer.append('\\');
                  outBuffer.append(' ');
                  break;
                    case '\\':outBuffer.append('\\'); outBuffer.append('\\');
                              break;
                    case '\t':outBuffer.append('\\'); outBuffer.append('t');
                              break;
                    case '\n':outBuffer.append('\\'); outBuffer.append('n');
                              break;
                    case '\r':outBuffer.append('\\'); outBuffer.append('r');
                              break;
                    case '\f':outBuffer.append('\\'); outBuffer.append('f');
                              break;
                    default:
    //                    if ((aChar < 0x0020) || (aChar > 0x007e)) {
    //                        outBuffer.append(aChar);
    //                    } else {
                            if (specialSaveChars.indexOf(aChar) != -1)
                                outBuffer.append('\\');
                            outBuffer.append(aChar);
            return outBuffer.toString();
         * Returns true if the given line is a line that must
         * be appended to the next line
        private boolean continueLine (String line) {
            int slashCount = 0;
            int index = line.length() - 1;
            while((index >= 0) && (line.charAt(index--) == '\\'))
                slashCount++;
            return (slashCount % 2 == 1);
        private static void writeln(java.io.BufferedWriter bw, String s) throws java.io.IOException {
            bw.write(s);
            bw.newLine();
    }I hope you can use this class for your needs as I can. For me it supports any characters so far. If you find some bugs on it, let me know
    Regards,
    Gregor Kappler

  • Hello, How do I tell sql+ to spool output file from windows to Unix server?

    Hello, How do I tell sql+ to spool output file from windows to Unix server?
    I am new to SQL+ and just learned how to spool the file. But file is saved in my local windows enviroment and since it's 2GB in size...I want to spool it directly to another remote unix server.
    Pls answer in detail... I have been to most of the thread and didn't see relevant answer to above question.
    Am I suppose to develope some script which FTP the spool file directly to the server I want to
    or
    i Have to use UTL_FILE Package ?
    Thanks for reply

    You may not be able to...
    SQL*Plus can only spool to the local machine. If you have mapped a directory on the Unix server from your Windows machine, you can specify that directory in your SPOOL command.
    You could telnet to the Unix server, run SQL*Plus there, and spool the file to a local (Unix) directory.
    If the Unix server is also the Oracle database server, you could use the UTL_FILE package rather than using SQL*Plus to spool a file.
    If the Unix server is also an FTP server, you could also FTP the file from your local machine to the server.
    Of course, I would tend to re-examine a requirement to regularly generate a 2 GB text file. It seems likely that there is a better way...
    Justin

  • What Determines the "File Character Set" on Export?

    When we Export a Page, for example, from APEX, the File Character Set is defaulted to some value (and not editable). On some of our instances, this defaults to "Western European Windows 1252" while on others it is "Unicode UTF-8." Specifically, what setting is being used to make this determination? This is kind of a pain because we have some environments wherein we are promoting changes from environment to environment and these settings differ. If, during import, the user neglects to set this to the same File Character Set in which the file was originally exported, we get issues (non-printable control characters and the like). Therefore, we'd love to make all of the environments match but, aren't sure how to do this.
    Thanks,
    -Joe
    Edited by: Joe Upshaw on Apr 10, 2013 3:25 PM

    Hello Joe,
    In your environment, the character set of the APEX exported files is set according to the DAD character set, and with your APEX version, it must be set to AL32UTF8 (regardless of the database character set).
    Re: Export - File Character Set list is read only (fixe UTF-8 value)
    You should check the DAD character set setting in the environments in which APEX is not exporting the files using UTF8.
    Regards,
    Arie.
    &diams; Please remember to mark appropriate posts as correct/helpful. For the long run, it will benefit us all.
    &diams; Author of Oracle Application Express 3.2 – The Essentials and More

  • How to spool the data with out space

    Hi, My version is 10g. I am trying to spool the file. this is my sql file looks like.
    set pagesize 0
    set heading on
    set verify off
    set linesize 32767
    set trimspool on
    set feedback off
    set termout off
    set colsep '~'
    set underline off
    set echo off
    set term off
    sET NEWPAGE 0
    --SET SPACE 0
    SET MARKUP HTML OFF SPOOL OFF
    spool C:\text0728.txt;
    SELECT DISTINCT a.m_name, a_code, a.p_id, a.p_name,
    a.p_type, e._name, e.s_list from mname a,slist e
    where a.p_id=e.p_id;
    spool off;
    my spool file looks like this
    codename~matrix        ~888~nametarget           ~in~todao~~
    codename1~matrix1        ~879~name           ~in~todao~
    If we see matrix value have space *~matrix ~*
    I want the value to spool with out the space i.e *~matrix~*
    What to set for my requirment in sql file?
    Thanks.

    select a.m_name,
             regexp_replace(a_code,'[[:space:]]matrix[[:space:]]','matrix') as a_code,
             a.p_id,
             a.p_name,
             a.p_type,
             e._name, e.s_list *
    from
         mname a,slist e
    where
        a.p_id=e.p_id;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Node doesn't belong to the current document and Invalid UTF8 encoding errors

    Hi
    I'm creating a XSQL page that calls a PL/SQL procedure:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <page xmlns:xsql="urn:oracle-xsql" connection="sgvrt">
    <xsql:include-owa>xml_indicadores_epm;</xsql:include-owa>
    </page>
    When I run the page I get:
    Node doesn't belong to the current document.
    if I use "<include-xml>" I get the following error:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <page>
    <xsql-error action="xsql:include-xml">
    <message>Invalid UTF8 encoding.</message>
    </xsql-error>
    </page>
    The XML page generated is well formed and it sends "test/xml; charset="ISO-8859-1" myme type. I test it in IE and it runs fine. I wrote a simple procedure that generates a simple one tag XML file and I still get the same errors.

    Thanks for the reply
    We've tried using the encoding attribute (encoding="ISO-8859-1") but it generates the same errors. We're using XSQL that comes with 9iAS 1.0.2.2.2a. We also tried with XSQL that comes with Oracle 9.2.0. It seems that the parser is not detecting if the XML document has a different encoding than UTF8.

  • Node doesn't belong to the current document and Invalid UTF8 encoding.

    Hi
    I'm creating a XSQL page that calls a PL/SQL procedure:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <page xmlns:xsql="urn:oracle-xsql" connection="sgvrt">
    <xsql:include-owa>xml_indicadores_epm;</xsql:include-owa>
    </page>
    When I run the page I get:
    Node doesn't belong to the current document.
    if I use "<include-xml>" I get the following error:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <page>
    <xsql-error action="xsql:include-xml">
    <message>Invalid UTF8 encoding.</message>
    </xsql-error>
    </page>
    The XML page generated is well formed and it sends "test/xml; charset="ISO-8859-1" myme type. I test it in IE and it runs fine. I wrote a simple procedure that generates a simple one tag XML file and I still get the same errors.
    The page generated by the PL/SQL procedure is:
    <indicadores_gestion_epm>
    <fecha>Junio 2001</fecha>
    <indicador><descripcion>Costo de Generacisn de Potencial por Perforacisn (Conv.)</descripcion><plan_valor>N/D</plan_valor><real_valor>48,21</real_valor><unidad_medida>M$/Bl</unidad_medida></indicador>
    <indicador><descripcion>Costo de Generacisn de Potencial por Perforacisn (GD)</descripcion><plan_valor>N/D</plan_valor><real_valor>0</real_valor><unidad_medida>M$/Bl</unidad_medida></indicador>
    <indicador><descripcion>Costo de Exploracion Aqo Actual (GD)</descripcion><plan_valor>N/D</plan_valor><real_valor>22,48</real_valor><unidad_medida>$/BPE</unidad_medida></indicador>
    <indicador><descripcion>Costo de Exploracion Promedio (GD)</descripcion><plan_valor>N/D</plan_valor><real_valor>19,98</real_valor><unidad_medida>$/BD</unidad_medida></indicador>
    <indicador><descripcion>Incorporacion de Reservas Probadas y Probables de Crudo (GD)</descripcion><plan_valor>647</plan_valor><real_valor>2</real_valor><unidad_medida>MMBLs</unidad_medida></indicador>
    <indicador><descripcion>Incorporacion de Reservas Probadas y Probables Gas (GD)</descripcion><plan_valor>N/D</plan_valor><real_valor>4</real_valor><unidad_medida>MMMPC</unidad_medida></indicador>
    <indicador><descripcion>Contribuciones a las Reservas Probadas de Gas (GD)</descripcion><plan_valor>N/D</plan_valor><real_valor>5</real_valor><unidad_medida>MMMPC</unidad_medida></indicador>
    <indicador><descripcion>Produccion Disponible Promedio de Crudo (GD)</descripcion><plan_valor>362,8</plan_valor><real_valor>1401,66</real_valor><unidad_medida>MBD</unidad_medida></indicador>
    <indicador><descripcion>Capacidad de Produccisn de Crudo</descripcion><plan_valor>N/D</plan_valor><real_valor>0</real_valor><unidad_medida>MBD</unidad_medida></indicador>
    <indicador><descripcion>Contribuciones a las Reservas Probadas de Crudo (GD)</descripcion><plan_valor>1750</plan_valor><real_valor>1750</real_valor><unidad_medida>MMBLs</unidad_medida></indicador>
    <indicador><descripcion>Costo Unitario de Operacisn (Conv.)</descripcion><plan_valor>0</plan_valor><real_valor>,01</real_valor><unidad_medida>$/BL</unidad_medida></indicador>
    <indicador><descripcion>Costo Unitario de Operacisn (GD)</descripcion><plan_valor>N/D</plan_valor><real_valor>102,53</real_valor><unidad_medida>$/BL</unidad_medida></indicador>
    <indicador><descripcion>Disponibilidad de Gas (Acumulado)</descripcion><plan_valor>N/D</plan_valor><real_valor>0</real_valor><unidad_medida>MMPCD</unidad_medida></indicador>
    <indicador><descripcion>Produccion de Crudo Entregada a RSC Promedio</descripcion><plan_valor>N/D</plan_valor><real_valor>0</real_valor><unidad_medida>MBD</unidad_medida></indicador>
    <indicador><descripcion>Costo de Generacion de Potenc. RA/RC (Conv.)</descripcion><plan_valor>N/D</plan_valor><real_valor>3,15</real_valor><unidad_medida>M$/BD</unidad_medida></indicador>
    <indicador><descripcion>Costo de Generacion de Potenc. RA/RC (GD)</descripcion><plan_valor>N/D</plan_valor><real_valor>0</real_valor><unidad_medida>M$/BD</unidad_medida></indicador>
    </indicadores_gestion_epm>

    Thanks for the reply
    We've tried using the encoding attribute (encoding="ISO-8859-1") but it generates the same errors. We're using XSQL that comes with 9iAS 1.0.2.2.2a. We also tried with XSQL that comes with Oracle 9.2.0. It seems that the parser is not detecting if the XML document has a different encoding than UTF8.

  • How to set encoding of the file when using UTL_FILE

    Hi,
    We are using HRMS 11i applications. 11.5.10.2 version. Two languages are installed in our instance. American English and Canadian French.
    We have requirement to send employee details in a text file to third party vendor. We are using UTL_FILE to write details to the text file from PL/SQL procedure.
    The generated output file has encoding as "UTF8". Where as vendor is not able to process this file. They required encoding as "ANSI".
    How can we change the encoding to "ANSI" ?
    Values of character set parametrs are as follows.
    NLS_CHARACTERSET UTF8
    NLS_NCHAR_CHARACTERSET UTF8
    Any inputs are highly appreciated.
    Regards,
    Veerababu.

    You should take a look at the UTL_FILE documentation. As far as I know standard UTL_FILE calls write to the file system in the database character set. There are mirrored calls, but those write to the file system in UTF8.
    You may want to look at the UTL_RAW.CONVERT function. You may be able to use that in conjunction with the UTL_FILE.PUT_RAW API to write out data in the correct character set. To be honest, I've never tried this approach.
    Edited by: Centinul on Sep 21, 2012 8:16 AM

  • [SOLVED] xfce4 automounting problem on usb dev with utf8 encoded files

    I have problem of auto mounting usb external drive contains utf8 encoded files under xfce4.
    Using hal and dbus for usb device detection.
    Heard that I need to add iocharset=utf8 under fstab or hal fdi configure files and tried them all but didn't work
    usb devices with vfat always got mounted with default charset.
    I found out that exo-mount is the one doing the actual mounting and that it is the one that cannot take all extra mounting options such as iocharset etc.
    Have tried gnome to mount this hard drive and works find with nautilus option that let me set various mount options for each harddrive.
    Is there any way to replace exo-mount with some other alternative mounting tools that work with thunar?
    Any workaround will be helpful as long as I can mount my usb drives with prefer charset so that I don't have to guess all ???marked files.
    Heard that xubuntu replaced that exo-mount with gnome-mount to handle drives with extra mount options such as iocharset.
    but I am pretty new to configuring things and couldn't find the step by step instruction for this so please provide the complete solution.
    Link to the pages that explain workaround would be nice as well.
    Thanks in advance!
    Last edited by axca (2007-10-17 18:24:50)

    Found the patch for exo-mount so that it takes additional mount options HAL suggests.
    https://bugzilla.altlinux.org/attachmen … ction=diff
    Now my usb drive can be mounted with the proper charset.
    Hope this patch helps others with similar situation as well!
    Last edited by axca (2007-10-15 15:41:47)

  • Invalid UTF8 encoding (in control file)

    Hi,
    I'm using French characters in my control file (in the body of an email), and getting this java exception: Invalid UTF8 encoding.
    For example:
    subject="Oracle Order Acknowledgement for Order ${ORDER NUMBER} (${INSTANCE})">Ci-joint votre accusé de réception de commande au format Adobe.
    Merci!
    The default in notepad is ANSI, so I changed it to UTF-8, which caused the text to read as follows:
    Ci-joint votre accus顤e rꤥption de commande au format Adobe. Merci!
    But I'm still getting the error.
    Any ideas?
    Thanks.
    Paul

    FYI -- I found a way around this, by creating a variable for email body text in the Oracle report, and then using ${CF_EMAIL_BODY_TEXT} in the control file.

  • Changing the file format of spool output when scheduling a background job.

    Hello Experts,
    I have an issue. It is related to Spool output format. I created a job for one report program for which the output is a list output. I have added one recipient in the 'Spool list recipient' while creating the job SM36. After the job is finished the spool output is sent to the recipient mail id as .htm format as an attachment. But the attachment should be excel sheet or text file. No coding in the program should be used to convert the file format. Only settings in the spool while creating job should be manipulated. Please help me in solving this issue.
    Regards.

    Hi Sunil,
    You can use the logic for converting spool to PDF using program : RSTXPDFT4 . Alternatively you can use FM: CONVERT_ABAPSPOOLJOB_2_PDF . In this FM you need to pass the Spool id .
    u can make use of these FM's SO_DOCUMENT_SEND_API1
    SO_NEW_DOCUMENT_SEND_API1
    Check out the following wiki:
    https://wiki.sdn.sap.com/wiki/display/Snippets/ConvertsspoolrequestintoPDFdocumentand+emails
    hope this will use full to you.
    Thanks!!

  • How to set the file.encoding in jvm?

    I have some error in showing Chinese by used servlet,
    some one tole me that I can change the file.encoding in jvm to zh_CN, how can I do that?

    Add the java argument in your servlet engine.
    e.g
    java -Dfile.encoding=ISO8859-1
    garycafe

  • How to spool file with a timestamp/seq_number in the file name

    Hi I try to write a test script that will have some kind of timestamp or seq_number in the spool output file's filename itself.
    so e.g.
    test_abc_20120425161616.txt
    I can do it on shell but is there a way I can do it all in sqlplus.
    I recall I see something similar in statpack long time ago..

    vxwo0owxv wrote:
    Hi I try to write a test script that will have some kind of timestamp or seq_number in the spool output file's filename itself.
    so e.g.
    test_abc_20120425161616.txt
    I can do it on shell but is there a way I can do it all in sqlplus.
    I recall I see something similar in statpack long time ago..
    >Hi I try to write a test script that will have some kind of timestamp or seq_number in the spool output file's filename itself.
    so e.g.
    test_abc_20120425161616.txt
    I can do it on shell but is there a way I can do it all in sqlplus.
    I recall I see something similar in statpack long time ago..
    set termout off
    col dt new_value dt
    select to_char(sysdate,'YYYYMMDDHH24MISS') dt from dual;
    set termout on
    spool file_&dt
    -- place your SQL here
    spool off
    Handle:     vxwo0owxv
    Status Level:     Newbie
    Registered:     Mar 14, 2011
    Total Posts:     142
    Total Questions:     79 (59 unresolved)
    WHY am I NOT surprised?
    Edited by: sb92075 on Apr 24, 2012 4:37 PM

Maybe you are looking for

  • Unable to download latest version of itunes

    I'm unable to open my latest download because of two issues.  First, I keep getting a pop-up saying something to the effect of Service on Apple Mobile Device Failedf to Start, and after repeated retrys I skipped it. Evenually I was able to down load

  • Servlet Server Socket Communication problem

    Hi Iam having this problem ...when I read data in server line by line it works but when I try to read byte by byte server hangs. This is my code BufferedReader in = new BufferedReader( new InputStreamReader( clientSocket.getInputStream())); //it work

  • Print immediately

    HI everybody, Is it possible to specify in an abap program that I want to print a list immediately after clicking on the print button? I don't want that the user chooses 'Send to SAP spooler only for now'. Is it possible??? Thank you.

  • Remote App with ATV died

    I just updated my Ipod Gen 1 with 3.0, and updated remote...along with updating my ATV to 2.4. Now, my Apple TV will not see the ipod remote! It used to work fine before, I changed nothing on my network. I use a TC on N for my macbooks and ATV. I use

  • Broken link to win downloads for 9.2.0.1

    The zip download links are broken at http://www.oracle.com/technology/software/products/oracle9i/htdocs/winsoft.html.