Utl_file basics

hi,
i am running personal oracle 8i on a windows 98 pc.
i would like to use the utl_file function, but am not sure if it is installed or configured correctly. is there a way to verify this?
also, i don't think that the 'utl_file_dir = <dirname>' is specified in the init.ora file. is this absolutely necessary? if i add it in, it won't have any adverse effects will it?!?! i don't think it should, but would like confirmation for peace of mind.
i have spoken to someone previously, but they were not sure if utl_file package is supported in oracle 8i. is this true? if not, what versions is it available on?
once i have verified that utl_file is supported on personal oracle 8i, and that it is correctly configured, and the directory is specified in the init.ora file, will i then be able to use the package and put it in my code?
thanks,
dan

1) utl_file_dir must be specified in the init.ora file in order to use this feature. It makes sense, from a security point-of-view, that this parameter does not have a default setting (other than disabled). Setting utl_file_dir=* basically means that any directory can be accessed, but you certainly wouldn't want to do this in a production environment.
2) The directory you specify must be accessible by the O.S. account under which the Oracle database processes run. This is usually SYSTEM on Windows NT, or Oracle on UNIX. I don't think it really matters on Windows 98, which only has a fairly rudimentary security system - just make sure that the directory is readable/writable as appropriate.
HTH

Similar Messages

  • Using utl_file and unix pipes

    Hi,
    I'm trying to use utl_file and unix pipes to communicate with a unix process.
    Basically I want the unix process to read off one pipe and give me back the result on a different pipe.
    In the example below the unix process is a dummy one just copying the input to the output.
    I cant get this to work for a single plsql block writing and reading to/from the pipes - it hangs on the first read of the return pipe.
    Any ideas?
    ======== TEST CASE 1 ===============
    create directory tmp as '/tmp';
    on unix:
    cd /tmp
    mknod outpip p
    mknod inpip p
    cat < inpip > outpip
    drop table res;
    create table res (m varchar2(200));
    declare
    l_filehandle_rec UTL_FILE.file_type;
    l_filehandle_send UTL_FILE.file_type;
    l_char VARCHAR2(200);
    begin
    insert into res values ('starting');commit;
    l_filehandle_send := UTL_FILE.fopen ('TMP', 'inpip', 'A', 32000);
    insert into res values ('opened inpip ');commit;
    l_filehandle_rec := UTL_FILE.fopen ('TMP', 'outpip', 'R', 32000);
    insert into res values ('opened outpip ');commit;
    FOR i in 1..10 LOOP
    utl_file.put_line(l_filehandle_send,'line '||i);
    insert into res values ('written line '||i); commit;
    utl_file.get_line(l_filehandle_rec,l_char);
    insert into res values ('Read '||l_char);commit;
    END LOOP;
    utl_file.fclose(l_filehandle_send);
    utl_file.fclose(l_filehandle_rec);
    END;
    in a different sql session:
    select * from res:
    starting
    opened inpip
    opened outpip
    written line 1
    ============ TEST CASE 2 =================
    However If I use 2 different sql session (not what I want to do...), it works fine:
    1. unix start cat < inpip > outpip
    2. SQL session 1:
    set serveroutput on size 100000
    declare
    l_filehandle UTL_FILE.file_type;
    l_char VARCHAR2(200);
    begin
    l_filehandle := UTL_FILE.fopen ('TMP', 'outpip', 'R', 32000);
    FOR i in 1..10 LOOP
    utl_file.get_line(l_filehandle,l_char);
    dbms_output.put_line('Read '||l_char);
    END LOOP;
    utl_file.fclose(l_filehandle);
    END;
    3. SQL session 2:
    set serveroutput on size 100000
    declare
    l_filehandle UTL_FILE.file_type;
    begin
    l_filehandle := UTL_FILE.fopen ('TMP', 'inpip', 'A', 32000);
    FOR i in 1..10 LOOP
    utl_file.put_line(l_filehandle,'line '||i);
    --utl_lock.sleep(1);
    dbms_output.put_line('written line '||i);
    END LOOP;
    utl_file.fclose(l_filehandle);
    END;
    /

    > it hangs on the first read of the return pipe.
    Correct.
    A pipe is serialised I/O device. One process writes to the pipe. The write is blocked until a read (from another process or thread) is made on that pipe. Only when there is a reader for that data, the writer is unblocked and the actual write I/O occurs.
    The reverse is also true. A read on the pipe is blocked until another process/thread writes data into the pipe.
    Why? A pipe is a memory structure - not a file system file. If the write was not blocked the writer process can writes GBs of data into the pipe before a reader process starts to read that data. This will drastically knock memory consumption and performance.
    Thus the purpose of a pipe is to serve as a serialised blocking mechanism between a reader and a writer - allowing one to write data that is read by the other. With minimal memory overheads as the read must be serviced by a write and a write serviced by a read.
    If you're looking for something different, then you can open a standard file in share mode and write and read from it using two different file handles within the same process. However, the file will obviously have a file system footprint ito space (growing until the writer stops and the reader terminates and trashes the file) .
    OTOH a pipe's footprint is minimal.

  • Question around UTL_FILE and writing unicode data to a file.

    Database version : 11.2.0.3.0
    NLS_CHARACTERSET : AL32UTF8
    OS : Red Hat Enterprise Linux Server release 6.3 (Santiago)
    I did not work with multiple language characters and manipulating them. So, the basic idea is to write UTF8 data as Unicode file using UTL_FILE. This is fairly an empty database and does not have any rows in at least the tables I am working on. First I inserted a row with English characters in the columns.
    I used utl_file.fopen_nchar to open and used utl_file.put_line_nchar to write it to the file on the Linux box. I open the file and I still see English characters (say "02CANMLKR001".
    Now, I updated the row with some columns having Chinese characters and ran the same script. It wrote the file. Now when I "vi" the file, I see "02CANè¹æ001" (some Unicode symbols in place of the Chinese characters and the regular English.
    When I FTP the file to windows and open it using notepad/notepad++ it still shows the Chinese characters. Using textpad, it shows ? in place of Chinese characters and the file properties say that the file is of type UNIX/UTF-8.
    My question : "Is my code working and writing the file in unicode? If not what are the required changes?" -- I know the question is little vague, but any questions/suggestions towards answering my question would really help.
    sample code:
    {pre}
    DECLARE
       l_file_handle   UTL_FILE.file_type;
       l_file_name     VARCHAR2 (50) := 'test.dat';
       l_rec           VARCHAR2 (250);
    BEGIN
       l_file_handle := UTL_FILE.fopen_nchar ('OUTPUT_DIR', l_file_name, 'W');
       SELECT col1 || col2 || col3 INTO l_rec FROM table_name;
       UTL_FILE.put_line_nchar (l_file_handle, l_rec);
       UTL_FILE.fclose (l_file_handle);
    END;
    {/pre}

    Regardless of what you think of my reply I'm trying to help you.
    I think you need to reread my reply because I can't find ANY relation at all between what I said and what you responded with.
    I wish things are the way you mentioned and followed text books.
    Nothing in my reply is related to 'text books' or some 'academic' approach to development. Strictly based on real-world experience of 25+ years.
    Unfortunately lot of real world projects kick off without complete information.
    No disagreement here - but totally irrevelant to anything I said.
    Till we get the complete information, it's better to work on the idea rather than wasting project hours. I don't think it can work that way. All we do is to lay a ground preparation, toy around multiple options for the actual coding even when we do not have the exact requirements.
    No disagreement here - but totally irrevelant to anything I said.
    And I think it's a good practice rather than waiting for complete information and pushing others.
    You can't just wait. But you also can't just go ahead on your own. You have to IMMEDIATELY 'push others' as soon as you discover any issues affecting your team's (or your) ability to meet the requirements. As I said above:
    Your problems are likely:
    1. lack of adequate requirements as to what the vendor really requires in terms of format and content
    2. lack of appropriate sample data - either you don't have the skill set to create it yourself or you haven't gotten any from someone else.
    3. lack of knowledge of the character sets involved to be able to create/conduct the proper tests
    If you discover something missing with the requirements (what character sets need to be used, what file format to use, whether BOMs are required in the file, etc) you simply MUST bring that to your manager's attention as soon as you suspect it might be an issue.
    It is your manager's job, not yours, to make sure you have the tools needed to do the job. One of those tools is the proper requirements. If there is ANYTHING wrong, or if you even THINK something is wrong with those requirements it is YOUR responsibility to notify your manager ASAP.
    Send them an email, leave a yellow-sticky on their desk but notify them. Nothing in what I just said says, or implies, that you should then just sit back and WAIT until that issue is resolved.
    If you know you will need sample data you MUST make sure the project plan includes SOME means to obtain sample data witihin the timeline needed by your project. As I repeated above if you don't have the skill set to create it yourself someone else will need to do it.
    I did not work with multiple language characters and manipulating them.
    Does your manager know that? If the project requires 'work with multiple language characters and manipulating them' someone on the project needs to have experience doing that. If your manager knows you don't have that experience but wants you to proceed anyway and/or won't provide any other resource that does have that experience that is ok. But that is the manager's responsibility and that needs to be documented. At a minimum you need to advise your manager (I prefer to do it with an email) along the following lines:
    Hey - manager person - As you know I have little or no experience to 'work with multiple language characters and manipulating them' and those skills are needed to properly implement and test that the requirements are met. Please let me know if such a resource can be made available.
    And I'm serious about that. Sometimes you have to make you manager do their job. That means you ALWAYS need to keep them advised of ANY issue that might affect the project. Once your manager is made aware of an issue it is then THEIR responsibility to deal with it. They may choose to ignore it, pretend they never heard about it or actually deal with it. But you will always be able to show that you notified them about it.
    Now, I updated the row with some columns having Chinese characters and ran the same script.
    Great - as long as you actually know Chinese that is; and how to work with Chinese characters in the context of a database character set, querying, creating files, etc.
    If you don't know Chinese or haven't actually worked with Chinese characters in that context then the project still needs a resource that does know it.
    You can't just try to bluff your way through something like character sets and code conversions. You either know what a BOM (byte order mark) is or you don't. You have either learned when BOMs are needed or you haven't.
    That said, we are in process of getting the information and sample data that we require.
    Good!
    Now make sure you have notified your manager of any 'holes' in the requirements and keep them up to date with any other issues that arise.
    NONE of the above suggests, or implies, that you should just sit back and wait until that is done. But any advice offered on the forums about specifics of your issue (such as whether you need to even worry about BOMs) is premature until the vendor or the requirements actually document the precise character set and file format needed.

  • Oracle XE - UTL_FILE - shared printer

    Hi,
    I am trying to recreate a production environment on XE.
    I am trying to send a print command to a shared printer (share name label01).
    The machine running the XE database is called cobrademo.
    When I try the following command utl_file.fopen('\\cobrademo\label01', 'test.txt','w'), I get ora-29280 invalid directory path.
    When I change the directory to a directory on the cobrademo machine it works fine.
    The solution of mapping util_file to a shared printer is also working in production.
    The XE service is running as a user called OracleDBA, that has also been granted access to the shared printer.
    Any ideas?
    Thanks.

    cleme1a wrote:
    When I try the following command utl_file.fopen('\\cobrademo\label01', 'test.txt','w'), I get ora-29280 invalid directory path.2 basic issues. The Oracle server needs to be able to resolve that NetBIOS hostname to an IP address. Secondly, the current Windows user that is running the Oracle server process, needs to have access to that UNC (read and write in your case).
    A simple method to test is to logon as that Windows user (usually <i>Oracle</i>) on the Oracle database server. Open a command console window. Type the following:
    +{noformat}net view \\cobrademo{noformat}+
    If this fails, then get the IP address of that cobrademo server and add the following like to c:\Windows\System32\Drivers\Etc\lmhosts :
    <i><ipaddress> cobrademo </i>
    If the net view command works, attempt to access (read, write or map) the NetBIOS share/service called label01. E.g.
    +{noformat}echo "This is a test" > \\cobrademo\label0{noformat}+
    This needs to work in an automated fashion - thus no keyboard/user input such as specifying a username and/or password to make the NetBIOS calls and access work.
    PS. Note that this is not a question related to either the SQL or PL/SQL languages. Please choose an appropriate forum for your question's subject matter in future. Thanks.

  • UTL_FILE: How do you use the ^ as a delimiter from an ASCII file?

    We currently have UTL_FILE pulling in a comma delimited file,
    with this code: With the V_COMMA's declared and other variables
    declared listed below. It works. When we change the ASCII file
    to ^ delimited, the program fails. How do we get the ^ to work
    with UTL_FILE?
    BEGIN
    UTL_FILE.GET_LINE(V_FILEHANDLE, V_NEWLINE);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    EXIT;
    END;
    /* adding numbers 1-6 to position one on newline*/
    V_COMMA_1 := INSTR(V_NEWLINE, ',', 1, 1);
    V_COMMA_2 := INSTR(V_NEWLINE, ',', 1, 2);
    V_COMMA_3 := INSTR(V_NEWLINE, ',', 1, 3);
    V_COMMA_4 := INSTR(V_NEWLINE, ',', 1, 4);
    V_COMMA_5 := INSTR(V_NEWLINE, ',', 1, 5);
    V_COMMA_6 := INSTR(V_NEWLINE, ',', 1, 6);
    V_ITEM_NUMBER := SUBSTR(V_NEWLINE, 1, V_COMMA_1 - 1);
    V_AVAILABLE := SUBSTR(V_NEWLINE, V_COMMA_1 + 1, V_COMMA_2 -
    V_COMMA_1-1);
    V_ETA_CHAR := SUBSTR(V_NEWLINE, V_COMMA_2 + 1,
    V_COMMA_3 - V_COMMA_2-1);
    V_RETAIL_PRICE := SUBSTR(V_NEWLINE, V_COMMA_3 + 1,
    V_COMMA_4 - V_COMMA_3-1);
    V_DROP_SHIP_FILE := SUBSTR(V_NEWLINE, V_COMMA_4 + 1,
    V_COMMA_5 - V_COMMA_4-1);
    V_COMPANY_FILE := SUBSTR(V_NEWLINE, V_COMMA_5 + 1);

    Thanks for your response!
    I have simplified the sheet so it contains no split or merged cells, yet still I get the exclamation mark where I want the average. (The exclamation mark says 'Numbers can't be divided by zero'.)
    Exam
    Skit
    Exam
    Class Participation
    1
    2
    TOTAL
    MAX. MARK
    55
    30
    100
    15
    200
    ADJ. %
    MARK
    Student A
    37
    20
    84
    15
    156
    78%
    72%
    7
    Student B
    39
    28
    91
    15
    173
    87%
    80%
    8
    Student C
    39
    28
    86
    10
    163
    82%
    76%
    8
    Student D
    34
    26
    92
    15
    167
    84%
    78%
    8
    Student E
    38
    26
    74
    10
    148
    74%
    69%
    7
    CLASS AVERAGE
    37.4
    25.6
    85.4
    13.0
    161.4
    80.7%
    75.0%
    I guess the basic question is: can you actually use AVERAGE on data that is output by an IF formula?

  • Utl_file output converted from database characterset

    I have a developer that is sending output to a file using utl_file. Here is a snippet of his code:
    fileHand UTL_FILE.file_type;
    buffer VARCHAR2(1000);
    UTL_FILE.put_raw(fileHand, UTL_RAW.cast_to_raw(buffer), TRUE);
    In the database there is data such as:
    Stéphanie Chéry
    but in the output file it is written as:
    Stéphanie Chéry
    basically it is being converted to WE characterset.
    This is RDBMS 11.2.0.2 64bit running on RHE 5. The linux user account executing the proc that generates the output file has NLS_LANG=AMERICAN_AMERICA.AL32UTF8 in it's environment. We don't understand why the characterset is being converted. he has tried using the NCHAR functions of UTL_FILE and still gets the same results.
    Any idea what our issue is?
    Below is SELECT * FROM NLS_DATABASE_PARAMETERS from the database
    "PARAMETER","VALUE"
    "NLS_LANGUAGE","AMERICAN"
    "NLS_TERRITORY","AMERICA"
    "NLS_CURRENCY","$"
    "NLS_ISO_CURRENCY","AMERICA"
    "NLS_NUMERIC_CHARACTERS",".,"
    "NLS_CHARACTERSET","AL32UTF8"
    "NLS_CALENDAR","GREGORIAN"
    "NLS_DATE_FORMAT","DD-MON-RR"
    "NLS_DATE_LANGUAGE","AMERICAN"
    "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","CHAR"
    "NLS_NCHAR_CONV_EXCP","FALSE"
    "NLS_RDBMS_VERSION","11.2.0.2.0"

    1076:jobsub@elver:/home/jobsub> env
    _=*8512*/bin/env
    CLASSPATH=
    COBDIR=/opt/FJSVcbl64
    COBPATH=/home/jobsub:/app/sct/banner_du/links:/app/sct/banner_du/general/exe
    COBPREF=perl /app/sct/banner_du/links/banfjsv.pl
    COBSUFX=
    DATAFILE_HOME=
    DATA_HOME=/app/sct/dataload/DUSIMS
    DISPLAY=localhost:10.0
    G_BROKEN_FILENAMES=1
    HISTSIZE=1000
    HOME=/home/jobsub
    INPUTRC=/etc/inputrc
    LANG=en_US.UTF-8
    LC_ALL=en_US.UTF-8
    LC_COLLATE=en_US.UTF-8
    LC_CTYPE=en_US.UTF-8
    LC_MESSAGES=en_US.UTF-8
    LC_MONETARY=en_US.UTF-8
    LC_NUMERIC=en_US.UTF-8
    LC_TIME=en_US.UTF-8
    LD_LIBRARY_PATH=/app/oracle11/product/11.2/lib:/app/oracle11/product/11.2/lib32:/opt/FJSVcbl64/lib:/opt/FJSVXbsrt/lib:/opt/FJSVXmeft/lib:/app/sct/banner_du/general/exe:/usr/local/lib
    LESSOPEN=|/usr/bin/lesspipe.sh %s
    LOGNAME=jobsub
    LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
    MAIL=/var/spool/mail/jobsub
    NLS_LANG=AMERICAN_AMERICA.AL32UTF8
    ORACLE_HOME=/app/oracle11/product/11.2
    ORACLE_LPARGS=-Plp
    ORACLE_LPPROG=lpr
    ORACLE_PATH=.:/home/jobsub:/app/sct/banner_du/links:/app/sct/banner_du/admin
    ORACLE_SID=DUSIMS
    ORA_NLS10=/app/oracle11/product/11.2/nls/data
    ORA_NLS11=/app/oracle11/product/11.2/nls/data
    ORA_NLS33=/app/oracle11/product/11.2/ocommon/nls/admin/data
    PATH=:/app/sct/banner_du/fixes_DUSIMS:/opt/FJSVcbl64/bin:/opt/FJSVXbsrt/lib:/opt/FJSVXmeft/lib::/app/sct/banner_du/general/exe:/app/sct/banner_du/admin:.:/app/sct/jobsub:/app/sct/dlp:/app/sct/jobsub/scripts:/usr/java/jdk1.6.0_25/bin:/bin:/usr/bin:/usr/local/bin:/usr/openv/netbackup/bin:/opt/sct/bin:/app/oracle11/product/11.2/bin:/app/sct/banner_du/links
    PS1=!:$LOGNAME@$HOSTNAME:$PWD>
    PWD=/home/jobsub
    SHELL=/bin/ksh
    SHLVL=1
    SQLPATH=.:/home/jobsub:/app/sct/banner_du/links:/app/sct/banner_du/admin
    SRCE_LINK=
    TERM=vt100
    USER=jobsub
    ASTFEATURES=UNIVERSE - ucb
    A__z="*SHLVL

  • Line length  in UTL_FILE

    HI.. sorry for basic question but....
    1- I want to create a file from database.
    2- The length of lines to append to the file is 1300
    3- when I try to close the file or make fflush to the file
    (write lines into the file), exception utl_file.write_error
    is fired.
    4- when the length of the line is 750 (i,e) that's not occurs
    WAY???
    What is te maximun length for the line to append???
    May be concern of Operating System variable??
    THANK's and excuseme for my regular english.
    JOHNNY

    1) Read about utl_file.put (tells you the line max)
    2) Doc for the rest of UTL_FILE
    http://technet.oracle.com/docs/products/oracle9i/doc_library/901_doc/appdev.901/a89852/utl_fi11.htm#1001590
    http://technet.oracle.com/docs/products/oracle9i/doc_library/901_doc/appdev.901/a89852/utl_file.htm#1002119

  • Utl_file performance

    Hi,
    I have a program which reads a flag file using utl_file and loads the data in a staging table.
    Because of the specific requirement, I could not use SQL*Loader and had to use utl_file.
    The program earlier read & processed around 8000 records in 20 minutes.
    But recently it has started to take too long. It now takes more than 3 hours to just read the same file. .I confirmed this by just reading the file and inserting records in the staging table. I am not doing any SQL SELECT queries.
    Can anyone please explain what could be the reason for this behaviour.... around 9-fold increase in the time to read the same file.
    Thanks in advance.
    --Devang                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Thanks for the reply.
    I am reading just one line at a time. Then doing some validation/parsing...like extracting the fields, checking the format etc...basically string operations.
    Earlier I was reading one-line at-a-time...parsing/extracting fields...and inserting it into the table. Now I am just bulk inserting when the record count reaches 1000. In both the cases it is pretty slow. Yesterday just reading the file, extracting the fileds and bulk inserts cost 3 hours for 8000 records.
    I do not understand why it has become so slow. Earlier the same code took just 20 mins including post-parse business validations.
    I have never used DBMS_PROFILE, so it would be very kind of you if you could suggest something or some good pointers.
    I am reproducing the code here again. I do not know how did those "+" came in...I had just used Forum Rich Text formatting.
    <h5>
    /* Formatted on 2008/09/23 10:20 (Formatter Plus v4.8.8) */
    CREATE OR REPLACE PACKAGE BODY my_pkg
    AS
    TYPE typ_stg_table IS TABLE OF xxotc.my_table%ROWTYPE
    INDEX BY BINARY_INTEGER;
    PROCEDURE INSERT_RECORD ( p_rec IN typ_stg_table )
    IS
    BEGIN
    FORALL i IN 1 .. p_rec.COUNT
    INSERT INTO my_table
    VALUES p_rec (i);
    COMMIT;
    END INSERT_RECORD;
    PROCEDURE main ( p_directory IN VARCHAR2 ,p_filename IN VARCHAR2 )
    IS
    l_file_handle UTL_FILE.file_type;
    l_line_read VARCHAR2 (4000);
    BEGIN
    l_file_handle := UTL_FILE.fopen (p_directory
    ,p_filename
    ,'r'
    LOOP
    BEGIN
    UTL_FILE.get_line (l_file_handle, l_line_read);
    --parse each field and assign it to PL/SQL table
    END;
    END LOOP;
    I have debug statements that tell me that...just to reach here out of loop it takes more that 1000sec/1000 records.
    INSERT_RECORD (tab_stg_table);
    tab_stg_table.DELETE;
    --Records inserted into the staging table
    --Validate each record and update using Oracle API's
    VALIDATE ();
    END main;
    END my_pkg;
    </h5>

  • How to Determine File Code page of the txt file generated thru UTL_FIle

    Hi
    I want to know the file code page of the txt file that I have generated in Oracle using UTL_FILE.
    E.g., OUT_FILE := UTL_FILE.FOPEN(DIRNAME,vFILENAME,'W',2000);
    What is the way to do so? I have read on internet that if we want to know the code page of a file then we just have to open in any browser like IE and just check the encoding from there. Is this the correct way to know the encoding?
    Also, I want to know that whether file code page is dependent on OS or the source from which the file is being generated?

    "The Oracle character set is synonymous with the Windows code page. Basically, they mean the same thing."
    Source:http://www.databasejournal.com/features/oracle/article.php/3493691/The-Globalization-of-Language-in-Oracle---The-NLSLANG-variable.htm
    Means, in oracle we says character set which is = window's code page.
    "Determine the code page of your Oracle database ( = select parameter, value from nls_database_parameters and look for parameter NLS_CHARACTERSET)."
    Source:http://media.datadirect.com/download/docs/slnk/admin/intlangsupp.html
    Which already said by Pierre above.
    HTH
    Girish Sharma

  • Any one used UTL_FILE through APEX?

    Version: 4.1.1
    Hi There,
    I had a oracle forms 6i form which calls a PL/SQL package, which basically, selects data from a table and using UTL file writes the data to the file on my C drive. The directory definition is created using
    create directory oraload as 'c:\oraload\';
    grant read,write on directory oraload to UWCLASS;
    grant read,write on directory oraload to HR;
    It works fine without any issues.
    I now wanted to call the same package through the Apex app that I have developed which is in the same schema HR where the package is compiled. However, I get the error
    ORA-29283: invalid file operation ORA-06512: at "SYS.UTL_FILE", line 475
    IF I add the directory directly like "C:\ORALOAD\" then it gives the error
    ORA-29280: invalid directory path
    Do I need to grant any specific priveleges to Apex? Not sure, why its failing in Apex when all that I am doing is callng the package which should be running in the DB
    Any suggestions or ideas?
    Thanks,
    Ryan
    Edited by: ryansun on Nov 28, 2012 1:15 AM

    Nevermind. This was a mistake at my end. I had the file locked!

  • Basic question

    Hello, i have a basic question. if i have defined 2 fields in a cube or a dso:
    Name Quantity
    and from the external flat file i get some characters for my quantity field. would my load fail?  for standard dso and for write optimized?
    NOTE: quantity field is a keyfigure defined as numeric.
    and the load coming in has "VIKPATEL" for Quantity field and not numbers.
    thanks

    Hi Vik,
    Yes, the load will fail.
    May be you coud first load this data into BW (into PSA) and set both fields as characters fields. Then you can create DSO, do transformation from this PSA to the DSO, and put your logic as to what do you want to do with those Quantity that is not number (e.g. convert to 0, or 'Not assgined', etc).
    You can use transfer rule, or a clean up ABAP code in the start routine.
    Hope this helps.

  • How can I create a video clip that has multiple copies of the same subject playing at the same time?  Basically like one person became 50 backup dancers!

    Hello Everyone,
    I am trying to create a single video clip where my original subject (dancer) is multiplied on the screen many times.  Basically I am trying to create a background video for a dance team and want to make it look like an army of the same person dancing behind them.  Amy guidance would be great!
    Thanks
    Madisonman 2013

    Motion ($50) can do this with a replicator.
    Russ

  • Type Mismatch error while calling a Java Function from Visual Basic 6.0...

    Hi,
    I'm having a problem in calling the Java Applet's Function from Visual Basic. First, I'm getting the handle of the Java Applet and components of it using "Document.Applets(n)" which is a HTML function. I'm calling this function from Visual Basic. My code is something like this...
    ' // Web1 is IE Browser in my Form.
    Dim Ap,Comp
    Dim Bol as Boolean
    Bol = true
    Ap = Web1.Document.Applets(0).getWindow() ' \\ Gets the Parent Window.
    Ap.setTitle("My Java Applet") ' \\ Sets the Title of the window.
    msgbox Ap.getVisibility() ' \\ This will return a Java boolean ( true or false )
    Ap.setVisibility(Bol) ' \\ Function Syntax is : void setVisibility(boolean b)
    Here in my code , i'm able to call any function that which accepts Integer or String but not boolean. So, i m facing problem with Ap.setVisibility() function. It gives me a "Type mismatch error" while executing it. Can you please tell me a way to do this from Visual Basic !
    I'm using Visual Basic 6.0, Windows 2000 , J2SDK 1.4.2_05.
    Please help me Friends.
    Thanks and Regards,
    Srinivas Annam.

    Hi
    I am not sure about this solution. try this
    Declare a variable as variant and store the boolean value in that variable and then use in ur method.
    Post ur reply in this forum.
    bye for now
    sat

  • Disappointed by missing basic functionality

    I recently started working with Muse, and got frustrated by the fact that there seemingly is no Show/Hide functionality.
    Also, am I correct to say that there is no direct import for Mp3/4 media? If so, why not?
    Lastly: if InDesign can have basic animation options, then surely it wouldn't be so hard to include it in Muse.
    Muse works great, but I am quite disappointed by this lack of basic functionality.
    Cobus

    Thanks for your response.Yes I agree with you  - I put my expectations in the fact that Muse is developing fast.
    However, what I'd regard as a very basic feature  for any interactivity (show/hide), is missing. Instead of having abutton that can show or hide icons on a map, I now I have to create a duplicate of the same page that don't show them. So when a user click the button, another page first has to load!
    Clumsy and stupid.
    Thanks for the link - I'll have a look at it.
    Regards
    Cobus

  • Help needed in utl_file

    Hi,
    I have two groups in data model of my report. I am using utl_file in a formula column of report last group.it's working fine.
    but my problem is if customer has more than one invoice lines
    then all that lines not comes under only particular customer only at a time.
    For example my output is coming like this:
    Customer address: 3345 LIMITED-STUDIOS : 00033-45 PARR STREETLIVERPOOLCHESHIRE
    Invoice Lines: 0001000402106-JUL-07INV 10.47
    Customer address: 3345 LIMITED-STUDIOS : 00033-45 PARR STREETLIVERPOOLCHESHIRE
    Invoice Lines: 0001000402713-JUL-07INV 10.77
    But I am trying to get output like this:
    Customer address: 3345 LIMITED-STUDIOS : 00033-45 PARR STREETLIVERPOOLCHESHIRE
    Invoice Lines: 0001000402106-JUL-07INV 10.47
              0001000402713-JUL-07INV 10.77
    I am using fallowing code in my formula column:
    function CF_UTL_FILEFormula return Char is
    v_file_data utl_file.file_type;
    begin
    utl_file.put_line(v_file_data,:SEND_CUSTOMER_NAME:SEND_ADDRESS1:SEND_ADDRESS2:SEND_ADDRESS3:SEND_ADDRESS4:SEND_CITY:SEND_STATE:SEND_COUNTRY_DESC:SEND_POSTAL_CODE);
    utl_file.put_line(v_file_data,LN1:CF_LOCATION:C_DELIVERY_DATE:INVOICE_NUMBER:TRX_DATE:c_transaction_type:CD_TRX_AMOUNT);
    utl_file.fclose(v_file_data);
    end;
    Please help me how can I do this?

    What's the source of your Summary Column? It's not allowed to choose here the formula column in whcih you reference the summary column back. But another column should work.
    As alternativ add a formula column in the upper group with
    utl_file.put_line(v_file_data,:SEND_CUSTOMER_NAME:SEND_ADDRESS1:SEND_ADDRESS2:SEND_ADDRESS3:SEND_ADDRESS4:SEND_CITY:SEND_STATE:SEND_COUNTRY_DESC:SEND_POSTAL_CODE);
    and remove the same line out of the other formula column.

Maybe you are looking for

  • Why can I not see PowerPoint 2007 comments in KeyNote 09?

    I created a KeyNote presentation for my class in KeyNote and saved it to a PowerPoint 2003 format (teacher request). I sent it off to the teacher, who used PowerPoint 2007 to add comments using the comments feature on the review tab, who then sent it

  • I am finding that when I click on a PDF it may open one day, but the next day it doesn't or vice versa

    I am finding that opening pdf links tends to be spotty. Sometimes a link opens, but other times it doesn't. I know there's a lot of variables at play but was hoping someone might be able to provide some insight on how to resolve this, or at the very

  • Can't get Home Sharing to work after updating iTunes to 11.1.5

    I just updated iTunes to 11.1.5 and can no longer access Home Sharing on my other devices such as iPhone and Apple TV (3rd Gen).  I have gone through the trouble shooting guidelines.  My network is fine. I can access the iTunes store from both device

  • Multi provider not pulling data

    Hi All, I have 2 data targets ,1 is 0PA_C01 cube and 2nd is a custom DSO.i created a multi provider on top of them and made the identification process properly for chars and keyfigs.in my case 0HRPOSITION is the common char between the two data targe

  • Populate an arraylist....

    Hi guys, i'm a new java user and i have a big question for you. I'm developing a jsf application with eclipse and i have a problem. I have to import a txt file with this format string string string string string double double double string double dou