1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

sqlplus multybyte

Discussion in 'SQL PL/SQL' started by jpdelage, Dec 19, 2014.

  1. jpdelage

    jpdelage Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    HI,

    I need to create an insert statement that will have multibyte characters as value and run it in sqlplus;

    ex: Insert into (col1,col2)) values (1,'Критерии'); -- this is Russian

    can this be done using SQLPLUS ?

    Tks

    JP
     
  2. ocprep

    ocprep Forum Advisor

    Messages:
    277
    Likes Received:
    76
    Trophy Points:
    410
    Location:
    Orlando, Florida
    If the database is using a character set that supports those characters -- certainly.
    If it is using a character set that does not -- no.

    Oracle recommends AL32UTF8 for database installations in general. It will support multi-byte character sets. You can determine the the NLS_CHARACTERSET with the following query:

    SELECT * FROM NLS_DATABASE_PARAMETERS;
     
  3. jpdelage

    jpdelage Active Member

    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    55
    Hi Matthew,

    Tks for the response.

    Let me elaborate a bit more on the situation.
    I am using the Database Export tool in SQL Developer to extract all DMLs from a particular schema, lets say "Scott", for Database DB#1
    I then want to run the produced script on DB#2 to populate the Scott schema there. (DDL script ran earlyer and works fine)

    Note that I can not use expdp/impdp in this case.

    When exporting the DMLs, I select the "insert" format and "UTF-8" encoding in SQL Developer tool.

    The produced file is not consistent from try to try.
    sometimes I get
    Insert into table1(col1,col2,col3) values (1,2,'Критерии');
    and then a also get
    Insert into table1(col1,col2,col3) values (1,2,'Критерии');
    this is the same row from to exports done one after the other with the same parameters in SQL Developer.

    that said, if I try to execute Insert into table1(col1,col2,col3) values (1,2,'Критерии'); in DB#2, I get only "????????" instead of "Критерии"


    I ran the proposed query on both databases and the result is the same

    NLS_CHARACTERSET AL32UTF8

    Coul it be that I need to modify the character set on my Windows desktop to produce the script with good encoding ?
    The produced script will then need to be run on a Linux box... anything to modify there also ?

    ouf !!!!!
     
  4. ocprep

    ocprep Forum Advisor

    Messages:
    277
    Likes Received:
    76
    Trophy Points:
    410
    Location:
    Orlando, Florida
    If you are saying that on one export you get output 1 and a couple of minutes later doing the exact same thing with no change to the database you get output 2, then this would essentially have to be a bug in SQL*Developer. The same set of actions should give consistently the same set of results.

    Are all of the NLS language parameters consistent between the two databases (i.e. not just the character set)?