Inserting and retrieving data from a al32UTF8 database USING SQL Developer

hi guys,
Before i post my questions , i think its better for me to provide you guys with my understandings first so that it easier to understand where/if i have gone wrong..
I am using Window XP and Oracle 10g
Non-unicode client - a client program that need to use the OS code page for mapping of the retrieved unicode data from the database as well as the support of displaying/inserting the characters from that code page to the database.
E.G sqlplusw.exe
Therefore, when using a non-unicode client
1) we have to set the OS code page (Control panel - regional and language setting - advance - language for non unicode program ) to the code page that contain the characters we are going to display/insert.
2) we will also have to set the NLS_LANG characterset to the character set of the code page we are going to insert so that when we do a insert (for e.g in thai ) , oracle will know, and auto conversion to UNICODE can take place. This is also true when we retrieve unicode data from the database so that conversion to the correct character set can take place.
INSERTING
THAI ---> conversion ----> UNICODE
RETRIEVING
THAI <---- conversion <---- UNICODE
I hope my basic understanding is correct up till this point.
Unicode client - a client program that supports the displaying/inserting of unicode characters without the need of setting the OS code page (Control panel - regional and language setting - advance - language for non unicode program )
E.G isqlplus http or SQL developer
However,
1) There is still a need to set the NLS_LANG so that correct conversion can take place between the client and the database.
For e.g, when retrieving if we set the NLS_LANG character set to ZHS16GBK (chinese) and the data store in unicode in database is E.G (THAI) , then the conversion would be wrong .
Since it is a unicode supported client, then the NLS_LANG character set should be set to UNICODE as well.
Here come my questions
*Important - please help if you are busy and have no other time to answer the rest of the questions
*Q1) If i were to use a unicode client, what should i set my NLS_LANG character set to ?
AMERICAN_AMERICA.UTF8 ?
*Q2) Where do i set the NLS_LANG character set information in SQL Developer, i know there is a metalink for setting NLS_LANG using isqlplus but i cant seems to google any result for SQL developer.
Q3) Is my basic understanding right until this point ? If not, please explain in a more generalised term as i am really not familiar with character sets, code page, unicode , glyphs and fonts..
Q4) If a unicode client does not need to refer to the OS code page (set in regional and language) , is there a UNICODE code page for the client to refer to , or is there any Window API available ?
Q5)
There is still a need to set the NLS_LANG so that correct conversion can take place between the client and the >>database.
For e.g, when retrieving if we set the NLS_LANG character set to ZHS16GBK (chinese) and the data store in >>unicode in database is E.G (THAI) , then the conversion would be wrong .am i right on this point for UNICODE supported client ?
Thanks for spending time to read my questions and i hope to hear advices from you guys soon.
Million thanks again for sharing.
Best Regards,
Noob but willing to learn

The requirement to always set NLS_LANG is not true for JDBC, which ignores NLS_LANG altogether. Java programs fetch text data into String variables, which use Unicode UTF-16 by design. JDBC sets character set conversion so that data is converted between UTF-16 and the database or national character set.
The requirement to set NLS_LANG is not generally true for OCI, either. The first call in an OCI problem can be OCIEnvNlsCreate(). This call has two parameters that allow the caller to define the character set to use for VARCHAR2/CHAR/LONG/CLOB/statement text and the character set to use for NVARCHAR2/NCHAR/NCLOB. Only if these character sets are specified as 0, NLS_LANG character set is used. Also, OCI programs can specify different character sets for each bind or define variable (i.e. input/output buffer). Note: OCI programs always use NLS_LANG to initialize the language and territory settings for the client program and the database session. Only the character set can be specified is OCIEnvNlsCreate().
OCIEnvNlsCreate() can specify the client character set as UTF-16 (in platform endianess). This is not possible with NLS_LANG.
Various interfaces building on OCI, such as Oracle ODBC and ODP .NET, explicitly initialize OCI with Unicode character set, and thus ignore the NLS_LANG character set as well.
Thnx,
Sergiusz

