Spool Russian Characters from a unix(AIX) sql script

Hi All,
I have a problem selecting and spooling a column whose characters are in russian to a flat file. If I use oracle sql developer, the data comes out right, e.g
Р-Н ТАШКЕНТ
However is i try to run the same select from a unix sql script and spool the results, I get some gibberish like:
ò-î ôáûëåîô or a chain of question marks ?????????
select * from nls_database_parameters gives:
NLS_LANGUAGE=AMERICAN
NLS_TERRITORY=AMERICA
NLS_CHARACTERSET=UTF8
NLS_NCHAR_CHARACTERSET=AL16UTF16
I have tried exporting the environment variable using these various options individially to no avail:
export NLS_LANG=RUSSIAN_CIS.CL8MSWIN1251
RUSSIAN_RUSSIA.RU8PC866
RUSSIAN_RUSSIA.CL8KOI8R
RUSSIAN_RUSSIA.CL8MACCYRILLICS
RUSSIAN_RUSSIA.RU8PC855
RUSSIAN_RUSSIA.RU8BESTA
RUSSIAN_RUSSIA.CL8ISO8859P5
Please help.
Thanks,
Edited by: HouseofHunger on Apr 12, 2012 4:02 PM

Os version: AIX 6.1.0.0
Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit
with the default values for NLS_LANG, I run sqlplus
sqlplus user/password@oracle_sid
select column_name from table_name;
and the output is:
column_name
I exit and export NLS_LANG=RUSSIAN_CIS.CL8ISO8859P5
go back into sqlplus and run the same query as above, and the output is
column_name
À-½ °Ⱥµ½Â
À-¾½ ÃÀ°ǸÀǸºÁº¸¹
°Ⱥµ½Â
°Ⱥµ½Â
¾»Â¸½¾¹ À-¾½
³ ±µº°±°´
ΠǸÀǸºÁº¸¹ À-½ ÷±µº¸ÁÂ
Ä°À³¾½°
Ϻº°Á°À°¹Áº¸¹
°Ⱥµ½Â
Á°¼°Àº°½´
So it seems the output I get is somehow influenced by the value of environment variable NLS_LANG, so it may be that either I need the correct value for this environment variable or I need some config on the OS level.....?
Also the command locale -a gives following output - I am not very good on locales, so it maybe that the russian local isn't installed...?
$ locale -a
C
POSIX
en_US.8859-15
en_US.ISO8859-1
en_US
Thanks

