Urgent Help Needed regd reading a file in apex

Hi all,
I need to know how can we store content of a file in a variable or any item(like text box).
i have a os user name in the file.
when i use apex_util.get_file it is opening in new page.
instead i want it to stored in a text box or any variable.
cany any one help me on this.
Thanks in advance,
Srini
Message was edited by:
user650963

Hi Srini,
You can use the normal file upload functionality to do this.
1 - Create a page region and add in a File Browse item - I'll call it P1_FILE_NAME
2 - Create a button in that region, I'll call it P1_UPLOAD_BUTTON, and set it to branch back to the same page
3 - Create a TextArea item - I'll call it P1_FILE_CONTENTS
4 - Create a page process, called P1_UPLOAD_FILE, and triggered by the P1_UPLOAD_BUTTON
5 - Use the follownig code for the process:
declare
v_clob clob;
v_blob blob;
v_varchar2 varchar2(30000);
BEGIN
SELECT blob_content into v_blob FROM APEX_APPLICATION_FILES where name = :P1_FILE_NAME;
v_clob := wwv_flow_utilities.blob_to_clob(v_blob,'utf-8');
:P1_FILE_CONTENTS := wwv_flow_utilities.clob_to_varchar2(v_clob);
:P1_FILE_NAME := '';
delete from APEX_APPLICATION_FILES WHERE NAME = :P1_FILE_NAME;
END;When you select the file and click the Upload button, the file is uploaded into the APEX_APPLICATION_FILES table. The contents of the file is put into a BLOB field. The above code, converts that BLOB into a CLOB and then into a VARCHAR2 value - you can then change P1_FILE_CONTENTS to that value. Finally, the code removes the file from the table and resets the File Browse field.
Note that this assumes that the file contains nothing but text and is no more than 30,000 characters in length.
Andy