Similar Messages

  • Inserting and retrieving data from a BLOB

    Hi All,
    I have a table where in i will be storing .CSV and .XLS files as BLOBS. I have no clue as to how to read from this column and translate the data into a meaningful form!.
    Can anyone help me with this?

    Don't store the results as BLOBS/CLOBS and unstructured solutions.
    If you do, then your requirement to "read from this column and translate data into a meaningful form" will fail.
    You should convert the logical representation of data in the CSV (field,row) or XLS representation into a database design following the principles of the relational model.
    You will then need to write a loading mechanism, which would probably leverage external tables as an access method; or possibly heterogeneous services for binary XLS if conversion isn't an option.

  • Store and retrieve data from a FP-2000 using RT application

    Using labview RT build application can i store and retrive the data from Fp-2000. If so how much memory it will be free?
    Karthikeyan @ sivathasan
    Karaikudi - 630006
    India
    hp: +919442047691

    This question is a little like "If I put some water in a one gallon bucket, how much spae will be left?"
    It all depends on how much you put in.
    A clean efficient app will leave more space left over. Its been years since I wrota an app that did that on a FP-2000 but I seem te rember having enough memory left over to buffer a weeks worth of data provided the sample rate is kept low enough and updates are limited by dead-bands.
    I think that's all I can say to try and help for now.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Export XML data from a CLOB field using sql developer

    I have a table that contains a CLOB field, each record is a complete XML in itself. After running the select query i am exporting this data by right clicking on the answer set, while the export completes the data for each record gets truncated.
    When i chose to save the export in loader format i get the complete records but now there are n files created for n records exported.
    Is there a way i can get alll the records in a single file wirthout any truncation.
    Thanks in advance!

    You might try delimited format or csv, with no enclosures if desired.

  • Retrieve data from MS Access database.

    Hi all,
    The following is part of my coding. Once I have clicked the jButton1, the jTextField1 will get the input of user and store into a variable named "bbb". After that the variable will be passed to a function as a parameter to retrieve data from MS Access database using the ResultSet method. Next, the ResultSet will be splited into many part and just the student ic will be displayed.
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
    // TODO add your handling code here:
            String bbb = jTextField1.getText(); //get input from user and store into a variable named bbb
            ResultSet codes = getCodes(bbb); //Retrieve data from database
            Code c = getCode (codes); //split the retireved date to many part
             jLabel2.setText(c.ic);  //display the student ic only
       private static ResultSet getCodes(String bbb)
            Connection con = getConnection();
            try
            Statement s = con.createStatement();
            String select = "SELECT [Student-File].* " + "FROM [Student-File] WHERE (([Student-File].[student-code])=bbb); " ;
            ResultSet rows;
            rows = s.executeQuery(select);
            return rows;
            catch (SQLException e)
                System.out.println(e.getMessage());
            return null;
    private static Code getCode (ResultSet codes)
            try
                String name = codes.getString("student-name");
                String scode = codes.getString("student-code");
                String ic = codes.getString ("student-ic");
                String add = codes.getString ("student-address");
                String phone = codes.getString ("student-phone");
              return new Code (name,scode,ic,add,phone);
            catch (SQLException e)
                System.out.println(e.getMessage());
            return null;
        private static class Code
            public String name ;
            public String scode ;
            public String ic ;
            public String add;
            public String phone;
            public Code (String name, String scode, String ic,String add,String phone)
                this.name = name;
                this.scode = scode;
                this.ic = ic;
                this.add = add;
                this.phone = phone;
    }But after I have compiled the coding above, the following error existed.
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
    at testing3.getCode(testing3.java:137)
    [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
    at testing3.jButton1ActionPerformed(testing3.java:71)
    at testing3.access$000(testing3.java:17)
    at testing3$1.actionPerformed(testing3.java:45)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
    at java.awt.Component.processMouseEvent(Component.java:5488)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
    at java.awt.Component.processEvent(Component.java:5253)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1774)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at testing3.getCode(testing3.java:137)
    at testing3.jButton1ActionPerformed(testing3.java:71)
    at testing3.access$000(testing3.java:17)
    at testing3$1.actionPerformed(testing3.java:45)
    My questions here are:
    1) Will my idea above work?
    2) Is it correct of my query statement that send to MS Access database?
    Can anyone help me?
    Thanks in advance,
    ning.

    you may try this:
    String select = "SELECT * FROM your_table_name WHERE your_column_name = '" + bbb + "'";or another approach using PreparedStatement:
    String select = "SELECT * FROM your_table_name WHERE your_column_name = ?";
    PreparedStatement ps = con.prepareStatement(select);
    ps.setString(1, "bbb");
    ResultSet rs = ps.executeQuery();hth.

  • ClickOnce WinForms Application to retrieve data from an Oracle Database

    I am hoping someone can help us.
    We are trying to create a ClickOnce WinForms Application that will allow our Customer Service group to retrieve data from an Oracle Database.
    We are currently able to use such a ClickOnce WinForms Application to allow our Customer Service group to retrieve data from SQL Server 2000 databases and even to a PICK Basic database. We use ole db drivers for these connections and keep the connection strings in a configuration file.
    Our primary question now is:
    1) What files would be needed on each client machine?
    Thanks for any pointers.
    :) Anne

    The problem has been fixed.
    If you wanna to load data from Oracle DB,the connect String should be like this:
    cnss.open "Provider=OraOLEDB.Oracle.1;data source=orcl;User Id=fdmitf;Password=fdmitf"
    besides, you should assign a value (True/False) to your function, as TonyScalese said in this post:
    Import from RDB Fails with "Error:Import failed.Invalid data or Empty..."
    Problem solved is always a great joy! Thanks!

  • How can u insert and retrieve text files in any format using forms6i.

    how can u insert and retrieve text files in any format using forms6i.
    can u give me an example of an insert statement, let's assume the file is located in the a:drive.
    and retrieving the files, i would give the user a list of all the files that are in the database, the user would select one, but what command(or piece of code) would open the file in its apppropriate editor.
    e.g .pdf formatted file would open in acrobat.
    any help would be appreciated.
    Thanks
    Hussein Saiger

    the filereference class is for downloading and uploading files.
    if you want to load xml, use the xml class.
    and, if you want to write to an xml file and don't want to use server-side code, wait.

  • How to start or shut down database using sql developer in windows

    Dear Sir/Madam,
    how we start or shut down database using sql developer in windows
    we are using oracle 11g release2, unix, java & oracle oracle weblogic administration
    Thanks & Regards
    Manish Kumar
    Datbase Team
    TCS Ltd.

    HI, Welcome to OTN form,
    SHUTDOWN is not a SQL statement but a SQL*Plus command . You cannot use SHUTDOWN in PL/SQL.
    Check following link:
    http://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve042.htm#i2699551
    More Information please check OTN discussion: https://forums.oracle.com/thread/2349159
    Thank you

  • Help with writing and retrieving data from a table field with type "LCHR"

    Hi Experts,
    I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
    Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
    Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
    Thanks in advance,
    C
    SAVING THE LIST DATA TO DB
    DATA: L_WA(800).
    LOOP AT T_TAB into L_WA.
    ZDBTAB-DATALEN = STRLEN( L_WA ).
    MOVE: L_WA to ZDBTAB-RAWDATA.
    ZDBTAB-LINENUM = SY-TABIX.
    INSERT ZDBTAB.
    READING THE DATA FROM DB
    DATA: BEGIN OF T_DATA,
                 SEQNR type ZDBTAB-LINENUM,
                 DATA type ZDBTAB-RAWDATA,
               END OF T_TAB.
    Select the data.
    SELECT linenum rawdata from ZDBTAB into table T_DATA
         WHERE repid = w_repname
         AND rundate = w_rundate
         ORDER BY linenum.
    Populate calling Internal Table.
    LOOP AT T-DATA.
    APPEND T_DATA to T_TAB.
    ENDLOOP.

    Hi Anuj,
    The unicode flag is active.
    When I run our report and then to try and save the list data a dump is happening at the following point
    LOOP AT T_TAB into L_WA.
    As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
    When I try to load a saved list the dump is happening at the following point
    APPEND T_DATA-RAWDATA to T_TAB.
    T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
    In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
    Regards
    C

  • How to save, update and retrieve data from two diffrent table

    Hi,
    I can save and retrieve data into an user defined SBO form from one database table only. How can I save retrieve and update records from two or more different tables in a single screen?
    Regards,
    Sudeshna.

    Sudeshna,
    Are these tables external to SAP Business One and do not have a Business Object?  If there is a Business Object available such as if you were to enter an order, that order would use the Documents object which abstracts you, the programmer, from the underlying tables that need to be updated.  If you are handling multiple business objects you would need to wrap the transaction with the StartTransaction - EndTransaction methods.  This information is detailed in the SAP Business One SDK Help Center that comes with the SDK.
    HTH,
    Eddy

  • Problem retrieving Data from a CDATA-Section using XMLDOM

    Hello,
    Ware: Oracle 8.1.7.4 64bit, XDK for PL/SQL Version 9.2.0.3, Solaris8 64bit
    I can't retrieve Data from the CDATA-Section of an XML-String, neither with
    getData(DOMCharacterData) or substringData. Also getLength fails. I get always
    the following error:
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.ClassCastException
    ORA-06512: at "XML_SCHEMA.XMLCHARDATACOVER", line 0
    ORA-06512: at "XML_SCHEMA.XMLDOM", line 853
    ORA-06512: at "SCHWABE.XML_TEST", line 47
    ORA-06512: at line 1
    I can successfully cast the DOMNode to a CharacterData with makeCharacterData
    and check with isNull (DOMCharacterData) (returns FALSE).
    My Testcase:
    1) A Function which build a XML-Document:
    CREATE OR REPLACE FUNCTION XML_ResponseCalc RETURN VARCHAR2 IS
    doc VARCHAR2(32767);
    BEGIN
    doc :=
    '<?xml version="1.0" encoding="UTF-8"?>
    <RSDecEng>
    <Version>1.00</Version>
    <ResponseCalc>
    <ID>00000000000000000014</ID>
    <Burst>
    <Definition>
    <Count>1</Count>
    <ID>
    <Start>1</Start>
    <Length>4</Length>
    </ID>
    <Var>
    <Name>Risiko_1</Name>
    <Start>5</Start>
    <Length>5</Length>
    </Var>
    </Definition>
    <Data>
    <Length>9</Length>
    <Count>5</Count>
    <![CDATA[
    1 0.001
    2 0.002
    3 0.003
    4 0.004
    5 0.005
    6 0.006
    7 0.007
    8 0.008
    9 0.009
    10 0.010
    ]]>
    </Data>
    </Burst>
    </ResponseCalc>
    </RSDecEng>
    2) The Procedure which parses the XML-Document (no Exception-Handling):
    CREATE OR REPLACE PROCEDURE XML_TEST IS
    Parser XML_SCHEMA.XMLParser.Parser;
    DOMDocument XML_SCHEMA.XMLDOM.DOMDocument;
    DOMNode XML_SCHEMA.XMLDOM.DOMNode;
    DOMNodeItem XML_SCHEMA.XMLDOM.DOMNode;
    DOMNodeList XML_SCHEMA.XMLDOM.DOMNodeList;
    DOMCharacterData XML_SCHEMA.XMLDOM.DOMCharacterData;
    TheDocument CLOB;
    ID VARCHAR2(100);
    Data VARCHAR2(200);
    BEGIN
    -- LOB
    DBMS_LOB.CREATETEMPORARY(TheDocument, TRUE);
    DBMS_LOB.WRITEAPPEND(TheDocument, LENGTH(XML_ResponseCalc), XML_ResponseCalc);
    -- Parse
    Parser := XML_SCHEMA.XMLParser.NewParser;
    XML_SCHEMA.XMLParser.ParseCLOB(Parser, TheDocument);
    DOMDocument := XML_SCHEMA.XMLParser.GetDocument(Parser);
    XML_SCHEMA.XMLParser.FreeParser(Parser);
    -- Node
    DOMNode := XML_SCHEMA.XMLDOM.MakeNode(DOMDocument);
    -- Get ID
    DOMNodeList := XML_SCHEMA.XSLProcessor.SelectNodes
    (DOMNode,'/RSDecEng/ResponseCalc/ID/text()');
    IF XML_SCHEMA.XMLDOM.GetLength(DOMNodeList) > 0 THEN
    DOMNodeItem := XML_SCHEMA.XMLDOM.Item(DOMNodeList, 0);
    XML_SCHEMA.XMLDOM.WriteToBuffer(DOMNodeItem, ID);
    SYS.DBMS_OUTPUT.PUT_LINE ('ID: '||ID);
    END IF;
    -- Get CDATA
    DOMCharacterData := XML_SCHEMA.XMLDOM.MakeCharacterData(DomNode); -- <-- ok here...
    IF NOT XML_SCHEMA.XMLDOM.isNull (DOMCharacterData) THEN -- <-- ...and here
    Data := XML_SCHEMA.XMLDOM.GETDATA(DOMCharacterData); -- <-- ...but here Exception raise
    END IF;
    END;
    I hope you can help me.
    Thank you in advance
    Markus Schwabe

    You need to notice the definitions for makecharacterdata:
    FUNCTION makeCharacterData(n DOMNode) RETURN DOMCharacterData;
    PURPOSE
    Casts given DOMNode to a DOMCharacterData
    It only do the casting.

  • Cannot connect to database using SQL Developer

    Ok. Here are the facts:
    1) I can connect to the database using PL/SQL Developer.
    2) I wanted to try SQL Developer and I am unable to connect to the same database with SQL Developer. I provide username and password and select "network alias" and click test and I get "Network adaptor could not be established"
    3) TNS names.ora file resides on a mapped drive which clearly is accessible by PL/SQL developer but not by SQL developer.
    What am i missing?
    Thanks a lot

    If you can select a network alias, then sqldeveloper has found your tnsnames and the problem lies elsewhere.
    Is the network drive specified by a UNC? SQLDeveloper doesn't work well with unc names.

  • Failing to send and retrieve data from HTML page to BPEL

    once i have the html form ready, which 'onSubmit' calls the BPEL process, i am unable to send the data to the process and thereafter i m unable to retrieve the data send by the html form... Want to know how can i use the HTML form to send data and then retrieve data back from the BPEL process
    Rohit Jain

    There is an example showing this, it can be found under /samples/tutorials/102.InvokingProcesses/jsp/invokeCreditRatingService.html
    hth clemens

  • Writing and Retrieving data from an Excel spreadsheet

    Hi all
    I am working on some battery chargers and need to record the data from my DAQ to an Excel Spreadsheet. How do i do that?
    I don't wanna purchase the Office toolkit from Labview!
    Please Help!
    RJ

    Hi smercurio_fc
    Hi Smercurio_fc,
    Thanks for the reply. I really appreciate your help.
    However, I would like to point out that after making numerous searches, I could not get any VI or thread working for my case. Most of the files complain regarding any of their missing sub-VI(s).
    I myself don't understand the problem. I have even re-installed the application to shoot any of the possible installation errors. I m not a spammer.
    I'll try to do what you have suggested in the former part of your reply.
    Regards,
    RJ

  • How to create web part and retrieve data from a scheduled task?

    Hi,
    I am new to SP, so I think you can guide me. I have  a scheduled task which gets currency data. I wonder if there is  way to show them on a web part. There will be currnecy names, buy and sell data on this web part. I would be glad if you can show
    me step by step how to create this web part on SP.
    Thanks in advance.
    Best Regards.

    Hi,
    thanks for the reply so I advice on that case to write code in the task schedule to write the data into a SharePoint list, if the scheduled task is on the same server as SharePoint then use Object model if it on another server then use client object model
    to write data to a list
    then on SharePoint site you will just add out of the box web part to display the list where you stored the data
    to save data using Object model:
    http://msdn.microsoft.com/en-us/library/office/ms467435(v=office.14).aspx
    http://www.go4sharepoint.com/Code/insert-list-item-sharepoint-object-286.aspx
    to save data using client object model
    http://www.codeproject.com/Articles/268196/SharePoint-Client-Object-Model
    Kind Regards,
    John Naguib
    Technical Consultant/Architect
    MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation
    Please remember to mark your question as answered if this solves your problem

