How to read a whole text file into a pl/sql variable?

Hi, I need to read an entire text file--which actually contains an email message extracted from a content management system-- into a variable in a pl/sql package, so I can insert some information from the database and then send the email. I want to read the whole text file in one shot, not just one line at a time. Shoud I use Utl_File.Get_Raw or is there another more appropriate way to do this?

how to read a whole text file into a pl/sql variable?
your_clob_variable := dbms_xslprocessor.read2clob('YOUR_DIRECTORY','YOUR_FILE');
....

Similar Messages

  • How to read the whole text file lines using FTP adapter

    Hi all,
    How to read the whole text file lines when error occured middle of the text file reading.
    after it is not reading the remaining lines . how to read the whole text file using FTP adapter
    pls can you help me

    Yes there is you need to use the uniqueMessageSeparator property. Have a look at the following link for its implementation.
    http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/adptr_file.htm#CIACDAAC
    cheers
    James

  • How to read values from Property file into BPEL process local variable?

    I would like to use a Property file with some parameters e.g.
    <myparm1>12345</myparm1>
    How can I read from a BPEL process such a Property file and assign it into e.g. local variable "intparm1"?
    Where (in which directory) should I put this XML Property file to have it always available for reading?
    Peter

    Hi,
    You can also use
    ora:readFile( ) function as follow :
    ora:readFile(xml file location (ex. "file:///D:\\SOA\\FileAdapters\\readFile\\test\\test.xml"),xsd file location (ex."file:///D:\\SOA\\FileAdapters\\readFile\\test\\test.xsd"))
    inside the assign activity and assign this to the variable you want.
    regards
    arababah
    Edited by: arababah on Aug 10, 2009 12:55 AM

  • Reading from a text file into a 2D array

    How do you read from a text file and put it into a 2D array? Or if someone could guide me to where I can find the information?

    This tutorial shows how to read a file:
    http://java.sun.com/docs/books/tutorial/essential/io/scanfor.html
    This tutorial shows how to create arrays with multiple dimensions:
    http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html

  • How to read in a text file of race lap times....

    How do i read in a text file containing lap times from a race for one driver?
    I have the times down 1 column and look like this.
    I then want to add the times up to get a total race time. I have been looking at the Calendar class and the simpleDateFunction but not sure how to go about it.
    1'43.857
    1'37.860
    1'38.147
    1'37.922
    1'37.662
    1'37.639
    1'37.621
    1'37.728
    1'37.508
    1'37.990
    1'38.114
    1'38.177
    1'38.162
    1'37.847
    1'38.013
    1'38.196
    1'37.963
    1'37.924
    1'38.038
    1'37.962
    Thanks
    Trev

    Considering that your times have non-numerical chars you have no choice but to read them as Strings. Once you have done that you will need to parse the times yourself, ie spilt it into the three separate bits of data. Then you can use the Calendar class if you wish or you can keep a running tally yourself. Just don't forget to tick over seconds when milliseconds reaches 999 and tick over minutes when seconds reach 59.

  • How can i feed a text file into a Hashtable?

    Hi,
    im working on my third year project, im new to java and am struggling a little with writing the code.
    I need to feed a text file into my program and insert it into a hashtable. I presume i'll be using an input stream to feed the file in, how do i go about placin the text file into a hashtable??
    please help!

    ok, so im trying to code an authorship attribution
    program. the first part of the program need to
    compare a text file A (list of words), with another
    two text files B and C. Compare how? Do you want to know how many times certain words from list A appear in files B and C?
    The words in list A will first be compared to those
    in list B and than list C. I was wondering if there
    was a way of inserting file A,A Map is a list of key/value pairs, so what do you mean by inserting here? What are you inserting? What would the keys and values here be?
    followed by B,
    comparing the two files.....than inserting file C and
    comparing it with A??
    Does this make sense??Not quite, but it might just be me.

  • How to read from a text file one character at a time?

    Hello
    I wish to read from a text file in a for loop and that on every iteration i read one charachter and proceed to the next one.
    can anyone help me?
    Lavi 

    lava wrote:
    I wish to read from a text file in a for loop and that on every iteration i read one charachter and proceed to the next one.
    can anyone help me?
    Some additional comments:
    You really don't want to read any file one character at a time, because it is highly inefficient. More typically, you read the entire file into memory with one operation (or at least a large chunk, if the file is gigantic) and then do the rest of the operations in memory.  One easy way to analyze it one byte at a time would be to use "string to byte array" and then autoindex into a FOR loop, for example.
    Of course you could also read the file directly as a U8 array instead of a string.
    Message Edited by altenbach on 06-10-2008 08:57 AM
    LabVIEW Champion . Do more with less code and in less time .

  • How to read a Unicode text file in a non-unicode SAP system

    I'm currently has a text file which is saved as UTF-8 format. And inside this file has Thai characters.
    However, my SAP system is a non-unicode system.
    When I use the code
    open dataset DSN for output in TEXT MODE encoding UTF-8
    the thai characters become some funny characters.
    How can I solve this in the ABAP program without changing the system from non-unicode to unicode system?

    Hi Eswar,
       How can I check whether the code page for THAI already installed or not in SAP system?
       Here is the code I use to test to read a file that saved as UTF-8.
    DATA: l_filepath         TYPE string.
    DATA : BEGIN OF l_filepath_str OCCURS 0,
                 comm(1000)  TYPE c,
               END OF l_filepath_str.
    DATA: l_datasetsucc LIKE rlgrap-filename.
    l_filepath = '/BAAC/Files/APP_.txt'.
    OPEN DATASET l_filepath FOR INPUT IN TEXT MODE ENCODING UTF-8.
    IF sy-subrc EQ 0.
      DO.
        CLEAR l_filepath_str.
        READ DATASET l_filepath INTO l_filepath_str.
        IF sy-subrc EQ 0.
          APPEND l_filepath_str.
        ELSE.
          EXIT.
        ENDIF.
      ENDDO.
    ELSE.
      WRITE:/ 'Error reading from file:', sy-subrc.
    ENDIF.
    CLOSE DATASET l_filepath.
    LOOP AT l_filepath_str.
      WRITE: / l_filepath_str-comm.
    ENDLOOP.
        It returns me a runtime error. Any idea?

  • How to copy data in text file into two-dimensional arrays?

    Greeting. Can somebody teach me how to copy the input file into two-dimensional arrays? I'm stuck in making a matrix with number ROWS and COLUMNS according to the data in "input.txt"
    import java.io.*;
    import java.util.*;
    public class array
        public static void main (String[] args) throws FileNotFoundException
        { Scanner sc = new Scanner (new FileReader("input.txt"));
            PrintWriter outfile = new PrintWriter("output.txt");
        int[][]matrix = new int[ROWS][COLUMNS];
    }my input.txt :
    a,b,c
    2,2,1
    1,1,1
    2,2,1
    3,3,1
    4,4,1
    5,5,1
    1,6,2
    2,7,2
    3,8,2
    4,9,2
    5,10,2

    import java.io.*;
    import java.util.*;
    public class array {
        public static void main(String[] args) throws IOException {
            FileInputStream in = null;
            FileOutputStream out = null;
    try {
        in = new FileInputStream("input.txt");
        BufferedReader reader = new BufferedReader(new InputStreamReader(in));
        String line = null;
        while ((line = reader.readLine()) != null) {
            String split[]=line.split(",");
    catch (IOException x) {
        System.err.println(x);
    } finally {
        if (in != null) in.close();
    }}}What after this?

  • Does anyone know how to read in a TDMS file into Matlab?

    I am trying to read a TDMS file into Matlab. Are the two compatible? How can I import this file into matlab?

    A search can turn up wonderful things, such as:
    Reading TDM/TDMS Files with The MathWorks, Inc. MATLAB® Software

  • How to read values from Property XMLfile into BPEL process local variable?

    I would like to use a Property file with some parameters e.g.
    <myparm1>
    12345
    </myparm1>
    How can I read from a BPEL process such a Property XML text file and assign it into e.g. local variable "intparm1"?
    Where (in which directory) should I put this XML Property file to have it always available for reading?
    Peter

    Hi,
    You can also use
    ora:readFile( ) function as follow :
    ora:readFile(xml file location (ex. "file:///D:\\SOA\\FileAdapters\\readFile\\test\\test.xml"),xsd file location (ex."file:///D:\\SOA\\FileAdapters\\readFile\\test\\test.xsd"))
    inside the assign activity and assign this to the variable you want.
    regards
    arababah
    Edited by: arababah on Aug 10, 2009 12:55 AM

  • How can I combine multiple text files into a single, alphabetized list?

    I have many, many lists of song titles. Each in its own textedit file. There is tons of overlap and duplication. I want to make a master list that has every song listed.
    If I could somehow just merge them all and alphabetize the lines, I could manually get rid of duplicates fairly easily.
    I have Tiger. Don't know if I have any application that would help. I probably don't want to buy an application, though, because I suspect I may not be able to stick with Tiger much longer.
    I appreciate any tips you can give me.
    Thanks a lot,
    Bruce

    Hi Bruce, Tex-Edit Plus for OS X...
    http://www.tex-edit.com/
    It can Merge files then Sort them easily, even has a remove duplicate lines script available.
    If the version you get doesn't have the sort perchance, here's a link, put sort in the search scripts box, get the second one, Sort Selection...
    http://dougscripts.com/texedit/

  • Open and read from text file into a text box for Windows Store

    I wish to open and read from a text file into a text box in C# for the Windows Store using VS Express 2012 for Windows 8.
    Can anyone point me to sample code and tutorials specifically for Windows Store using C#.
    Is it possible to add a Text file in Windows Store. This option only seems to be available in Visual C#.
    Thanks
    Wendel

    This is a simple sample for Read/Load Text file from IsolateStorage and Read file from InstalledLocation (this folder only can be read)
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using Windows.Storage;
    using System.IO;
    namespace TextFileDemo
    public class TextFileHelper
    async public static Task<bool> SaveTextFileToIsolateStorageAsync(string filename, string data)
    byte[] fileBytes = System.Text.Encoding.UTF8.GetBytes(data);
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await local.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
    try
    using (var s = await file.OpenStreamForWriteAsync())
    s.Write(fileBytes, 0, fileBytes.Length);
    return true;
    catch
    return false;
    async public static Task<string> LoadTextFileFormIsolateStorageAsync(string filename)
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    string returnvalue = string.Empty;
    try
    var file = await local.OpenStreamForReadAsync(filename);
    using (StreamReader streamReader = new StreamReader(file))
    returnvalue = streamReader.ReadToEnd();
    catch (Exception ex)
    // do somthing when exception
    return returnvalue;
    async public static Task<string> LoadTextFileFormInstalledLocationAsync(string filename)
    StorageFolder local = Windows.ApplicationModel.Package.Current.InstalledLocation;
    string returnvalue = string.Empty;
    try
    var file = await local.OpenStreamForReadAsync(filename);
    using (StreamReader streamReader = new StreamReader(file))
    returnvalue = streamReader.ReadToEnd();
    catch (Exception ex)
    // do somthing when exception
    return returnvalue;
    show how to use it as below
    async private void Button_Click(object sender, RoutedEventArgs e)
    string txt =await TextFileHelper.LoadTextFileFormInstalledLocationAsync("TextFile1.txt");
    Debug.WriteLine(txt);
    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

  • Read words from a text file into an undefined array

    Dear all,
    Does anyone know how to read words in text file, seperated by all types of spaces ("_", "\n", "\t","\r","\f") and put them into a string array to be used later?
    So far I can read the words using the Tokenizer but can't assign to array:
    public class reader
    StringTokenizer tokenizer = new StringTokenizer(input);
    String[ ] array= null;  //unknown size of array
    int i=0;
                   while(tokenizer.hasMoreTokens())
                             array[i] = tokenizer.nextToken();
                             i++;
    Any suggestions welcome!
    thanks in advance!

    Hi
    sorry wrote in a hurry ;) din c the problem clearly
    there are two approaches
    1) best approach for your problem is Vector or ArrayList, these would make life easy for you.
    Always collections are better approach over arrays when the size is dynamic. However in your case the size cant be said to be DYNAMIC. coz the number of words will not grow / shrink during the runtime.. i know that number of words are not fixed but dynamic is something which will grow/shrink during runtime. but still collection is better approach.
    2)dirty approach
    use double dimensional array
    String arr[][] = null;
    then use one tokenizer for StringTokenizer(str,"\n");
    using countTokens on this will give you number of lines.
    use this to initialize array
    arr = new String[lineCount][];
    then iterate from 1 to lineCount and use 1 more tokenizer to get number of words for that line. use this number to initialize the column size for arr[i] like
    arr[i] = new String[wordCount];
    then store the token using nested for loops in this array
    go for the 1st one ;) 2nd one is hedious n time consuming but both will work ;)
    cheers
    amey

  • Reading a text file into a StringBuffer?

    Hey all,
    I've taken a year of Java programming class so far, but I doubt my class is ever going to get in to things like this. I've been trying to develop a program that reads a small text file into a StringBuffer for manipulation and use in the program. I've been looking around the web, but thus far all I've seen are things like FileInputStream, in the java.io.* package; nothing about StringBuffers.
    And I'm pretty sure it's kind of hard, too. If someone could give me a simple(?) explanation, or a link to a tutorial that shows you this or something, it would be much appreciated.
    Also, is it possible to pull an integer out of a string? I was just wondering this, I don't think you can cast a string to an int or anything. Ha ha.
    ~Darkslime, Java student

    Hey all,
    I've taken a year of Java programming class so far,
    but I doubt my class is ever going to get in to
    things like this. I've been trying to develop a
    program that reads a small text file into a
    StringBuffer for manipulation and use in the program.
    I've been looking around the web, but thus far all
    I've seen are things like FileInputStream, in the
    java.io.* package; nothing about StringBuffers.
    And I'm pretty sure it's kind of hard, too. If
    someone could give me a simple(?) explanation, or a
    link to a tutorial that shows you this or something,
    it would be much appreciated.
    Also, is it possible to pull an integer out of a
    string? I was just wondering this, I don't think you
    can cast a string to an int or anything. Ha ha.
    ~Darkslime, Java student
    try {
            BufferedReader in = new BufferedReader(new FileReader("infilename"));
            String str;
            while ((str = in.readLine()) != null) {
                process(str);
            in.close();
        } catch (IOException e) {
        }

Maybe you are looking for

  • Executing Stored Procedure from TOAD: ORA-00900: invalid SQL statement

    Ok-I have ALL the stored procedures converted into Oracle-now, when I go to test them I am getting the vague error of: ORA-00900: invalid SQL statement I am attempting to execute: --EXEC IEXGetAgentSysPerf(to_date('2008/09/01', 'yyyy/mm/dd/'), to_dat

  • SCCM Custom Query

    Hello, I am looking for a 2007 SCCM custom query that will look for KB2964358 installed. My trouble lies when I specify the below query to see if an update is installed, and it only returns XP computers since it is looking for the ADD Remove Programs

  • Texfield autoSize problem inside embedded movie

    Hi guys! I have a strange problem.. I have a flash file inside which i have a movieclip. I am loading an external swf file into this movieclip using the loadMovie script. the external swf has a couple of texfields that load in content from an XML fil

  • Set cell size and set print size as template change bottom as .25

    IO need to set  crop size i as 4x5/8x10...as standard

  • Windows 7 x64 not able to play any Windows Media based webcasts

    I have 2 machines, a mid 2010 15" MacBook Pro and a 2010 Mac Pro. Both have x64 Windows 7 via Boot Camp and both experience the same issue, namely when in Windows, I cannot play any webcasts that use WMP as the only player. If I boot into Mac, both m