Similar Messages

  • Urgent help needed - writing/ reading to/from file

    hi all..
    can anyone help me with this problem:
    The problem dioscussed in www.javaworld.com forum
    any clues what the problem is??

    hi all...
    i managed to get the gui set up, and the JList is finally loading the data,
    yet, i am having problems with displaying relevant data of each item in the list...
    could you please help??
    // required imports
       import javax.swing.*;
       import java.awt.*;
       import java.awt.event.*;
       import javax.swing.event.*;
       import java.io.*;
       import java.util.*;
    // ViewPanel class: the panel for the view pane. handles its own events.
       public class ViewPanel extends JPanel implements ListSelectionListener
          private JList list;
          private DefaultListModel listModel;
          private JButton deleteButton;
          private TicketStorage data;
       // add pane items
          private JLabel seat, seatData;
          private JLabel name, nameData;
          private JLabel duration, durationData;
          private JLabel price, priceData;
          private JCheckBox waiterService;
       // creating panels
          JPanel p1 = new JPanel();
          JPanel p2 = new JPanel();
          public ViewPanel(TicketStorage data)
          // store data structure reference
             this.data = data;
             TrainTicket[] summary = data.summary();         
             listModel = new DefaultListModel();
             for (int i = 0; i < summary.length; i++)
                listModel.addElement(summary.getSeat());
    list = new JList(listModel);
    list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    list.setSelectedIndex(0);
    list.setVisibleRowCount(5);
    JScrollPane listScroller = new JScrollPane(list);
    listScroller.setPreferredSize(new Dimension(100, 150));
    seat = new JLabel("Seat No:");
    seatData = new JLabel();
    name = new JLabel("Name:");
    nameData = new JLabel();
    duration = new JLabel("Duration:");
    durationData = new JLabel();
    price = new JLabel("Price:");
    priceData = new JLabel();
    // create add pane items
    waiterService = new JCheckBox("Waiter Srevice");
    waiterService.setEnabled(false);
    // waiterService.addActionListener(boxListener);
    JButton deleteButton = new JButton("Delete");
    // deleteButton.addActionListener(buttonListener);
    // adding listeners to the components
    //deleteButton.addActionListener(this);
    //waiterService.addActionListener(this);
    list.addListSelectionListener(this);
    // adding the components to their coreesponding panels
    p1.setLayout(new GridLayout(5,1));
    p1.add(seat);
    p1.add(name);
    p1.add(duration);     
    p1.add(price);
    p1.add(waiterService);
    p2.setLayout(new GridLayout(5,1));
    p2.add(seatData);
    p2.add(nameData);
    p2.add(durationData);     
    p2.add(priceData);
    p2.add(deleteButton);
    this.setLayout(new GridLayout(1,3,3,0));
    this.add(listScroller);
    this.add(p1);     
    this.add(p2);
    public void valueChanged(ListSelectionEvent e)
    if (e.getValueIsAdjusting() == true)
    // enable the delete button when an item is selected
    deleteButton.setEnabled(true);
    // retrieve the sellected seat number value
    String itemSellected = listModel.getElementAt(list.getSelectedIndex()).toString();
    // retrieve the ticket with the sellected seat number
    TrainTicket tk = data.retrieve(itemSellected);
    // load the relevant data of a sellected ticket
    seatData.setText(tk.getSeat());
    nameData.setText(tk.getName());
    durationData.setText(Integer.toString(tk.getDuration()));
    priceData.setText(Double.toString(tk.getPrice()));
    /*/ if the selected ticket of type first class
    if(tk instanceof FirstClassTicket)
    if(((FirstClassTicket)tk).getWaiter()==true)
    waiterService.setSelected(true);
    waiterService.setEnabled(true);
    else
    waiterService.setSelected(false);
    waiterService.setEnabled(true);
    else
    waiterService.setSelected(false);
    waiterService.setEnabled(false);
    the application runs, it loads the data available in the linked list,
    yet, on switching from an item to another in the list, it keeps generating errors!!!
    in addition to the fact that it does not display the data!!
    for more info refer to the url in my first post!
    any clues??

  • Help needed in reading text file to database table

    Hello experts,
    i have to insert the values from the column of this text file and insert them in my database table.
    I have done a few file to table insertions but i'm having some trouble with this one.
    Any suggestions plz
    thanks
    liab_report      1.00                                                                                                                              Page: 1
    CDC:00537 / Mon Jun-21-2010                           LIABILITY REPORT                               Mon Jun-21-2010 22:06:26
    DRAW    1; SET    1;  November 7, 2009
                         TOTAL       PAID ON         TOTAL    EXPIRED ON         TOTAL    FRAC   OUTSTANDING
                       WINNERS      06/21/10          PAID      06/21/10       EXPIRED   ROUND
      DIVISION          AMOUNT        AMOUNT        AMOUNT        AMOUNT        AMOUNT  AMOUNT        AMOUNT
        Div1              0.00          0.00          0.00          0.00          0.00    0.00          0.00
        Div2         701040.00          0.00     660146.00          0.00      40894.00    0.00          0.00
        Div3        1444128.00          0.00    1330056.00          0.00     114072.00    0.00          0.00
        Div4        4711900.00          0.00    3889700.00          0.00     822200.00    0.00          0.00
                    6857068.00          0.00    5879902.00          0.00     977166.00    0.00          0.00
    DRAW    2; SET    1;  November 14, 2009
                         TOTAL       PAID ON         TOTAL    EXPIRED ON         TOTAL    FRAC   OUTSTANDING
                       WINNERS      06/21/10          PAID      06/21/10       EXPIRED   ROUND
      DIVISION          AMOUNT        AMOUNT        AMOUNT        AMOUNT        AMOUNT  AMOUNT        AMOUNT
        Div1              0.00          0.00          0.00          0.00          0.00    0.00          0.00
        Div2         817817.00          0.00     817817.00          0.00          0.00    0.00          0.00
        Div3        1687405.00          0.00    1611742.00          0.00      75663.00    0.00          0.00
        Div4        3402100.00          0.00    3034200.00          0.00     367900.00    0.00          0.00
                    5907322.00          0.00    5463759.00          0.00     443563.00    0.00          0.00
    DRAW    3; SET    1;  November 21, 2009
                         TOTAL       PAID ON         TOTAL    EXPIRED ON         TOTAL    FRAC   OUTSTANDING
                       WINNERS      06/21/10          PAID      06/21/10       EXPIRED   ROUND
      DIVISION          AMOUNT        AMOUNT        AMOUNT        AMOUNT        AMOUNT  AMOUNT        AMOUNT
        Div1              0.00          0.00          0.00          0.00          0.00    0.00          0.00
        Div2         779933.00          0.00     769804.00          0.00      10129.00    0.00          0.00
        Div3        1605548.00          0.00    1525104.00          0.00      80444.00    0.00          0.00
        Div4        4891700.00          0.00    4256800.00          0.00     634000.00    0.00        900.00
                    7277181.00          0.00    6551708.00          0.00     724573.00    0.00        900.00

    Plz clarify whether u want to load text file as a file into database or value of this text file into database. If values are to be loaded from this text file, U can better format the text file and use SQL loader to load the file into database. By formatting the database, i mean remove the unnecessary headings and characters, kee only the values to be loaded idelimited by ' '(space) or ','(comma). Create a control file and load it into the target table.

  • Urgent help needed with reading data from Cube

    Hi Gurus,
    Can anyone tell me how to read a value from a record in the CUBE with a key (combination of fields).
    Please provide if you have any custome Function Module or piece of code.
    Any ideas are highly appreciated.
    Thanks,
    Regards,
    aarthi

    Due to the nature of the cube design, that would be difficult, that's why there are API's, FMs, and MDX capabilities - to eliminate the need to navigate the physical structure.  Otherwise you would have to concern yourself with:
    - that there are two fact tables E and F that would need to be read.  The Factview could take of this one.
    - you would want to be able to read aggregates if they were available.
    - the fact table only as DIM IDs or SIDs (for line item dims) to identify the data, not characteristic values.  A Dim ID represents a specific combination of characteristic values.

  • Urgent HELP Needed Compressing 24 fps file to DVD m2v

    I am working in a project where all the source footage is 24fps film (in 720x486 uncompressed 8 bit QT files). I have edited the footage in FCP6 with the sequence at matching settings to the source footage. Every thing good so far.
    I then export out a reference file of the final edit. Review the ref file and all is beautiful.
    The problem occurs with I use compressor to convert the 24 fps to m2v. I use one of Apples default settings (DVD Best Quality 90 Minutes), drop the setting on the clip in the asset window and verify the settings, which in the summary show frame rate of 23.976. OK. Submit.
    When the compression is complete, and I bring the new asset into DVDSP, the rate now shows 29.97 (open in QT confirms), and the clip stutters in play back.... i.e. dup frame every 5 frames. On the second try, I don't get dup frames, but I actually got frames dropped every few seconds. i.e. frame advance in DVDSP and the video would skip a frame. The later is extremely noticeable on panning shots.
    Can any one give me some advice on how to keep the video smooth and consistent with the original footage?
    Any help or suggestions would be EXTREMELY appreciated as this project HAS to go to press tomorrow.
    Thanks,
    Gary

    OK, After a very long night with no end near, I figured out the drop frames are the result of feeding 24fps into Compressor instead of 23.98.
    I took the footage conformed the clips to 23.98 and that particular problem was resolved....
    However, conforming introduced a whole new problem: When I conform the clips, 2 black frames are introduced at EXACTLY frame 7900. I have 4 tracks of similar footage, with different language tracks. There are English, French, Spanish and German sequences. The German track is edit differently than the other 3 due to very different timing in the translation. The other three are virtually identical to the point where the black frames are introduced.
    That being said, ALL 4 tracks have the black frames appear at frame 7900 regardless of the video content.
    These are NTSC (720x480 24 fps with uncompressed 8 bit video).
    Oddly enough, if I drop the NTSC sequence onto a PAL 24fps uncompress 8 bit sequence, the black frames do not seem to appear after the PAL tracks are conformed to 25 fps. I have not found any anyway....
    Any thoughts on why I am getting this problem?
    As a result, we have had to postpone the glass mastering, and needless to say, the producer is not at all pleased...
    Thanks for any input.
    Gary

  • Urgent help needed, can I restore N900 Backup file...

    i owned a N900 (now sold out)
    before selling i took backup of contacts from backup restore option in application section
    now i bought a N8 but i m not able to restore my contacts
    1. is there any way to restore them in N8?
    2. if not, can i convert them in TEXT or any readable format
    urgent help needed
    thanks in advance

    The backup procedures built into the phone are only designed for restoring to the same phone (ie: in case or data corruption, software update or repair etc.), they can't usually be used to restore to a phone with a different operating system.
    You should have backed up with Ovi Suite before selling the N900, that would have been able to restore to the N8.

  • Urgent help needed - new to Macs, accidently cut and paste over top of photo folder and now no sign of folder or file, no auto back-up in place, how can I restore photos pls

    Urgent help needed - new to Macs, accidently cut and paste over top of photo folder and now no sign of folder or file, no auto back-up in place, how can I restore photos pls

    Thanks for prompt reply, yes we have tried that but have now closed down the browser we where the photos were.
    We haven't sent up time machine, do you know whether there is any roll-back function on a Mac?
    Thanks

  • URGENT HELP NEEDED ... Tomcat Realm and JRE1.4 plug-in problem

    I have tried the Security Realm of Tomcat. Since I do not have
    an LDAP server, I decided to use the Tomcat-users.xml file in
    Tomcat\conf directory.
    I added the following lines of code in the web.xml file.
    <security-constraint>
    <web-resource-collection>
    <web-resource-name>Entire Application</web-resource-name>
    <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
    <!-- NOTE: This role is not present in the default users file -->
    <role-name>webviewer</role-name>
    </auth-constraint>
    </security-constraint>
    <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>Tomcat Manager Application</realm-name>
    </login-config>
    The <role-name> "webviewer" is added into "Tomcat-Users.xml" as the following:
    <tomcat-users>
    <user name="test" password="password" roles="webviewer" />
    </tomcat-users>
    So, now when we type the url: http://localhost:8080/adbpdbre/default.htm, TOMCAT shows a dialog box asking for UserName: and Password:Now, only when we give the username and password, it shows the page. This is exactly what we want.
    But the problem now is, this default.htm page, has 5 links to 5 applets. The first time that I click on one of these links, the JRE plug of 1.4 shows a dialog again asking for the username and password. Till I dont provide the username and password the system doesnt go ahead and applet doesnt load. I do not want the JRE to ask me for the username/passwords again..How to avoid this ?
    Can you give me some more information on this. Ultimately in the production usage, we will be using LDAP and not Tomcat's memory realm.
    URGENT HELP NEEDED ... I need to get back to my client on this.
    Help would be v. much appreciated.

    In the config file, you 're essentially saying that you want Tomcat to prompt for usr/passw on every request (url-pattern = /*) made by a 'webviewer', and that's exactly what Tomcat is doing.
    Consider using specific url-patterns & roles for resources to be protected. If for now, all you need is to protect the first page, use a more specific url-pattern.
    Just an advice : if you'll be using LDAP in production, do not waste time with Tomcat's Security Realm and the BASIC authentication type, since the two have not much in common. Start reading doc on LDAP, and code a prototype, or even better, a vertical slice of the app (i.e a proof of concept).

  • URGENT HELP NEEDED - iPhone 3Gs no longer detected or charged by MacBook

    My iPhone 3Gs (3.1) has been running fine, until several hours ago today, when I plugged it to my MacBook, the iPhone is no longer detected - it doesn't show up in iTunes, nor it is charged. I tried opening iPhoto, and it wasn't there too. Not with Image Capture too. I tried charging it using the out-of-box wall charger using the same out-of-box USB cable I use for MacBook, and it can be charged without any problem. Then I put it into Recovery mode, and there iTunes can see it. I don't want to restore it before I figure out exactly what went wrong, as I don't want the restore process somehow gets stuck in the middle that the connection is lost again.
    I've tried reinstalled iTunes, including completely removal of Apple Mobile Device Support, as instructed by Apple. But still no luck.
    I've tried switching to another USB port of my MacBook. No luck.
    My iTunes is the latest 9.0.1, and my Mac OSX is 10.6.1. My iPhone is on 3.1, upgraded from 3.0.
    I've read from web that it seems I'm not the only one out there having this problem. But none of them seem having any real working solution.
    Urgent help needed & appreciated. Millions of thanks in advance.
    Gary

    1. I used both cables - theirs & mine ... and on several macs
    2. yes, same cable for wall & mac
    3. as said, i did completely remove & install itunes (incl. apple mobile device support), as instructed on the apple webpage
    anyway, did a restore just now. it seems okay now. but the problem is i have no idea what cause this, and i can't replicate the problem. so i don't know when it will happen again ... maybe a bug with os 3.1 ... others on web said os 3.1 is quite buggy ...

  • Urgent help needed with un-removable junk mail that froze Mail!!

    Urgent help needed with un-removable junk mail that froze Mail?
    I had 7 junk mails come in this morning, 5 went straight to junk and 2 more I junked.
    When I clicked on the Junk folder to empty it, it froze Mail and I can't click on anything, I had to force quit Mail and re-open it. When it re-opens the Junk folder is selected and it is froze, I can't do anything.
    I repaired permissions, it did nothing.
    I re-booted my computer, on opening Mail the In folder was selected, when I selected Junk, again, it locks up Mail and I can't select them to delete them?
    Anyone know how I can delete these Junk mails from my Junk folder without having to open Mail to do it as it would appear this will be the only solution to the problem.

    Hi Nigel
    If you hold the Shift key when opening the mail app, it will start up without any folders selected & no emails showing. Hopefully this will enable you to start Mail ok.
    Then from the Mail menus - choose Mailbox-Erase Junk Mail . The problem mail should now be in the trash. If there's nothing you want to retain from the Trash, you should now choose Mailbox- Erase Deleted Messages....
    If you need to double-check the Trash for anything you might want to retain, then view the Trash folder first, before using Erase Junk Mail & move anything you wish to keep to another folder.
    The shift key starts Mail in a sort of Safe mode.

  • IPhone 3G 8GB Crashes when syncing with iTunes. URGENT HELP NEEDED.

    I have latest iTunes and OS on my iPhone 3G...
    Every time i plug my iPhone in it begins to sync and then iTunes will freeze and not respond..
    I have tried re installing iTunes.. I can't reset my iPhone as i can't create a backup..
    URGENT HELP NEEDED PLEASE!

    I don't have an iphone, but if it's anything like my click-wheel ipod, a reset doesn't delete anything.
    It just resets the ipod's operating system, kind of like a PC restart. Did you try this Sleep/Wake button thing mentioned here?
    http://support.apple.com/kb/HT1737
    Maybe it's a podcast of voice memo causing the problem like it did for this person
    http://discussions.apple.com/message.jspa?messageID=10907809#10907809
    That's all I got. You might have better luck on an iPhone forum. Everyone there would probably have one. Like I said, I don't.

  • Computer restarts when ipod is connected urgent help needed

    alright this is weird, I've had my ipod for ages and suddenly I go to plug it in and the computer slows down really really really slow and eventually just turns it self off, restarts and then sits in a black screen. if I leave the ipod plugged into the computer and restart it again it just goes straight back to the black screen, but both my ipod and computer work fine when there not connected. i have the latest version of itunes which seemed to help the first time i tried it actually started to update the ipod but then guess what the computer has another heart attack. urgent help needed please!!!

    if I leave the ipod plugged into the computer and restart it again it just goes straight back to the black screen
    Given this, I'd put it down to a flaky power supply in the computer. Might want to try using another computer or replacing the PSU.

  • Need to read text file content and have to display it in multiline text box

    dear all,
    Need to read text file content and have to display it in multiline text box.
    actually im new to file handling. i have tried up to get_line and put_line.
    in_file := TEXT_IO.FOPEN ('D:\SAMPLE.txt', 'r');
    TEXT_IO.GET_LINE (in_file,linebuf);
    i dont know how to assign this get_line function to text item
    pls help me in this regards,

    Simply write:
    in_file := TEXT_IO.FOPEN ('D:\SAMPLE.txt', 'r');
    TEXT_IO.GET_LINE (in_file,linebuf);
    :block2.t1 := chr(10)||:block2.t1||chr(10)||linebuf;
    chr(10) --> is for new line character

  • Data uload to ODS ending up with an error. URGENT HELP NEEDED!!!!!!

    Hi
    My Sceniro is Full load from ODS1 to 5 other ODS. Iam uploading the data to other 5 ODS by selecting 1 ODS at a time.
    Problem i am facing is upload is ending up with error mesg. Error Mesg are
    <b>Error 8 when starting the extraction program - R3019
    Error in Source System - RSM340
    Req xxx in ODS2 must have QM ststus green before it is activated - RSM1110</b>
    I have seen the the OSS notes for given error no, but they are not applicable to me. what could be the other possible solution.
    In detail tab of the monitor i see red light at Extraction step and Subseq. processing.
    Its quite urgent bcoz this error is occuring in Production system.
    Plzzzz urgent help needed.
    Thanks
    Rohini
    Message was edited by: Rohini Garg

    rohini,
    go to RSA1->Modeling->Source Systems and right-click on your BW system, and click on 'Replicate Datasources'.
    also, go to the ODS that's causing the problem (via RSA1->InfoProvider and go to your ODS), right click and click on 'Generate Export Datasource'.
    one more thing, make sure that all your record/s in the source ODS is active. if you're not sure manage its contents and click on 'Activate'. if there are any entries in the the next screen that comes up, you need to activate it first, then try everything again.
    let me know what happens. also try to look for error messages in ST22 and SM21 that may be related to this and post whatever possible error you see there here.
    ryan.

  • Help needed with Reader Integrated Key

    Hi,
    I have develop a plug-in and apply for Reader Integrated Key License. This plug-in have been tested with acrobat and reader professional and it is working.
    I follow the advice from the above website and use RIKLATools.zip to created the pair.
    i have just receive the Reader Integrated Key from Adobe,I tried all method but the key  does not work with the plug-in. What is the fool proof way to integrate my Reader Integrated Key with the plug-in to get a digtally signed plug-in?
    Urgent help needed as we are submitting the plug-in to client.
    many Thanks in advance
    Regards
    Jia hao

    Thank you lrosenth, i will email them

Maybe you are looking for

  • How to make sure that two VC Ethernet modules are redundants

    Hi , we have a blade  encluser has 16 servers and two ethernet module each ethernet  port is configured as a single SUS , So if one of module is failed  we are expected we will lost network connectivity of these ports I read many senarios  but all de

  • 2 edi question

    hi, 1) i have 2 programs which create idoc using master_idoc_distribute. what i not understand is that, for program 1, it checks edidc, if found the entry, checks against the nast entry. if no then insert and followed by submit rsnast00 whereas anoth

  • Horrible audio quality

    Not sure if anyone else is having this problem, but since the latest version release of Skype for Mac - I am having horrible issues with my audio on Skype. I can barely hear the other person on the end of the Skype call. I've trouble shot this with A

  • Access issue relating to external content types

    Hi, I was recently given permissions in the Central Administration to edit external content types. However, when I open Sharepoint Designer and click on External Content types, I am unable to view the existing external content types that was created

  • Setting Portrait mode instead of landscape

    Hi, not very very familiar with Keynote but I wanted to create a presentation that will run in portrait mode rather then typical landscape mode. I think you need to be able to change the aspect ratio but i dont know know where to do that. In the new