Maybe you are looking for

  • Help me sync all my iPhone's tabs with Mac - beginning to despair!

    Hi, iPhone 4S 16GB, White, iOS 6.0.1; Mac Pro 2010, Mountain Lion 10.8.2 Supplemental Update 1.0; iTunes 10.7 (I am NOT upgrading to iTunes 11). I can't get all the aspects of my iPhone to sync with my Mac Pro without receiving the dreaded, "Do you w

  • IPod Video not recognized by iTunes

    hello, I just got my iPod Video 60G. I currently have USB 1.1 as part of my computer. When I plug it in to any of those ports, iPod works fine. However, I decided to get a PCI USB 2.0 card so I can improve the performance of the iPod. When I plug the

  • Snow Leopard corrupted main Mac HD,..can't boot to it HELP Please!

    Boy did I have a day today!! A couple of days ago, I achieved and re-installed OSX 10.5. Upgraded to 10.5.8. Then, I installed Snow Lep and upgraded to 10.6.2. Now, I did all of this in safe boot since at the time, my graphics card was broken. I got

  • UTL_FILE, Extra CRFL's, possible OS interpretation problem.

    Greetings, DISCLAIMER: I am an oracle noob so if I make a mistake in forum etiquette or have not checked all available documentation or have made an assumption that is incorrect ( or noobish ) or am unaware of a tool better suited to the task I am tr

  • How do I eliminate the "community Toolbar" compatibility notice/error??

    Hi everyone!  Thanks for reading and I look foreward to all useful suggestions!  My situation: With Safari running... 5.1.7 (but even on 5.1.6)  at some point i downloaded or installed some "community toolbar....i imagine it was a throw in with some