Utf8 script and sqlplus

Hello.
Try to use sql script in utf8 encoding to run from sqlplusw oracle 9201 win. Database encoding is BLT8MSWIN1257, client registry contatins the same BLT8MSWIN1257
SQL> @c:\temp\db\define.sql -- file define.sql has UTF8 encoding
SP2-0734: unknown command beginning "-- Пе..." - rest of line ignored.
Is it because of non-utf8 database encoding or sqlplusw does not read utf8 files at all?
Regards, Dmitry

Dont know whether sqlplusw supports utf-8, but if the input really is in this encoding I would set nls_lang=.UTF8 (no dash). This would, in theory, tell Sql*plus that your terminal or files uses utf-8.
Note that with a setup you describe, with client side and database using the same character set, called passed-through setup, you have to make sure that characters really conform to win-1257. Any invalid characters will be incorrectly stored in the database. Storing multi-byte characters in this case, would be one example where things could go wrong.

Similar Messages

  • Unix script and sqlplus statements

    I have a unix file which contains sql statements. Included is the sqlplus statement to log on to the database with the username and password: xxxxx/xxxxxx@sid<<EOF
    When I run the unix file from my command line outside of sql, it runs successfully. When I attempt to run the same file in a cron job, I receive the message, sqlplus: not found.
    How can I run this unix file in a cron job? Is something else needed?
    Thank you,
    GD

    When I log to unix with the root password and issue:
    01 9 23 4 3 su - xx -c ". /home/xx/.profile;/home/xx/test.sh"
    The test.sh script executes successfully.
    When I log on with my userid and put the line in a crontab, I receive the following:
    Your "cron" job on yyy1
    su - xx -c ". /home/xx/.profile;/home/xx/test.sh"
    produced the following output:
    su: Sorry
    If cron is run by ROOT, shouldn't I get the same results?
    GD

  • Report Script and UTF8 in 9.3.1

    Hi guys, I have an issue with report scripts and UTF8 in 9.3.1.
    Basically my problem is that if I run the RS from EAS, the output is a txt file in UTF8.
    If I run it through Esscmd, the output is a ANSI txt.
    I need to info to load a non UTF Cube.
    I use English/Latin1 locale, the same settings I used in 9.2. In fact is the same RS, but now it acts weird.
    I have this problem in 2 different clients using 9.3.1.
    Any suggestion?
    The Essbases servers are Non unicode

    Thanks, I know that they should export to the local format of the client. That is the weird stuff, because, as I understand the ouput should be the same if I run it through EAS and if I use Esscmd from the same machine.
    When I used MaxL it also export in UTF8. I have only tried MaxL through EAS, so I don't know if I run it through the command line if it will export in UTF8.
    We use Non unicode basically because we have had some problems with Planning and some character set in previous releases and to keep it simple.

  • Oracle Client and SqlPlus on Mac Os X Leopard Configuration Script

    Hello,
    I have just written 2 bash scripts for the installation and configuration of SqlPlus and the Oracle Client v10.2.
    The first script MacSqlPlus.sh install the client set the environment variables, the second TNSconnectMac.sh help to configure the tnsnames.ora. They can be found here
    http://www.danilovizzarro.it/script/MacSqlPlus.sh
    http://www.danilovizzarro.it/script/TNSconnectMac.sh
    In order to have them working it's required to download the oracle client basic lite and SqlPlus in the /var/root directory.
    A step-by-step tutorial can be found here http://www.danilovizzarro.it/?p=10
    Soon I will try to upload a demonstration video.
    Your comments are always appreciated.
    BR
    DV

    Doug,
    It is possible that there could be data corruption, because this is not a tested, thus not supported, setup. I hope that helps!

  • 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

  • Passing params from SQL file to Shell Script and then from Shell to SQL Fil

    Afternoon guys,
    Have a fun question for all you gurus in shell scripting out there. I have a shell script that is calling 2
    different SQL programs. My objective is to pass a variable called request_number from one sql program
    to the shell script and then from the shell script back to another SQL program. I will explain why I
    need this to happen.
    Here is what the shell script looks like which calls sql programs student_load_a.sql and
    student_load_b.sql. Student_load_a.sql basically creates the control file (.ctl) which is needed for the
    SQL*Loader and then student_load_b.sql reads the table that was just loaded and does the main
    processing. My main objective here is to be passing the request_number which is being generated
    using an Oracle Sequence in student_load_a.sql and using this generated number in my main
    processing in student_load_b.sql to select records from the table based on request_number.
    Any ideas ?Any help or recommendations is welcome and appreciated.
    *1. Shell Script*
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    # Create control files for sqlload
    sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_a.sql $p_job_id
    exit_status=$?
    # Do sqlloads
    sdesqlldr.exe userid=$p_user_id control=student_load-$p_job_id.ctl \
                                                 log=student_load-$p_job_id.log \
                                                 bad=student_load-$p_job_id.bad
    exit_status=$?
    # Main processing
    # sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id $p_request_number
    sqlplus.exe -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id
    exit_status=$?
    exit 0*2. student_load_a.sql (Would like to pass back the Sequence Number back to shell script and then use in student_load_b.sql*
    -- Accept system input parameters
    define p_job_id = &1
    spool student_load-$p_job_id.ctl
    select
    'append into table TMP_STUDENT_LOAD
    FIELDS TERMINATED BY '','' optionally enclosed by ''"''
    trailing nullcols
    (request_number CONSTANT ' || '''' || request_number_seq.nextval || ''',
    student_id)'
    from   dual
    spool off;
    exit 0;
    {code}
    *3. student_load_b.sql (This is a big file so I am only adding code that is relevant for the SQL)*
    {code}
    declare
      v_request_number    number(6);
      v_student_id                  number(7);
      cursor cur_student_load is
        select  student_id
        from   TMP_STUDENT_LOAD
        where  request_number = v_request_number
        order by 1;
    begin
        v_user_id := '&1';
        v_job_id := &2;
        -- This is the variable I would like to be be passing from shell script to student_load_b.sql
        -- v_request_number = '&3';
         open  cur_student_load;
         fetch cur_student_load into v_student_id;
          exit when cur_student_load%notfound;
          .... more logic of if then else in here
         close cur_student_load;
    end;
    {code}
    Edited by: RDonASnowyDay on Jan 29, 2010 4:03 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    How come you are mixing WinDoze script (*.exe) with Unix?
    You are aware that you will be passing the password along with the user id to the second sql script?
    I will assume Unix ksh:
    # Accept system input parameters
    p_user_id=$1
    p_job_id=$2
    # Create control files for sqlload
    p_seqno=`sqlplus -s $p_user_id @$STUDENT_PATH/student_load_a.sql $p_job_id`
    exit_status=$?
    # Do sqlloads
    sqlldr userid=$p_user_id control=student_load-$p_job_id.ctl \
           log=student_load-$p_job_id.log \
           bad=student_load-$p_job_id.bad
    exit_status=$?
    # Main processing
    # sqlplus -s $p_user_id @$STUDENT_PATH/student_load_b.sql $p_user_id $p_job_id $p_request_number
    sqlplus -s $p_user_id @$STUDENT_PATH/student_load_b.sql \
               $p_user_id $p_job_id $p_seqno
    exit_status=$?
    exit 0And the first sql script would look like this:
    -- student_load_a.sql
    -- Accept system input parameters
    set echo off pages 0 feed off lin 80 trims on ver off
    def p_job_id = &1
    col seqno NEW_VALUE seqno
    select request_number_seq.nextval seqno from dual;
    set term off
    spool student_load-$p_job_id.ctl
    select
    'append into table TMP_STUDENT_LOAD
    FIELDS TERMINATED BY '','' optionally enclosed by ''"''
    trailing nullcols
    (request_number CONSTANT ''&&seqno'',
    student_id)'
    from   dual
    spool off;
    exit 0;
    {code}
    :p                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Scripts and Procedures

    Hello,
    I don't know if this question is appropriate for this forum,
    but how do you execute a sql procedure within a shell script and how to use pass the variables that are contained in your script to your procedure?

    fqman wrote:
    what are the &1 and &2 parameters?&1 and &2 are the parameters when you are using sqlplus
    like sqlplus script.sql parameter_one parameter_2
    Inside your script.sql you will refer these parameters as
    &1 and &2
    But for sh scripts you have to refer these as $1 and $2
    SS
    http://db-oracl.blogspot.com

  • Set up export script and how to run it. Oracle 10gR2

    Can someone help explain this script to a newbie. I need to write a script to export all data from our Oracle 10gR2 Tru64 Unix to another system. We need to test how long a 200GB tablespace export will take writing directly to nfs mount on SAN.
    1. The only option we have is to use a NFS Mount to the new SAN. ( there is no space on our existing system)
    2. What needs to be declared to describe the environment in both Oracle and/or in the script to make it run?
    3. Do I need to tell Oracle where the export directory is? (NFS Mount).
    4. how is exp run? Do dba run via a XXX.sh script or SQLPLUS XXX.sql script?
    5. how can I check the progress....
    I don't understand the set up of the oracle environment lines, can someone help me?
    Here is a sample script I found on our system....
    1 #!/bin/sh
    2 # /usr/users/oracle/nfsoraexpt_linux.sh
    3 # Export up the specified instance of the db tar it to an nfs mount point and log it
    4
    5 # Set up the oracle instance and environment
    6
    7 ORACLE_SID=pdsprod; export ORACLE_SID
    8
    9 ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1; export ORACLE_HOME
    10 PATH=/usr/bin:/u01/app/oracle/product/10.2.0/db_1/bin:/apg/0800/mercator:/usr/users/oracle/bin:.; export PATH
    11
    12 # Do logging and export the instance
    13 rm /nfs_dir/oraexpt.log
    14 echo `date` >> /nfs_dir/oraexpt.log
    15 exp user/password file='/nfs_dir/pdsprod.exp' log='/nfs_dir/pdsprodexp.log' full=y direct=y feedback=5000000
    16 #exp user/password file='/nfs_dir/pdsprod.exp' log='/nfs_dir/pdsprodexp.log' tablespace='ENC_DS_DATA' direct=y feedback=5000000
    17 cat /nfs_dir/pdsprodexp.log >> /nfs_dir/oraexpt.log; rm /nfs_dir/pdsprodexp.log
    18
    19 echo `date` >> /nfs_dir/oraexpt.log
    20 cd /nfs_dir
    21 # gzip -f pdsprod.exp
    22 ls -al pdsprod.exp >> oraexpt.log
    23 mail -r email email2 < /nfs_dir/oraexpt.log
    24
    Any help for this first time user would be appreciated. Thanks

    First it sets some environment variables in the shell.
    Then it removes a log file.
    Then it uses an obsolete tool to export some data.
    Then it displays the contents of the log file.
    Then it changes the present working directory.
    Then it lists the files in the directory.
    Then, presumably, it emails a copy of the log file somewhere.
    In 10gR2 I would suggest throwing it away and using a proper tool to do the job such as RMAN or DataPump.
    Additionally find someone to teach you how to navigate and perform basic tasks in Linux. This may help.
    http://www.psoug.org/reference/unix_vi.html
    as might Arup Nanda's excellent tutorial here:
    http://www.oracle.com/technology/pub/articles/advanced-linux-commands/part1.html

  • DOS and sqlplus issue

    Hi,
    I have the below dos batch file which extracts some file value(always return some value) and trying to print this.but this giving me o/p as
    ECHO is on.
    Can any guys help me out on this urgently...
    set lcl=
    for /f %%i in ('sqlplus -s usr/pwd@tst
    @D:\tst\Purge_Utility\qt_counter.sql') do set lcl=%lcl% %%i
    echo %lcl%
    regards
    AbdulWahab

    Hi,
    This is the complete dos script,and the qt_counter.sql returns a value 100 which i am trying to display as a o/p.but the o/p comes as ECHO ON.
    set lcl=
    for /f %%i in ('sqlplus -s usr/pwd@tst @D:\tst\Purge_Utility\qt_counter.sql') do set lcl=%lcl% %%i
    echo %lcl%
    regards
    AbdulWahab

  • Run large script in sqlplus

    Dears,
    When i ran large script using sqlplus this error happened "ORA-06550: line 16370, column 2: PLS-00123: program too large (Diana nodes)" and please i need solution to run this script.
    the size of script is 17MB
    thanx
    Edited by: user12059086 on Oct 14, 2009 2:38 AM

    user12059086 wrote:
    this is first line from script:
    DECLARE
         cid int;
    begin
         select id into cid from country where countrynum = '110';
         insert into location(CountryID, CountryNum, LocationNum, LocationName)
         values (cid,'110','11000001','Antigua and Barbuda');
    the script has 461059 lines... :(Ouch.
    This is exactly not the way to load large volumes of data into Oracle. if the script actually ran it would probably kill the database due to over parsing never mind the performance of executing hundreds of thousands of individual insert statements to perform a bulk load.
    As already suggested get the data in a format that can be loaded by external tables or SQL loader.
    I'd link to the docs for those but they don't seem to responding at the moment.

  • What is the diff b/w Sap Scripts and Smart Forms

    Hi,
          Whats the diff b/w SAP Scripts and Smart Forms..
             I need the internal explanation for both Smart Forms and SAP Scripts mean when we execute what happens whether Print Program r Forms starts execution 1st  and SIMILARLY FOR SMARTFORMS WHETHER FM'S  R FORMS.
    Thanks & Regards,
    Gopi.

    Hi
    Difference with SMARTFORMS vs. SapScript(SE71)
    The Following are the differences :-
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Labels cannot be created in smartforms.
    d) Routines can be written in smartforms tool.
    e) Smartforms generates a function module when activated.
    f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk.
    It was said that it was provided in CRM 3.0 version, but not available in R/3. You can download smartforms into Local PC in a XML format. In the same way you can upload this XML format into Smartform. From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment.
    In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
    In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk.
    For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people. What you can do is to create a Transport and then FTP down to your local harddisk. When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server. Finally, the Basis team, will tp it into your system.
    g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it. Actually, there is something you can do about it. By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
    check out this link:
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Reward points if helpful.
    Regards,
    Swathi.

  • Mail attachment: difference between script and app bundle?

    Hiya Folks,
    I am trying to make an application in Applescript that will receive a file, then create a new email (in Mail.app) with that file attached. I would prefer it to be an app, rather than a script when it's finished. I have a script that appears to work.
    This simple script will put up a Choose File window asking for a file, then bring Mail to the front and create a new message, with the selected file attached (it won't send it). For debugging, I made a dialog box pop up showing the path to the file selected:
    -- begin script
    set OpenedFile to choose file
    display dialog "OpenedFile: " & OpenedFile
    tell application "Mail"
    activate
    set newMessage to make new outgoing message with properties {subject:"Subject", content:"Content"}
    tell newMessage
    set visible to true
    tell content
    make new attachment with properties {file name:OpenedFile} at after the last paragraph
    end tell
    end tell
    end tell
    -- end script
    So I tried to make that into an app onto which I could drag n drop a file, and have Mail make a new message with that file attached. Try saving this following script as an Application or an Application Bundle:
    -- begin script
    on open OpenedFile
    display dialog "OpenedFile: " & OpenedFile
    tell application "Mail"
    activate
    set newMessage to make new outgoing message with properties {subject:"Subject", content:"Content"}
    tell newMessage
    set visible to true
    tell content
    make new attachment with properties {file name:OpenedFile} at after the last paragraph
    end tell
    end tell
    end tell
    end open
    -- end script
    Run the first script as a script, and it works as advertised. Drag a file onto the second script saved as an app, and the message is created, but no attachment.
    Note that the path displayed in the pop-up is the same for both scripts.
    Anybody know what I'm doing wrong?
    Thanks for your help,
    Drewstre

    on open (dragged_items)
    my handleFiles(draggeditems) -- Send selected items to custom handler.
    end open
    on handleFiles(localItems)
    tell application "Mail" -- Use terms of 'Mail'
    activate -- Launch 'Mail'.
    -- Add text to 'Subject' and 'Message' fields.
    set newMessage to make new outgoing message with properties {subject:"Subject", content:"Content"}
    tell newMessage -- Set focus to 'newMessage'
    set visible to true -- Make message visible.
    repeat with i in local_Items -- Cycle through the dragged items, adding each to new message.
    tell content to make new attachment with properties {file name:i} at after the last paragraph
    end repeat
    end tell
    end tell
    end handle_Files
      Mac OS X (10.4.4)  

  • I am trying to load a 2006 package in cd form onto my apple mac when I try and down load it it comes up in like foreign script, and says does not operate dos, can anyone help I am a lot of a novice. grateful - Carol

    Yes Im a lot of a novice so be patient with me lol I am trying to put a 2006 Edition of a weight programme on my laptop, but when I down load it it just comes up in weird script and says cannot operate in Dos mode can anyone help.
    Thanks

    Welcome to Apple Support Communities.
    Sounds like you have a program designed to run on Microsoft Windows, or even older (1980's) MS-DOS, rather than Mac OS X. If you have Windows on your Mac installed via Boot Camp, try booting into Windows first, and then loading the CD.  If you don't have Windows, it's probably cheaper to buy a new program designed for Mac than to purchase a copy of Windows (US$120 or more), not even knowing for certain if your old program will run.

  • How to change the Default login script and the USER login script in Netware3.12

    I need to cut down the disk map from Neware 3.12 in Win98 client's PC.
    please tell me
    how to change the Default login script and the USER login script in
    Netware3.12 ?
    Or is there any other ways to do this thing?
    Thanks a lot!

    On 4/6/2006 [email protected] wrote:
    > how to change the Default login script and the USER login script in
    > Netware3.12 ?
    Please repost in the discontinued.forums.
    Edison Ortiz
    Novell Product Support Forum SysOp
    (No Email Support, Thanks !)

  • Downloading 4.0 onto XP it takes a long conection process, with boxes on unresponsive script and a java scipt app saying type error and is all very annoying so what can I do I want the old firefox back a

    I downloaded Firefox 4.0 replacing an earlier Firefox version. I have XP on my computer. When I now click on the Firefox icon after a time a window saying Unresponsive script and underneath script chrome etc comes up. I then press stop script and another window comes up Java Script application and type error. Eventually I get on to the internet but it's all very frustrating. I wish I had ignored the request to download 4.0
    Please help

    I can assure you that the sympton is indeed identical. For as the computer got worse, eventually it refused to start up and made 3 beeps. It has done this before, but today more times than before (just like when it first had this problem). Where-ever you go on the internet, it will tell you that the 3 beeps suggest the RAM is at fault. So, the same 3 beeps, means the same problem, which is the RAM.
    With that in mind, I re-ask my question with the same reasoning and justification; am I still covered under warranty? (Reasoning/Justification: Considering the original problem was not entirely fixed, though something else was to make the MacBook Pro last a little longer before the reoccurance of this problem).

Maybe you are looking for

  • Partial delivery of PO in 3rd party sales

    These are open-end questions frm a student in SAP SD.. 1. Can the customer be invoiced if the vendor does a partial delivery of the customers order ? If so, how is it done & what are the procedure for the same ? Or shd we wait till the vendor deliver

  • Critical CoreDumps in our Application Servers with Coherence

    Dear Support team, We are facing few issues with our C++ AppServer binary which are Coherence enabled. We are using the libcoherence.so provided by Oracle. We find the dumps are occuring only when Coherence is enabled and our binary looks good when C

  • How to deploy site collection has sub sites to other environments

    Hello everybody, I have a site collection SharePoint online. In the site, haven 3 sub sites. Now, i want to deploy this site to other environment, How can i do that? I am trying save site as template but that is not support sub site. Thanks and best

  • Parameter default value different for clients...

    I have problem how to set that in client 010 the flag default 'X' will be automaticaly set, and for all other clients this parameter is without flag default ' '. Current situation: PARAMETERS: p_test TYPE xfeld AS CHECKBOX DEFAULT 'X' MODIF ID GVA. i

  • Win 7 ie 9 and 10 flash player not working even after reinstall

    I was running ie 10 and flash worked fine, then it quit. i tried to reinstall, i tried to uninstall and reinstall, tried as a different user. the install performs without error but flash isnt present. when i try to enable it, it isnt in the list. dow