Similar Messages

  • How to pass a value of 130 odd characters from a subroutine to a script

    Hi Friends,
    I am passing a value of 130 odd characters(say) from subroutine to script through ITCSY structure (VALUE- 255 characters), however, while debugging the script I find that the whole length is not getting passed into the script.
    Is this a limitation, or is there any solution to this?
    Thanks and Regards,
    Birendra Chatterjee

    Hi,
    Check the size of that Window in which you are displaying this Text of 130 characters.
    May be it is less
    in that case split that string into 2 strings and pass the two strings from ITCSY structure to script and use.
    reward if useful
    regards,
    ANJI

  • Execute SQL scripts in Oracle DB

    Hi ,
    Can someone give stepbystep flow to execute sql scripts(patches) in oracle db on unix server.

    SQL scripts and patches are generally two completely different things.
    Assuming you are referring to patches that you download from My Oracle Support (MOS), each patch and patchset comes with a README. That README has specific instructions for installing that particular patch in whatever version of Oracle you have running on whatever operating system you have with whatever database options you have in use. It wouldn't make sense to try to summarize that document here-- we would undoubtedly leave something out that may be important to you and there may be patch-specific instructions.
    Justin

  • Replace Text In SQL Scripts

    Hi,
    I would like to search and replace text in files when I run .sql files.
    E.g. When user provide scripts xyz.sql, they would put table name like
    INSERT INTO  xyz abc VALUES ('text');I would like to replace xyz abc with mytablename.
    INSERT INTO  mytablename VALUES ('text');Besides, from the user provided sql scripts, they would be some junk create table scripts, I would like to comment off these junk table scripts.
    How could I do achieve the above?
    I would be calling user provided sql scripts from my sql scripts using @ ./data/temp.sql
    I am using oracle 8i for these. Any help is highly appreciable.
    Regards

    Sorry for not providing enough information.
    Oracle Version as follows:
           Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
         PL/SQL Release 8.1.7.4.0 - Production          OS:
    Windows XP SP2
    damorgan wrote:No clear description of what you are actually trying to do ... for example where does "mytablename" come from, where does "xyz" come from, how is the decision to be made? Based on what logic?
    These scripts are provided by customers where they use other database like sysbase to generate sql scripts and customers are not in a position to change or alter the scripts as these scripts are part of the solution provided by vendors(legacy systems)
    I have mapping sql script where table name is e.g. xyz abc then use script TS2 and process the customer given sql script.
    Let me know if I am missing out any other information.
    Regards

  • Calling a PL SQL script

    Hi, is it possible to call a pl sql script from within another pl sql script. I wanted to created a function or a procedures but turns out that I'm not allowed to in my organization.
    Thank you

    SeanMacGC wrote:
    BluShadow wrote:
    I take it your organization doesn't expect you to do much work then. What a stupid limitation.All in the name of 'Database Independence' or to be 'Database Agnostic' no doubt, the first to put humans on Mars they won't be! ;-)LOL!
    All attempts I've ever seen by people to write completely generic solutions (whether database generic or application generic) have resulted in unmaintainable code that performs slower than you could do it by hand).

  • 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

  • Replacing a set of characters from a string in oracle sql query

    I want to replace a set of characters ( ~    !     @    #     $     %     ^     *     /     \     +    :    ;    |     <     >     ?    _  ,) from a STRING in sql
    select 'TESTING ! ABC 123 #'
    FROM DUAL;
    What is the best way to do it? Please provide examples also.

    What is your expected output... The query I posted just removes them, it never replaces them with spaces..your string already has space.. if you want to remove space as well .. try this...
    SELECT TRANSLATE ('TESTING ! ABC 123 #', '-~!@#$%^*/\+:;|<>?_, ', ' ') FROM DUAL;
    Output:
    --TESTINGABC123
    Else post your expected output..
    Cheers,
    Manik.

  • Spool to Pdf the russian characters are grabled or merged

    Hi All,
    i have a requirement to created a delivery note in russian and convert the spool to pdf.till the print preview it is correct.once the spool is converted into pdf using standard report i am getting russian characters merged or grabbled,i tried changing the printer setting etc nothing works,please help me .
    Regards,
    Achu

    Hi,
    Please refer the following article :
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00adf4da-76f1-2910-43aa-81ad2a67332c
    Best regards,
    Prashant

  • How to remove the EOF characters 0d & 0a from the unix file

    Hi,
             We have a requirement in which the EOF (End of file) characters 0d & 0a needs to be removed from  the Unix file generated by an ABAP program. Any pointers/solutions will be highly appreciated.
    Regards,
    Anil

    UNix files do not have a 0d and 0a end of line, they only have 0a as line terminator.
    In general, unix files do not have a end of file character (^Z).
    If you do not want to have several lines, dont write several lines, write all in one line using a string variable.

  • Migration from OS/400 (iseries) case in-sensitive OS to UNIX (AIX) case sensitive

    Apparently as400 is not case sensitive OS, AIX is so this is causing issues after the migration to UNIX (AIX).  What do you recommend for analysis of what will need correction in SAP system - config / tables entries / variants / code?  Is there a way to make UNIX files case insensitive?

    Hi Vinoth,
    Source System:
    SAP Application:     Solution Manager 7.1
    Database          :     DB2 UDB for iseries 7.1
    OS                   :     OS/400
    Target System:
    SAP Application:     Solution Manager 7.1
    Database          :     DB2 LUW 9.7
    OS                   :     Rethat Linux 6
    Above migration path is possible and support in SAP. For more details on compatibility please refer PAM www.service.sap.com/PAM
    To perform this migration refer to Heterogenous system copy guide available at SAP service marketplace.
    Useful documents on SCN
    Heterogeneous ABAP System Copy - Technical Overview
    FAQ - System Copy and Migration
    Hope this helps.
    Regards,
    Deepak Kori

  • Runtime error while connecting from SAP to MS-SQL DB

    Hi,
    I am writing a program to send data from SAP to MS SQL DB.
    The stored procedure when run alone works fine.
    I have defined connection 'C04' in DBCO with correct attributes.
    But the 'CONNECT TO C04' statement gives me runtime error DBIF_DSQL2_CONNECTERR saying that 'Connection to Database system with the identifier C04 is not possible;.
    First of all, I am not very clear if it is a ABAP problem or BASIS problem.
    I did a lot of research but could not find a solution.
    Please help me.
    Thanks & Regards,
    Shubha.

    Hi shubha,
    1. If your application server
       is unix/aix,
       then connection to MSSQL db
       is not possible.
    (Bcos both OS are different,
      and the connector is not provided
      by sap / not available)
    2. After making an entry in DBCON Table,
       probably something may be required to
       be done on the application server,
       by the basis team.
    3. If this connection is required
       to be made to oracle server,
       then basis definitely requires
       to make a connection string
       on the application server
       (apart from the dbcon entry)
    regards,
    amit m.

  • Using Oralce with Unix (AIX)

    My firm have now started to give me exposure to administering the 9i database using Unix (AIX).
    I have no prior understanding and I know this will take time.
    I need to get up to speed.. I have 9i installed on my machine at home - can I somehow download AIX at home and simply practice there?
    Yes, its a newb question!
    Thanks.
    DA

    Dan,
    As someone said before in an earlier posting, if you are just trying to get to know Oracle then you can pretty much do everything using any version of Oracle it could be Windows or Unix or Linux. The differences come into play for the setup and other similar things you have to do from a OS command line. However, if you are looking to use sqlplus to access the database and just concentrating on commands in sql then you don't need to worry about Unix vs Windows vs Linux so much.
    You can connect to any database that you have network connectivity to and that has the correct PORTs open. However, this will take some setup to accomplish.
    I would advise working through the 2-Day DBA guide that you can find here:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14196.pdf
    I would also look at the Oracle By Examples found here:
    http://www.oracle.com/technology/obe/10gr2_2day_dba/index.html
    which compliments the other guide.
    The reason that sqlplus can not be found is that it is not in your PATH. The easiest way I have found to setup an environment on a Unix system, is basically find someone's who's environment works (usually oracle) and then go through their .profile and .kshrc files and see what they are calling. Usually they reset their PATH variable at some point to include the Oracle bin directory.
    Someone in your organization should have the knowledge to setup the system to access sqlplus and other things you need. Again, if I had to do it myself I take a few hours to understand how an account like (oracle) is setup and try to set mine up similarly if not exactly the same.
    Regards
    Tim
    Good Luck, I know it is tough when you are just begining.

  • Selecting the first 4000 characters from a tag in an xml file

    Oracle Enterprise Edition 11.1.0.7 64 bit (Jan 2012 CPU applied)
    Windows 2003 64 bit
    We have an XML file with the following sample format.
    <?xml version="1.0"?>
    <HR>
    <EMP>
    <FNAME>JOHN</FNAME>
    <LNAME>DOE</LNAME>
    <COMMENT>Comment with less than 4000 characters</COMMENT>
    </EMP>
    <EMP>
    <FNAME>JANE</FNAME>
    <LNAME>DOE</LNAME>
    <COMMENT>Comment with more than 4000 characters</COMMENT>
    </EMP>
    </HR>
    The query below
    (full disclosure: which I took from odie_63's response in Creating External Table using Xml Dataset - how to include null values? and added the CURSOR_SHARING_EXACT hint on the top)
    works when the contents of the <Comment> tag are smaller than 4000 characters. If it is more than 4000 I get
    ORA-01706: user function result value was too large
    SELECT /*+ CURSOR_SHARING_EXACT */
    FROM XMLTable(
    '/HR/EMP'
    passing xmltype( bfilename('DATA_PUMP_DIR','emp.xml'), nls_charset_id('CHAR_CS') )
    columns
    first_name varchar2(30) path 'FNAME',
    last_name varchar2(30) path 'LNAME',
    comments varchar2(4000) path 'COMMENT'
    I found another query where someone was doing a substring (I think to get only the first 4000 characters from the tag) here.
    http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14638197 (See OP's post)
    TERMINATION_DATE VARCHAR(32) path 'TerminateDate/substring(text(), 1, 32)',
    So I updated my query to be
    SELECT /*+ CURSOR_SHARING_EXACT */
    FROM XMLTable(
    '/HR/EMP'
    passing xmltype( bfilename('DATA_PUMP_DIR','emp.xml'), nls_charset_id('CHAR_CS') )
    columns
    first_name varchar2(30) path 'FNAME',
    last_name varchar2(30) path 'LNAME',
    comments varchar2(4000) path 'COMMENT/substring(text(),1,4000)'
    The query runs without an error when the <comment> tag has 4000 or less characters but still errors out with it is more than 4000.
    I found an alternative method to do the SUBSTRING here in Herald ten Dam's reponse in Re: A view over XML that is not 1:1
    code varchar2(30) path 'substring(code,1,3)',
    so I tried this:
    SELECT /*+ CURSOR_SHARING_EXACT */
    FROM XMLTable(
    '/HR/EMP'
    passing xmltype( bfilename('DATA_PUMP_DIR','emp.xml'), nls_charset_id('CHAR_CS') )
    columns
    first_name varchar2(30) path 'FNAME',
    last_name varchar2(30) path 'LNAME',
    comments varchar2(4000) path 'substring(COMMENT,1,4000)'
    but that doesn't work either.
    How can I extract the first 4000 characters of the <COMMENT> tag so that the query doesn't fail.
    We are not using any other XMLDB features at this time. This is the first we've started looking into using Oracle built in XML features, so we might not have setup something that other's might know to specifically setup to start using the XML features in Oracle 11.1
    Thanks in advance,
    Wally

    walls99 wrote:
    This is regardless of the COMMENTS tag being 4000 characters or more and the same with the ideas from Odie.
    WallyNo idea if it is an issue with your version. I don't have your version to test but following works for me. Does this simple test work?
    SQL> select * from v$version ;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for Linux: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SQL> set define off
    SQL> select dbms_xmlgen.convert(xmlserialize(content xmltype('<brand>Ben &amp; Jerry</brand>') as clob), 1) from dual ;
    DBMS_XMLGEN.CONVERT(XMLSERIALIZE(CONTENTXMLTYPE('<BRAND>BEN&AMP;JERRY</BRAND>')A
    <brand>Ben & Jerry</brand>

  • Promt from user to proceed in case of error in sql script in sqlplus

    I am using Oracle 10g on Linux platform. I am executing a control.sql script from sqlplus from where i cam calling three *.sql scripts:
    control.sql
    SPOOL test.log
    SELECT 'Start of Control File at:'||systimestamp from dual;
    @00_create_table_scripts.sql
    @01_alter_table_scripts.sql
    @02_insert_scripts.sql
    SELECT 'End of Control File at:'||systimestamp from dual;
    SPOOL OFFI want that whenver there is an error in any of the three sql scripts, a prompt should be displayed asking the user if he wants to continue or not(Y/N). If he presses Y, then the remaining script shall be executed, otherwise execution should be stopped there.
    Can any body guide me how can i do this?
    Thanks.

    I want that whenver there is an error in any of the three sql scripts, a prompt should be displayed asking the user if he wants to continue or not(Y/N). If he presses Y, then the remaining script shall be executed, otherwise execution should be stopped there.If you have toad installed on your machine ,please run control.sql file from your machine .Toad will prompt an alert message saying that so and so error occurred and do you want to continue with that exception or not .
    Thanks,
    Prakash

  • File Content Conversion in Unix AIX

    Hi all,
    the XI was migrate from Windows System to Unix AIX system. All process are running fine, but I have some file adapter with content conversion and Unix system are put the hexa char '0A' in the end/break of line and in the Windows System put the hexa char '0D 0A'. With this other system that process these files not work properly.
    How I to solve this problem? It is a problem?
    thanks.

    I solved using endSeparator = '0x0D''nl'
    []s

Maybe you are looking for

  • Solaris 10 'su' failed

    I've installed a new Solaris 10 as the development platform. And I added the some packages from www.sunfreeware.com. Then, I found user could not use the 'su' command. Here is the dmesg. Dec 23 17:14:57 host su: [ID 401707 auth.error] open_module: /u

  • Contact person texts

    Hello, i have a view questions about the contact person texts in CRM: 1. Where in customizing can i add text-types which are only relevant for contact person (not BP general)? 2. How can i define the mapping from contact person text with R/3 (in the

  • I lost e-mails after synching to iCloud

    After synching to iCloud, I lost hundreds of e-mails in Smart Mailbox Folders. I do not have Time Machine. Any thoughts?

  • HT1338 Face Time connection problem

    I keep trying to use face time on my macbook pro and it keeps saying "the server encountered an error processing registration. Please try again later." it has said this since I bought it. My face time works fine on my phone and ipad. What should I do

  • How do you crop and save a cropped image

    How do you crop and save a cropped image in PS Touch?