From an Oracle form, I want to read a text file.

From an Oracle form, I want to read a text file. In the form on a button press I have:
declare
in_file Text_IO.File_Type;
linebuf VARCHAR2(1800);
filename VARCHAR2(30);
BEGIN
filename:=GET_FILE_NAME('U:\ora_devl\pps\work\a.txt', File_Filter=>'Text Files (*.txt)|*.txt|');
in_file := Text_IO.Fopen(filename, 'r');
LOOP
Text_IO.Get_Line(in_file, linebuf);
-- :text_item5:=:text_item5||linebuf||chr(10);
Text_IO.New_Line;
END LOOP;
EXCEPTION
WHEN no_data_found THEN
Text_IO.Put_Line('Closing the file...');
Text_IO.Fclose(in_file);
END;
It gets an ORA-302000. I suspect the problem starts with the GET_FILE_NAME because when I comment out everything but that, It processes endlessly never ending.
Forms [32 Bit] Version 11.1.1.3.0 (Production)
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
What can you tell me? Thanks

GET_FILE_NAME will try to open an "Open File" dialog on the server, which obviously can't happen. If you want to use that type of behavior you need to use WebUtil and the function CLIENT_GET_FILE_NAME. Example:
     filename := CLIENT_GET_FILE_NAME('C:\', File_Filter=> 'Text Files (*.txt)|*.txt|All Files (*.*)|*.*|', dialog_type=> OPEN_FILE);Refer to the Builder Online help for more details. You can also refer to the demo which is available here:
http://www.oracle.com/technetwork/developer-tools/forms/downloads/index.html
More information here:
http://www.oracle.com/technetwork/developer-tools/forms/webutil-090641.html
Also, it appears that you are attempting to use a mapped drive ("U"). Although this can be made to work, it is not recommended and in some cases will not be supported. If you need access to remote files, you should use some other mechanism to bring the file to the local machine before manipulating it.

Similar Messages

  • How to read a text file through BufferedReader

    I want to read a text file by BufferedReader, How can I do that? The format of the file as follows:
    NAME MAKER YEAR PRICE CONDITION
    13 Dead End Drive __ Milton Bradley 1993 $22.00 C09
    18 Wheeler Fever __ Donna Lee Ent. 1980 $20.00 C09
    how to parse the line from the file to extract the name, maker, year, price and condition.
    Thank you first.

    Look at: stream tutorials,
    BufferedReader, InputStreamReader, FileInputStream, StringTokenizer

  • How do I read a text file in a Jar Executable?

    Hello All,
    I have a need to package a text file into a Jar Exectable file and then have my java code read that text file in using a BufferedReader. Can anyone out there tell me how to do this? My first question is how do I reference this file by the path name? O, I'm also using Windows.
    Thanks for your help.
    Karl

    I have the same problem with kportner . I did by joop_eggen but I got the error at:
    BufferedReader in = new InputStreamReader(is);Can't conver from BufferedReader to InputStreamReader
    When I up my applet to server and get it from client. My applet couldn't read the text file.
    Any one help me!
    Thanks.

  • How can I read only text files in a directory.

    I've written a program to read files in a directory but I'd like for it to only read the text files of that directory.
    import java.io.*;
    public class Data {
      public static void main(String[] args) throws IOException {
      String target_dir = "C:\\files";
      File dir = new File(target_dir);
      File[] files = dir.listFiles();
      for (File textfiles : files) {
      if (textfiles.isFile()) {
      BufferedReader inputStream = null;
      try {
      inputStream = new BufferedReader(new FileReader(textfiles));
      String line;
      while ((line = inputStream.readLine()) != null) {
      System.out.println(line);
      } finally {
      if (inputStream != null) {
      inputStream.close();

    You have mentioned you want to read only text files.
    If you are referring to some specific set of extentions, you can filter based on that.
    ex: you want to read only .txt files, you can add an if condition as below :
              if(textfiles.getName().endsWith(".txt")) {
                  // Add your code here
    Cheers
    AJ

  • Has anybody read the Windows user from an Oracle Form?

    Hi
    Has anybody read the Windows Login from an Oracle Form?
    Regards,
    Néstor Boscán

    in 6i, u can use d2kwutil
    in 9i/10g use webutil. Search in this forum and u can see the previous posting.
    Rajesh

  • Printing formatted text from an Oracle form

    I'm trying to print formatted text from an Oracle form without using the standard menu print. The print button on the menu prints out the text and the actual form. I just want to print the text that is displayed on the form. I would like to add a print button to the form. Is there a print function or event in PL/SQL?
    Thanks in advance for any help!!
    Jason

    If you are interested in the content of the field you can loop over them (next_item built in) and write their content into a file using the TEXT_IO built in.
    for nicer outputs check out Oracle Reports on OTN.

  • How to display a calendar from an Oracle Form?

    When Microsoft Outlook is opened, is it possible to display the folder contining the user's calendar? What is the necessary code to do this? I want to be able to display the calendar and let the user enter information, delete information, view information, and update information. Can this be done from an Oracle Form? Could code be put in a When-Button Trigger to do this function?

    When Microsoft Outlook is opened, is it possible to display the folder contining the user's calendar? What is the necessary code to do this? I want to be able to display the calendar and let the user enter information, delete information, view information, and update information. Can this be done from an Oracle Form? Could code be put in a When-Button Trigger to do this function?

  • Show the print dialog when running a report from an Oracle form.

    I would like to be able to print an Oracle report from an Oracle form but
    in addition show the print dialog. My PL/SQL code is shown at the bottom of this post.
    I have set the 'printjob' system parameter to 'YES' in the
    report and I can bring up a print dialog using the reports runtime.
    However, as soon as I run it from my form I lose this capability. Setting
    'printjob' to 'YES' in the code has no apparent effect.
    Many thanks,
    Ben
    -- Launch a report
    DECLARE
      v_pl_Id   paramlist; -- parameter list
    BEGIN
      -- add the parameters to the list.
      v_pl_id := CREATE_PARAMETER_LIST ('summary');
      ADD_PARAMETER (v_pl_id, 'destype', text_parameter, 'PRINTER');
      ADD_PARAMETER (v_pl_id, 'printjob', text_parameter, 'YES');
      -- run the report
      RUN_PRODUCT (
        reports
      , 'C:\Test Reports\Test.rep'
      , synchronous
      , runtime
      , filesystem
      , v_pl_id
      , NULL
    END;

    At 10g not 9i using a bean area on my canvas implementing the following class ...
    import java.awt.Frame;
    import java.awt.JobAttributes;
    import java.awt.PrintJob;
    import java.awt.Toolkit;
    import javax.swing.JPanel;
    import java.io.*;
    import oracle.forms.ui.VBean;
    public class Select_Printer extends VBean {
    public Select_Printer()
         super();
    public String getPrinterName()
    String PrinterName=null;
              JobAttributes jobAttributes;
              try{
                   jobAttributes = new JobAttributes();
                   jobAttributes.setDialog(JobAttributes.DialogType.NATIVE);
                   Frame dummyFrame = new Frame();
                   PrintJob pJobDialog = Toolkit.getDefaultToolkit().getPrintJob(
                   dummyFrame, "Printtest", jobAttributes, null);
                   PrinterName = jobAttributes.getPrinter();
              } catch (Exception e) {
                   System.out.println("Printer error!");
              return PrinterName;
    public static void main(String[] args)
    Select_Printer select_Printer = new Select_Printer();
    System.out.println(select_Printer.getPrinterName() );
    }

  • Error while calling standard OAF page from custom Oracle Form

    Hi,
    I am calling standard OAF page from custom oracle form using the following code.
    FND_FUNCTION.EXECUTE(FUNCTION_NAME=>'FUN_TRX_ENTRY_OUT_VIEW_BATCH',
    OPEN_FLAG =>'Y',
    SESSION_FLAG =>'N' ,
    OTHER_PARAMS =>'&ViewBatchID = "' || NAME_IN('FUN_AGIS_LINE_D.BATCH_ID') ||
                        '&CallingFunction = "' || 'MANEXPINQ' ||'"');
    But I am getting this error.
    oracle.apps.fnd.framework.OAException: This request was not processed as the request URL %2FOA_HTML%2FOA.jsp%3Fpage%3D%2Foracle%2Fapps%2Ffun%2Ftransaction%2Fentry%2Fwebui%2FViewOutBatchPG%26OAPB%3DFUN_PRODUCT_BRAND%26OAHP%3DFUN_SSWA_MENU%26OASF%3DFUN_TRX_ENTRY_OUT_SEARCH%26_ti%3D1217029204%26language_code%3DUS%26%26ViewBatchID%20%3D%20%22203148%26CallingFunction%20%3D%20%22MANEXPINQ%22%26CallFromForm%3D%27Y%27%26oas%3DqZqg3tmdEdUNyw_HtskVow.. contained potentially illegal or un-encoded characters. Please try again by submitting a valid URL or contact your systems administrator for assistance.
    Please let me know any thing I missed out here.
    Any suggestion will highly appreciated.
    Thanks & Regards,
    Sunita

    I am using FND_FUNCTION.EXECUTE to call a OAF page from PLSQL in R12. I am getting following error"Error(9,23): PLS-00302: component 'EXECUTE' must be declared"

  • Calling a Database Procedure from an Oracle Form

    Hi,
    I have a question we will be calling the procedure from an Oracle form and through that can we pass like 1000 input values to this procedure and we need to return certain values back to the Oracle Form also. Here the proceduere take two or more parameters. Please advice.
    To receive the input values we have the input parameter of the procedure as type object, so that we can receive multiple parameter values.
    Thanks and Regards
    Srinivas

    user2626293 wrote:
    Hi Francois,
    Thanks for your response, please suggest me as to how we can acheive passing of parameters which can hold multiple values, while making a call to the database procedure from the Oracle Form
    Hi Srinivas,
    Here is an example of procedure...
    CREATE OR REPLACE PROCEDURE P_GET_SAL (P_EMPID NUMBER, P_SAL OUT NUMBER)
    IS
    BEGIN
         SELECT SALARY
         INTO P_SAL
         FROM EMPLOYEE
         WHERE EMPLOYEE_ID=P_EMPID;
    END;
    SQL> VAR G_SAL NUMBER;
    SQL> EXEC P_GET_SAL(100,:G_SAL);
    PL/SQL procedure successfully completed.
    SQL> PRINT G_SAL;
    G_SAL
          2300Hope this helps
    Hamid
    If someone's response is helpful or correct, please mark it accordingly.*

  • Passing a parameter to a view from an Oracle Form ?

    Hello,
    Can I create a view on the database which takes a in a parameter from an Oracle form.
    If yes then what is the syntx , please let me know.
    Thanks
    IQ

    There are ways to simulate a 'parameterized view'.
    Create your view and have it reference some value in an application context (look up in the manuals "application context feature").
    Then from your Form, just prior to selecting from the view, make sure you set the value in your sessions' application context.

  • I need to make button which made a spool from my oracle forms 2.1

    i need to make button which made a spool from my oracle forms 2.1
    how can i do that
    thanks alot

    Wow, you just said the same thing. First, when you say "Forms 2.1" do you mean "Developer 2.1", which included Forms 5.0? Regardless, are you aware that these Forms versions are about 15 or more years old?
    What you are trying to do is still unclear. Are you trying to output records to a text file formated to csv? If you need assistance, please provide some clarification as to what you are trying to accomplish.

  • Validate from list (Oracle Forms)

    Hi all,
    Does anybody know, how to simulate "Validate from List" functionality from the oracle forms with JDeveloper 10.1.3.
    The case is for example (Empl, Dept), I want to create a table for the empl showing the empl info plus department name and allow the user assign the empl to a given department using only the name and not the department id.
    Many thanks in advance.
    Edited by: user5772728 on Feb 20, 2009 8:56 AM

    Hi,
    there is no list validator like this I am aware of.
    Frank

  • SENDING MASSIVE EMAILS FROM AN  ORACLE FORM

    Has anybody been able to send large amounts of email from an Oracle form,
    say 9,000 or more eamil addresses?
    I have been able to go in access MICROSOFT OUTLOOK, open up a new email
    message and have the recipient line preformatted with less than two thousand
    email addresses but I get an error when I try to preformat the the recipient line
    with more than four thousand email addresses.
    The error that I get is ORA-06502 AND FRM-40735.
    Does anybody have any ideas?

    Mail transport protocols may well be capable of handling an email message having nine thousand recipients, but your mail client, mail server, or organizational policies will likely introduce limits of their own, never mind the artificial constraints imposed by Oracle datatypes. If your requirements permit the approach of sending multiple messages of, say, one thousand recipients each, I would suggest that. If not, I would suggest re-evaluating your requirements -- refusing to define some reasonable threshold is asking for trouble.

  • How to run a DOS command from an Oracle form.

    How can I run a DOS command from an Oracle form (i.e. open the calculator located at c:\windows\system32\calc.exe)?

    first of all get the environment variable for the c:\windows\system32 direcotry for any of the windows
    you can use get variable from the ora env package
    now cancat the system32 variable with the calc.exe string
    now pass the string with host command as parameters
    this process will work for all type of windows.

Maybe you are looking for

  • 4.2 select list on mobile page not setting session state

    Hi, Like I've done dozens of times in the past, I created a Select list that submits on change, and I expected session state to be updated accordingly. I tried this on a mobile page but session state is not updated for the item. Has anyone else exper

  • How to skip the fact table  /BI0/9AEDFC01 error  while import phase in Heterogeneous migration

    Hi. Please  find the below  issue of the fact table while import phase in OS/DB migration and enclosed the below log for  reference. /usr/sap/AQ2/SYS/exe/uc/linuxx86_64/R3load: START OF LOG: 20140924185259 /usr/sap/AQ2/SYS/exe/uc/linuxx86_64/R3load:

  • How to send huge no. of excel sheet attachment to a mail ID

    HI ,         I have mail functionality program which send mail to a mail id with multiple excel sheet attchment. I have done all these things.  When it sends small number of excel attchment  then it's ok. But when  it sends huge number of excel attch

  • SAP-ISU - Equipment number from installation

    Hi All, Regarding SAP - ISU. How to fine Equipment number from installation. Is there any table or function module. Please let me know. Please mail to *msrinuvas@gmail. com                        [email protected] * Thanks in Advance ! Regards, Srini

  • Link Aggregation and OS X Server

    Hello. I'm moving my servers (3 x Intel Xserves running 10.5.6) to a new location with all new network hardware (wiring, switches, routers, etc.) and I'm now considering using link aggregation on the Xserves (the previous switches didn't support it w