HTMLDB_APPLICATION_FILES

Hi,
I am using APEX 2.0 (not bundled with Database Express).
I issued the following sql in SQL Developer:
select id, name from htmldb_application_files;
I get zero rows returned.
I then created a Reports region in APEX with the same sql statement and I get 4 rows returned.
Does anybody know why this is happening?
I am following the tutorial for uploading/downloading files.
Thanks
VC

If you look at the query behind that view, it has
    FROM wwv_flow_file_objects$
   WHERE security_group_id = wwv_flow.get_sgid;In other words, it only shows you records appropriate to the context in which you run it.
So when you query htmldb_application_files from within the Apex application builder environment (or your own application), it returns data. But when you run it in SQL*Plus or SQL Developer, wwv_flow.get_sgid returns null so the query returns no rows.
This is normal, go ahead and follow the tutorial, it works fine.

Similar Messages

  • SQL*Loader and HTMLDB_APPLICATION_FILES

    Hello!
    Can I use SQL*Loader for loading data from file stored in HTMLDB_APPLICATION_FILES as blob to tables in database? Files are always CSV in my case.
    Best regards,
    Tom

    Hello Maxim!
    Of course files are stored in HTMLDB_APPLICATION_FILES as blobs and of course I can do 'select blob_content from htmldb.....' - BUT I have to get text from this blob, and copy certain words from this blob, NOT the blob itself.
    Example: I have a file.csv. I upload it to HTMLDB_APPLICATION_FILES so it is stored there as a blob. Now I want copy data delimited by ';'(for example) to table in database.
    Any ideas?
    Best regards,
    Tom

  • Display Images from  HTMLDB_APPLICATION_FILES Table?

    How do I display images from the HTMLDB_APPLICATION_FILES Table?
    Are the contents full available potentially for display? Or only after I have written them to another display?
    Please advise what I need to do or what corrections below is required:
    The calling procedure is a item in a SELECT statement as part of a report query:
    <P>
    <(img src="#OWNER#.download_HAF_file?p_file=  ' || nvl(ID,0) || ' height="50" width="50" )>, HAFimg<P>
    The Procedure is a adaptation of the Chapter 8 Exercise of the 2 day developer guide:
    CREATE OR REPLACE PROCEDURE "DOWNLOAD_HAF_FILE" (p_file IN NUMBER) AS
         v_mime VARCHAR2(48);
         v_length NUMBER;
         v_file_name VARCHAR2(2000);
         Lob_loc BLOB;
    BEGIN
         SELECT MIME_TYPE, BLOB_CONTENT, NAME, DBMS_LOB.GETLENGTH(BLOB_CONTENT)
         INTO v_mime, lob_loc, v_file_name, v_length
         FROM HTMLDB_APPLICATION_FILES
         WHERE ID = p_file;
         -- set up HTTP header
         -- use an NVL around the mime type and
         -- if it is a null set it to application/octect
         -- application/octect may launch a download window from windows
         owa_util.mime_header( NVL(v_mime,'application/octet'), FALSE );
         -- set the size so the browser knows how much to download
         htp.p('Content-length: ' || v_length);
         -- the filename will be used by the browser if the users does a save as
         htp.p('Content-Disposition: attachment; filename="'||SUBSTR(v_file_name,INSTR(v_file_name,'/')+1)|| '"');
         -- close the headers
         owa_util.http_header_close;
         -- download the BLOB
         wpg_docload.download_file( Lob_loc );
    END Download_HAF_File;
    /Message was edited by:
    luddite1812

    I believe you put HTML "pre" tags around your quote (with square brackets, I can't type them here because they'll be escaped).
    If the example below looks formatted then using "pre" works, if not...then ignore me ;)
    begin
      select
        count(*)
      into
        v_count
      from big_table;
    end;

  • HTMLDB_APPLICATION_FILES and .docx

    Hello All,
        I have a program that uses htmldb_application_files to upload documents to a database. It works fine with .doc documents, but does not work with .docx documents.
    Any input would be greatly appreciated. Thanks in advance!
    Sharon

    None. One is just a synonym for the other.

  • Difference between WWW_FLOW_FILES and HTMLDB_APPLICATION_FILES

    Morning Forum,
    An application I am putting together contains records with jpeg images.
    A book I have suggests importing them into WWV_FLOW_FILES while some Oracle literature I read suggests using HTMLDB_APPLICATION_FILES.
    What is the difference between these two approaches?
    thanks,
    Brett

    Brett,
    They are essentially the same thing. HTMLDB_APPLICATION_FILES is a synonym on top of database view WWV_FLOW_FILES.
    Not to confuse you even further, but new in Application Express 2.2, there is yet another synonym called APEX_APPLICATION_FILES on top of database view WWV_FLOW_FILES. All of the views and public APIs had APEX_ equivalents created in 2.2.
    If you're using HTML DB 2.0, use HTMLDB_APPLICATION_FILES. That's what is documented and supported.
    Joel

  • Size limit for files uploaded to htmldb_application_files

    Hi,
    Is there any size limit for files which are to be uploaded to htmldb_application_files (and then stored as BLOB in db)?
    Regards,
    Tom

    Hi Tom,
    the only limitation is that the BLOB data type is 4GB
    large.
    So you can store max. 4 GB data in BLOB.Did you mean BFILE? Depending on the version, size limit is between 8TB and 128TB, as in the 10g2 documentation:
    PL/SQL LOB Types
    C.

  • Access to file in HTMLDB_APPLICATION_FILES

    Hello,
    I have uploaded file to HTMLDB_APPLICATION_FILES and now I want to copy data from that file to a table in database.
    How can I do that?
    Thanks

    Hello,
    This tutorial describes how to access the uploaded file:
    http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b16376/up_dn_files.htm#CIHHEHCJ
    Of course, if you want to split up the content of the lob, you can access the lob througth dbms_lob package, parse the content and insert it into a table. See (for example) http://www.psoug.org/reference/dbms_lob.html
    Regards
    Stephan

  • How to recover HTMLDB_APPLICATION_FILES table

    We accidently deleted some data in the HTMLDB_APPLICATION_FILES table using
    delete from HTMLDB_APPLICATION_FILES table
    where....
    And now we want to recover the deleted information.
    Since HTMLDB_APPLICATION_FILES is a virtual table name, we can not even find the real table in the DB. Is there any idea to recover only the HTMLDB_APPLICATION_FILES table to avoid recovering the whole DB.
    Any one can help on this?
    Thanks.

    Hi, sspadafo
    Do you mean the delete query? We used
    where id < *****
    and lost the 'id>****' part, so, most records are deleted :(
    Now, we are trying to locate the flows_files.wwv_flow_file_objects$ table. In SQL*Plus we run the query
    SELECT owner, table_name FROM ALL_TABLES ORDER BY owner, table_name;
    but flows_files.wwv_flow_file_objects$ is not in the list.

  • Csv from htmldb_application_files to table

    Hi,
    Can anybody help me with procedure which copies data from csv file (stored in HTMLDB_APPLICATION_FILES) to table in database? This table has the same structure as csv file, I mean the same columns etc.
    I'm new to pl/sql and oae and I can't make it.
    I would really appreciate some help(code/link/advice).
    Thanks in advance!
    Tom

    try this link
    Re: Excel Upload.
    Hope it helps
    Ameya.

  • Does HTMLDB_APPLICATION_FILES exist in 1.5v

    I issued the SELECT id,name FROM HTMLDB_APPLICATION_FILES following an HTMLDB 1.6v documentation and returned Table/View does not exist . If it does'nt, which one exist in version 1.5
    Sirdeeq, wonders

    sirdeeq,
    Try WWV_FLOW_FILES instead.
    Sergio

  • Describe HTMLDB_APPLICATION_FILES pegs CPU

    logged in to OracleXE as SYSTEM
    in SQL command window, typed 'describe HTMLDB_APPLICATION_FILES', pressed Ctrl-Enter
    cpu is pegged at ~97%
    shutdown and restarted database, tried again, same results
    running on Windows XP
    describe ALL_USERS worked just fine
    describe HTMLDB_APPLICATION_FILES worked just fine in SQL*Plus
    tried one more time before submitting this post -- yep, pegged again @+90%

    Thanks, mcstock. This was reported earlier and has been taken care of in an upcoming release:
    Bug in the XE GUI
    Sergio

  • Defference between HTMLDB_APPLICATION_FILES and WWV_FLOW_FILES

    Hi,
    what is the difference between the tables HTMLDB_APPLICATION_FILES and WWV_FLOW_FILES?
    Thanks

    None. One is just a synonym for the other.

  • Where Store HTMLDB_APPLICATION_FILES the Files

    Hello,
    i have Oracle 10gXE installed and Upload a document to my Database. When i look in HTML_DB_APPLICATION_FILES i can see my document.
    But where store Oracle the Document on the Server??
    Thank for your help
    Message was edited by:
    user504575

    And how can i send my upload file with utl_mail ?
    Thank you.

  • Store \ Retrieve files from file system

    Hi to all!
    I would like to implement a solution for storing files uploaded via apex user interface to servers file system. As well I would like this files to be retrievable by apex users. I designed the following solution:
    For upload:
    1. Through file browse item user chooses file to be uploaded
    2. File goes to custom table (as BLOB)
    -- so far i would use apex Upload\Download files tutorial
    3. File(BLOB) would then have to be written to file system to some directory and file id would have to be written to some db table which holds pointers to files on file system
    4. delete file(blob) from custom table (from step 2)
    For download:
    1. user chooses link from some report region(based on table giving file pointers to files residing on file system)
    2. file identified with chosen file pointer is then inserted into blob column of some custom table in db
    3. from custom table with download procedure fie is finally presented to user
    4. delete file(blob) from custom table (from step 2)
    Using apex tutorial for Upload\Download files it is straitforward to get the files from db table or into db table using blobs. But i have not seen any example of using BFILE or migrating files from db to file system and vice versa.
    So some Q arise:
    a) How can I implement step 3 under For upload section above
    b) How can I implement step 2 under For download section above
    c) Is there any way to directly upload file to file system via apex user interface or to directly download file from file system via some report region link column?
    Please help!!!
    Regards Marinero
    Message was edited by:
    marinero

    marinero,
    Here is a procedure that will copy an uploaded file to the file system:
      Procedure BLOB_TO_FILE(p_file_name In Varchar2) Is
        l_out_file    UTL_FILE.file_type;
        l_buffer      Raw(32767);
        l_amount      Binary_Integer := 32767;
        l_pos         Integer := 1;
        l_blob_len    Integer;
        p_data        Blob;
        file_name  Varchar2(256);
      Begin
        For rec In (Select ID
                              From HTMLDB_APPLICATION_FILES
                             Where Name = p_file_name)
        Loop
            Select BLOB_CONTENT, filename Into p_data, file_name From HTMLDB_APPLICATION_FILES Where ID = rec.ID;
            l_blob_len := DBMS_LOB.getlength(p_data);
            l_out_file := UTL_FILE.fopen('UPDOWNFILES_DIR', file_name, 'wb', 32767);
            While l_pos < l_blob_len
            Loop
              DBMS_LOB.Read(p_data, l_amount, l_pos, l_buffer);
              If l_buffer Is Not Null Then
                UTL_FILE.put_raw(l_out_file, l_buffer, True);
              End If;
              l_pos := l_pos + l_amount;
            End Loop;
            UTL_FILE.fclose(l_out_file);
        End Loop;         
      Exception
        When Others Then
          If UTL_FILE.is_open(l_out_file) Then
            UTL_FILE.fclose(l_out_file);
          End If;
      end; And here is a procedure that will download a file directly from the file system:
      Procedure download_my_file(p_file In Number) As
        v_length    Number;
        v_file_name Varchar2(2000);
        Lob_loc     Bfile;
      Begin
        Select file_name
          Into v_file_name
          From UpDownFiles F
         Where File_id = p_file;
        Lob_loc  := bfilename('UPDOWNFILES_DIR', v_file_name);
        v_length := dbms_lob.getlength(Lob_loc);
        owa_util.mime_header('application/octet', False);
        htp.p('Content-length: ' || v_length);
        htp.p('Content-Disposition: attachment; filename="' || SUBSTR(v_file_name, INSTR(v_file_name, '/') + 1) || '"');
        owa_util.http_header_close;
        wpg_docload.download_file(Lob_loc);
      End download_my_file;I could put a sample application on apex.oracle.com, but it wouldn't be able to access the file system on that server.

  • Add a file upload to spreadsheet app

    Created a wizard-generated out of the box app based on spreadsheet.
    Now I want the ability to store a file attachment for each row. So I added the file_id column to the table as a FK to my custom table which stores the uploaded files.
    What is a good UI to handle updates to this?
    On the Create page, I added a File Browse box to upload the file, works fine.
    Added a Download link on the report page, also works fine.
    On the Update page, how should this file_id field be handled? There need to be 2 options (that I can see)
    a. delete the file (delete it from the custom table and null out the file_id column)
    b. replace it with a new file (delete the old file from the custom table, upload the new file and update the file_id pointer)
    How can this be done on the wizard-generated Update Form page?
    Thanks

    OK this is what I ended up doing
    On the Update form, I added a Display as Text item and created an OnLoad computation to populate it with a Download link
    select '< a href="foo.download_file?p_file_id='||file_id||
           '">< img src="/i/themes/theme_10/showhide_show.gif" / >< /a >'
    from mytab
    where id=:P3_IDAdded a File Browse item (P3_FILENAME).
    Added a After Submit process that fires after the wizard-generated Automatic DML process that does
    DECLARE
      l_file_id  NUMBER;
    BEGIN
      IF (:P3_FILENAME IS NULL ) THEN
        RETURN;
      END IF;
      DELETE FROM myfiles
      WHERE       file_id = (SELECT file_id
                             FROM   mytab
                             WHERE  id = :p3_id);
      UPDATE mytab
      SET    file_id = NULL
      WHERE  id = :p3_id;
      INSERT INTO myfiles (file_id,file_name,mime_type,file_size,created_by,created_at,blob_content )
      SELECT id,
             filename,
             mime_type,
             doc_size,
             updated_by,
             updated_on,
             blob_content
      FROM   htmldb_application_files
      WHERE  NAME = :p3_filename;
      UPDATE mytab
      SET    file_id = (SELECT id
                        FROM   htmldb_application_files
                        WHERE  NAME = :p3_filename)
      WHERE  id = :p3_id;
      DELETE FROM htmldb_application_files
      WHERE       NAME = :p3_filename;
    END;In plain English:
    1. Allow the user to view/download the file
    2. If they select/enter a file in the File Browse box, delete the existing file and replace it with the new file and store a pointer to it in the table.
    It is working like a charm.
    Hope this helps someone.

Maybe you are looking for

  • Windows Server 2008 R2 Profile Creation

    We do not use roaming profile instead we use local profile. Unfortunately, this is happening on one of the server that it does not get created fully. For some users the user profile is complete, for some users the user profile is not complete. For ex

  • All firewire devices not recognised after upgrading to Leopard 10.5.4

    Hello, yesterday I finally got around to upgrading one of my home computers (old Emac G4 powerpc from 2005) to Leopard. I have been using Leopard on my work computer (G5 also from 2005) with no problems for a year now (this Leopard update was install

  • Abap proxy call failed

    Hi, I am trying to call (synchronous mode) from XI 3.0 an ABAP proxy located on a R3 enterprise 4.7 ext 2.00 server. Unfortunately, when I send the request message with the XI Adapter to the local integration engine using message protocol 2.0, an err

  • DSL line at two locations

    We have the need to establish a network that connects the VolP phones in the garage of a ranch house and the WiFi network in the remainder of the ranch house. We have extentions of the DSL line at two locations. 1. At the garage and 2. In the other s

  • Update Bool_data during validation exit

    Hello Experts, Is it possible to update the Bool_data fields during validation Exit ? I tried Update and Modify but not working. Example, Lv_text = 'TEST01'. Bool_data-bseg-sgtxt = Lv_text. so after posting, we will find the FI document line item tex