loading of a zip file in a database table

Hello
I need a way to load inside a table, a zip file I have on the file system.

is it possible to do?

I have try this one, but it does not work:

create table prova (file_zip clob)

insert into values prova (bfilename ('UTIORA', 'aaa.zip'))


where UTIORA is a directory on the file system.

Thank you
Francesco

Francesco,
1. to save a zip file, you need not type BLOB, CLOB.
2. you must convert BFILE BLOB before inserting it in your table:

Example:
Table:

CREATE TABLE PROVA (FILE_ZIP BLOB);

Insert:

   DECLARE
      oNew     BLOB;
      oBFile   BFILE;
   BEGIN
      oBFile := BFILENAME('UTIORA', 'aaa.zip');
      DBMS_LOB.OPEN(oBFile, DBMS_LOB.LOB_READONLY);
      DBMS_LOB.createtemporary(oNew,TRUE);
      DBMS_LOB.LOADFROMFILE(oNew, oBFile, dbms_lob.lobmaxsize);
      DBMS_LOB.CLOSE(oBFile);
      INSERT INTO PROVA  VALUES ( oNew );
      dbms_lob.freetemporary(oNew);
   END;

HTH
Thomas

Published by: thomaso may 12, 2011 10:54

Tags: Database

Similar Questions

  • zip files in a blob table

    All,

    I need help creating a unique zip for several blobbed files file and store it in the same table.

    detailed:

    ========

    Ive has a table that stores several different files (format pdf, .txt, gif etc.) as blob records now I want to create these files .zip file and save it in the same table. How can I do this in 11g2g oracle using plsql or incorporating some java in plsql?

    any help please,.

    Thank you.

    I always thought that it was not so difficult to use the package. It seems that I was wrong

    create table my_files( id number, file_name varchar2(100), file_content blob );
    
    insert into my_files
    select level id
         , 'example' || level || '.txt'
         , utl_raw.cast_to_raw( 'Some test text, level ' || level )
    from dual
    connect by level <= 5;
    
    declare
      g_zipped_blob blob;
    begin
      dbms_lob.createtemporary( g_zipped_blob, true );
      for r_txt in ( select * from my_files where file_name like '%.txt' order by id )
      loop
        as_zip.add1file( g_zipped_blob, r_txt.file_name, r_txt.file_content );
      end loop;
      as_zip.finish_zip( g_zipped_blob );
      insert into my_files values ( 0, 'txt.zip', g_zipped_blob );
      dbms_lob.freetemporary( g_zipped_blob );
    end;
    /
    
  • A query when importing an XML file into a database Table

    Hello
    I create an ODI project to import an XML file into a database using the following link Table.With

    http://www.Oracle.com/WebFolder/technetwork/tutorials/OBE/FMW/ODI/odi_11g/odi_project_xml-to-table/odi_project_xml-to-table.htm
    I am facing a problem when creating physical Schema for the XML Source model.
    For the
    Schema (Schema)
    and
    Schema field (scheme of work) that they have chosen to GEO_D.
    What GEO_D here?
    or
    What should I select here?
    (1) the XML schema (NB:-J 'I havn' t created any file .dtd for my file .xml or .xsd)
    or
    (2) my diagram of target servers
    Please tell me what I do?
    Thank you

    and
    Schema field (scheme of work) that they have chosen to GEO_D.
    What GEO_D here?

    Is the schema specified in the XML file name.

    What should I select here?
    (1) the XML schema (NB:-J 'I havn' t created any file .dtd for my file .xml or .xsd)

    Yes

    (2) my diagram of target servers
    Please tell me what I do?
    Thank you

  • Load the XML complecated file into my DATABASE

    Hello everyone,
    I have an XML file structured like:
    < ROOT_ELEMENT >
    < SUB_ROOT name = "RETOUR_REQ" >
    < tag name = "TAG1" id = "1" >
    < TAG_VALUE > V1 < / TAG_VALUE >
    < / TAG >
    < tag name = "TAG2" id = "2" >
    < TAG_VALUE > V2 < / TAG_VALUE >
    < / TAG >
    < tag name = "TAG3" id = "3" >
    V3 < TAG_VALUE > < / TAG_VALUE >
    < / TAG >
    < / SUB_ROOT >
    < / ROOT_ELEMENT >

    I want to load this XML file in my Oracle 10 g, the structure of the target table is:


    CREATE TABLE IMP_XML_RETOUR)
    FLUX_NAME VARCHAR2 (20), == > tag mapping
    ELMENT_1 VARCHAR2 (20), == >
    ELMENT_2 VARCHAR2 (20), == >
    ELMENT_3 VARCHAR2 (20) == >
    );
    the FLUX_NAME field must be mapped to the path 'ROOT_ELEMENT/SUB_ROOT/@name '.
    the ELMENT_1 field must be mapped to the path 'ROOT_ELEMENT/SUB_ROOT/TAG@name='TAG1'/TAG_VALUE '.
    the ELMENT_2 field must be mapped to the path 'ROOT_ELEMENT/SUB_ROOT/TAG@name='TAG2'/TAG_VALUE '.
    the ELMENT_3 field must be mapped to the path 'ROOT_ELEMENT/SUB_ROOT/TAG@name='TAG3'/TAG_VALUE '.

    There are any PLSQL function that can be used to load my XML file into my table

    Thanks a lot for your answers

    OK, so my example should work for you.

  • Load the XML file into Oracle external Table


    I load the data from the XML file into an intermediate table Oracle using external Tables.

    Let's say below, it is my XML file

    < header >
    < A_CNT > 10 < / A_CNT >
    < E_CNT > 10 < / E_CNT >
    < AF_CNT > 10 < / AF_CNT >
    < / header >
    < student >
    <>students-details
    < Student_info >
    < Single_Info >
    < ID > 18 / < ID >
    New York < City > < / City >
    < country > United States < / country >
    < Name_lst >
    < Student_name >
    Samuel < name > < / name >
    Paul < Last_name > < / Last_name >
    < DOB > 19871208 < / DOB >
    Aware of < RecordStatus > < / RecordStatus >
    < / Student_name >
    < Student_name >
    Samuel < name > < / name >
    Paul < Last_name > < / Last_name >
    < DOB > 19871208 < / DOB >

    < TerminationDt > 20050812 < / TerminationDt >
    History of < RecordStatus > < / RecordStatus >
    < / Student_name >
    < / Name_lst >
    < Personal_Info >
    <>men < / Type >
    < 27 > < / Age >
    < / Personal_Info >
    < / Single_Info >
    < / Student_info >

    < student - register >
    class < A >
    < info >
    < detail >
    < ID student > 18 < / student >
    EE < major > < / Major >
    < course-Grades >
    < course > VLSI < / course >
    < degree > 3.0 < / Grade >
    < / course-Grades >
    < course-Grades >
    < course > nanotechnology < / course >
    < degree > 4.0 < / Grade >
    < / course-Grades >
    < / details >
    < detail >
    < ID student > 18 < / student >
    THIS < major > < / Major >
    < / details >
    < / info >
    class < A >
    < Student_Enrol >
    <>students-details
    < student >

    I load this XML data file into a single table using an external Table. Could someone help me please with coding.

    Thank you

    Reva

    Could you please help me how to insert my XML content into that.

    Same as before, try a plain old INSERT:

    insert into xml_pecos

    values)

    XmlType (bfilename ('XML_DIR', "test.xml"), nls_charset_id ('AL32UTF8'))

    );

    But you'll probably hit the same limitation as with the binary XMLType table.

    In this case, you can use FTP to load the file as a resource in the XML DB repository.

    If the XML schema has been registered with the hierarchy enabled then the file will be automatically inserted into the table.

    Could you post the exact statement that you used to save the scheme?

    In the meantime, you can also read this article, I did a few years ago, it covers the XML DB features that may be useful here, including details on how to load the file via FTP:

    https://odieweblog.WordPress.com/2011/11/23/Oracle-XML-DB-a-practical-example/

    And documentation of the course: http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb06stt.htm#ADXDB4672

  • export from excel to database table

    Hello

    I have a requirement to export the data from the excel file to the database table.

    I downloaded using sqlloader... using the control file

    and are there other options to download the data...

    Day, now that we have a lot of tools to download

    SQL Developer tool

    Toad

    Using the Excel formula

    UTL_FILE...

  • l'm down loading videos a zip of music files, but my compress zip file do no exsite or not more working time

    I have a labtop CQ57 a couple of windows 7-64, I'm down loading video is a zip of music files but my compress zip file doesn't exsit more how can I get a zip file to get my music and videos [Compaq Presario CQ57-339WM laptop PC]

    Hello

    Please download this free product and install on your machine:

    http://www.7-zip.org/download.html

    Kind regards.

  • I created a zip file and loaded a lot of things I wanted on now it's gone can anyone help me please

    Help me please I don't know where he might be, and I'm not part of computers

    Hello

    1. how exactly did you create zip file and load the file in it?

    2. where did you had stored it?

    Step 1: Check if the file is hidden.

    Step 2: Find the file using Windows search.

  • Could not load the .zip file in the media internal binary

    Hi all

    We are facing a problem in the application migrated to atg10.2 where Bcc we are not able to download the .zip in media-internal-binary file extensions.

    I went through the documentation that says it can be used for the .gif, .jpeg extensions, but we were able to use this feature in 9.2.

    So is it possible to customize it and allow zip files in the media internal binary?

    Thank you

    OK so got the mapping for this view and now able to load the zip file.

    The mapping of the view is AmPValImageExtensions. You must add the extension .zip inside with .gif, .jpeg.

  • load the xml file into a database to help table of travel point

    Hello

    Someone help me please with a possible approach. I have an interface for APEX users where users can download a file xml in apex table wwv_flow_files using the element to browse with a button "submit". Now, after loading the xml file in the wwv_flow_files table. I need to read and load the xml data into a table sample_tbl. I'm using the version of Oracle APEX 4.0 and Oracle 10 g R2 database. Here is an example of XML file to load. Please help me possible suggestions.

    <? XML version = "1.0" encoding = "UTF-8"? >

    < dataroot generated =... >

    < MySample >

    < KeyId > 1234 < / KeyId >

    eddskc < KeyName > < / KeyName >

    < scheduleDate > 2013-06-16T 00: 00:00 < / ScheduleDate >

    < StartTime > 2013-06-16T 08: 00:00 < / StartTime >

    < EndTime > 2013-06-16T 08:30:00 < / EndTime >

    < / MySample >

    < MySample >

    < KeyId > 5678 < / KeyId >

    jppdf < KeyName > < / KeyName >

    < scheduleDate > 2013-05-19T 00: 00:00 < / ScheduleDate >

    < StartTime > 2013-05-19T 08: 00:00 < / StartTime >

    < EndTime > 2013-05-19T 08:30:00 < / EndTime >

    < / MySample >

    < / dataroot >

    Thanks in advance.

    Thank you

    Orton

    orton607 wrote:

    My sample_tbl has a start_time field and its data type DATE.

    Good.  Be sure to always store dates as the DATE.

    The application (in this case, APEX) needs to format the date date type in the appropriate human-readable format.

    The problem with the incoming data is the 't'.  You will need to convert a space using REPLACE() in the framework so that your SELECT statement

    From there on, conversion to the DATE data type is simply

    to_date( replace( start_time_str, 'T', ' '), 'YYYY-MM-DD HH24:MI:SS') as start_time
    

    And, just in case where, the conversion of DATE for the desired format:

    to_char( start_time, 'MM/DD/YYYY HH12:MI:SS AM')
    

    Although, I'm 'hours' as being left-padded with zeros... Am I looking for how / if you can get rid of the zero prefix (0).

  • Is the zip file download of Oracle Database 11 g include doc and examples

    Hi Experts,

    I download Oracle Database 11 g Release 2 Standard / Enterprise Edition from here:
    [http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html]

    Its size is 2 GB for Microsoft Windows (32-bit).
    When I click to see all the link. It opens this page (Please check this page):
    [http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-win32soft-098987.html]

    It shows all Oracle database 11G database components links user who want to download.

    I want to download this: (to the first link on this page)
    Oracle Database 11 g Release 2 (11.2.0.1.0) for Microsoft Windows (32-bit)
    Download win32_11gR2_database_1of2.zip (1,625,721,289 bytes)
    Download win32_11gR2_database_2of2.zip (631,934,821 bytes)


    This page also shows a link for:
    Oracle Database 11 g Release 2 examples
    Download win32_11gR2_examples.zip (565,154,740 bytes)
    Examples of use of the Oracle database. Download If you're new to Oracle and try some of the examples in the Documentation.


    Query: Is - this downloadable zip file includes documentation (which indicate in the link documentation in his Direction) and Oracle Database 11g Release 2 examples?

    Or should I download separately for Oracle database 11 G, documentation, examples.
    Please say.

    Thank you.

    Documentation 11 GR 2 individual files can be downloaded from http://www.oracle.com/pls/db112/homepage

    The installation guide for the examples is http://docs.oracle.com/cd/E11882_01/install.112/e24501/toc.htm

    A full CLOSURE of the documentation can be downloaded from the link to http://www.oracle.com/technetwork/database/enterprise-edition/documentation/database-093888.html

    (available from http://www.oracle.com/technetwork/documentation/index.html#database)

    Note: The documentation is all updated for 11.2.0.3 However, download of the software is for 11.2.0.1 only because the 11.2.0.3 of the software requires a Support contract.

    Hemant K Collette

  • Could not load the .zip file after changing CSS


    We are working on a native android application with DPS.

    We would like to use some custom CSS to change the banner at the top of the façade of the library/store. Our developer takes the work .zip file, open, change the CSS, re-archiving it and then back to send it to me. When I try to create the application by using the new .zip file, the app crashes.

    We went through a series of changes CSS, thinking it was the CSS that was the problem before to sit and try a different set of tests.

    The first thing we tried was taking labour zip file, unzip, without making any changes, and then re - zipping it and make the app again. It breaks the app.

    Leave us this kind of tests and tried a more.

    Two files were created; We have the file structure:

    Zip archive
    -Default_android_library
    -folder fonts
    -images folder
    -index.html
    file - js
    -libs folder
    -main.js
    -style.css
    -file templates

    And the other is just:

    Zip archive
    -folder fonts
    -images folder
    -index.html
    file - js
    -libs folder
    -main.js
    -style.css
    -file templates

    None of these worked, either.

    Everyone knows that kind of problem before with the edit and re - compress them for android?

    Thank you.

    Neil,

    I think that we thought about it, we add an extra layer to the file structure in zip archive.

    Thank you

    Christopher Huber

  • Firefox won't download a zip file

    There is a chat Board that I belong, and they published a zip file. It looks like a white sheet of paper with a folded corner and said zip on it. When I put my cursor on it, this kind of moves upward and says so at the bottom, the name of the file and then the file. 260K zip, but I can't click on it so that it can download, save, open, reject, nothing.
    I think I downloaded the zip files in the past, but for some reason some can't upload this one.
    Can anyone help please.
    I use a Toshiba laptop with windows 7 service pack 1
    The application databases

    Name: Firefox
    Version: 25.0
    User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; RV:25.0) Gecko/20100101 Firefox/25.0

    Extensions

    Name: ModPlugin
    Version: 1.0.1159
    Enabled: true
    ID: {31d88f70-c791-42d8-8187-faaf71d42f67}

    Name: AVG toolbar backup
    Version: 17.0.2.13
    Enabled: false
    ID: avg@toolbar

    Important change preferences

    accessibility.typeaheadfind.flashBar: 0
    Browser.cache.Disk.Capacity: 358400
    Browser.cache.Disk.smart_size.first_run: false
    Browser.cache.Disk.smart_size.use_old_max: false
    Browser.cache.Disk.smart_size_cached_value: 358400
    browser.places.smartBookmarksVersion: 4
    Browser.Search.Suggest.Enabled: false
    browser.search.useDBForOrder: true
    browser.sessionstore.upgradeBackup.latestBuildID: 20131025151332
    Browser.Startup.homepage: google.com
    Browser.Startup.homepage_override.buildid: 20131025151332
    Browser.Startup.homepage_override.mstone: 25.0
    dom.mozApps.used: true
    DOM.w3c_touch_events.expose: false
    extensions.lastAppVersion: 25.0
    GFX. Direct3D.checkDX10: false
    GFX. Direct3D.last_used_feature_level_idx: 1
    network.cookie.prefsMigrated: true
    Network.protocol - handler.warn - external .dnupdate: false
    places.database.lastMaintenance: 1384482032
    places. History.expiration.transient_current_max_pages: 103914
    plugin.disable_full_page_plugin_for_types: application/pdf
    plugin.importedState: true
    plugin. State.npqtplugin: 2
    privacy.sanitize.migrateFx3Prefs: true
    Security.mixed_content.block_active_content: false
    Security.warn_viewing_mixed: false
    Storage.vacuum.Last.index: 0
    Storage.vacuum.Last.places.sqlite: 1384311247

    User.js preference

    Your profile folder contains a user.js file, which includes preferences that are not created by Firefox.

    Graphics

    Description of the adapter: Mobile Intel (r) 4 Series Express Chipset Family
    Drivers: igdumd64 igd10umd64 igdumdx32 igd10umd32
    RAM card: unknown
    ClearType settings: Gamma: Structure of 2200 pixels: level ClearType RGB: 100 improved contrast: 400
    Device ID: 0x2a42
    Direct2D Enabled: true
    DirectWrite Enabled: true (6.2.9200.16571)
    Driver date: 25/08/2010
    Driver version: 8.15.10.2202
    GPU #2 Active: false
    GPU accelerated Windows: 1/1 Direct3D 10
    Vendor ID: 0 x 8086
    WebGL Renderer: Google Inc. - ANGLE (Mobile Intel (r) 4 Series Express Chipset Family Direct3D9Ex vs_3_0 ps_3_0)
    windowLayerManagerRemote: false
    AzureCanvasBackend: direct2d
    AzureContentBackend: direct2d
    AzureFallbackCanvasBackend: Cairo
    AzureSkiaAccelerated: 0

    JavaScript

    Incremental GC: true

    Accessibility

    Enabled: false
    Prevent accessibility: 0

    Versions of the library

    NSPR
    The expected minimum version: 4.10.1
    Version: 4.10.1

    NSS
    The expected minimum version: 3.15.2 based ECC
    Version: 3.15.2 based ECC

    NSSSMIME
    The expected minimum version: 3.15.2 based ECC
    Version: 3.15.2 based ECC

    NSSSSL
    The expected minimum version: 3.15.2 based ECC
    Version: 3.15.2 based ECC

    NSSUTIL
    The expected minimum version: 3.15.2
    Version: 3.15.2

    Are there any other similar downloads on the site that work, such as pictures, Word documents, etc., or are they all broken the same way?

    I was not familiar with the extension ModPlugin. It works on the site that has the problem? If so, could test you with the disabled extension? You can do this by restarting mode safe mode of Firefox, or manually in the page modules. Either:

    • CTRL + SHIFT + a
    • Firefox orange (or the Tools menu) button > Add ons

    In the left column, click Extensions.

    If this extension is not relevant for the site that has the problem, or if the problem persists after you disable it, can provide you a link to the site if someone could check it out?

  • Could not open the zipped file

    Original title: I can't open my file are compressed, I think they are embroidery designs?

    I put the drawings in my doc file, I see what looks like a file but cannot open the same try to put in the folder and open. I don't know what is a compressed file, but I saw that while I'm going to lower the load, don't know if I did something a way to use it or not.

    Hello

    You have any software to open Zip files?

    To inform you, a zip file contains one or more of the files that have been compressed to reduce the size of the file, or stored as is. The zip file format allows a number of compression algorithms. Zip files generally use file extensions ".zip" or ".". ZIP ".

    You will need third-party software to open ZIP files in Windows XP. Use your favorite search engine to download third party software.

    Note: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    I hope this information is useful!

  • Download of any .zip file or program causes the Crash

    (1) sometimes when a download is completed with a .zip file, immediately after Internet Explorer Startup 'windows' loading violently on 2s, little white, black. Now there is no mouse so not menu Manager or task or the possibility of restart begins. He not only put there turned off or unplug, rest, restart in safe mode.

    (2) sometimes if you download without immediate action that precedes, I'll go to my download folder in Windows Explorer and if the named file.zip#/ is there with success, then click left just to highlight or do right click to click Open, the same frenzy described above again.

    Now, I've noticed that the loading window, was after clicking to select this .zip file, what should happen on the Solution Explorer toolbar is the word "Extract" appears. Well, I get the Internet Explorer of the e icon instead. That's when I knew I'm in big trouble. If you don't touch the file with the mouse, then try clicking on the arrow next to the e Internet Explorer in the toolbar, the frenzy of loading will begin and continue until power off. It's the classes .zip file not just one, as I have tried a dozen different one is now in the last week or two. I have no malware or viruses. Where this kind of problem would be located?

    Have you followed the instructions provided article, otherwise affect you with access denied errors?

    How to analyze the entries in the log file generating the program Checker (SFC.exe) resources of Microsoft Windows in Windows Vista
    http://support.Microsoft.com/kb/928228#appliesTo

    What anti-virus software you're running, have you tried to temporarily disable all scanners in real-time and see if you can then open a compressed file or attach to an email?

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/default.aspx/KB/929135

    See if the file associations will be returned to their default associations?

    A utility to Unassociate Types of files in Windows 7 and Vista
    http://www.Winhelponline.com/articles/231/1/an-utility-to-unassociate-file-types-in-Windows-7-and-Vista.html

    How can I disable the compressed folders (built-in support for ZIP files) in Windows Vista and XP?
    http://www.annoyances.org/exec/show/article03-202

    Internet Explorer stops responding, stops working, or restarts [Guided help]:
    http://support.microsoft.com/gp/pc_ie_intro:

    Use Reset Internet Explorer settings (RIES)
    http://support.Microsoft.com/kb/923737#appliesTo

    Tips for solving problems with Internet Explorer
    http://windowshelp.Microsoft.com/Windows/en-us/help/8038f9ac-9bf9-4809-8d75-fc42818d8af71033.mspx

    You problems occur if you create a new user and test with it?

    Try running ChkDsk to check your drive for errors. Right click on your drive icon / properties / tools / error checking.  Try first by checking do not each box (that it will run in read-only mode) to see if it reports any problems file or hard drive.  If so, restart it by checking both boxes and restart to allow him to attempt to fix any problems found.

Maybe you are looking for

  • NB200-10Z - battery care

    I recently bought a netbook NB200-10Z. I'm not really sure the battery care. Should I keep the battery charge all the time, when I do not use the machine or only to connect the battery to the hand when it is unloaded.In short how I look after my batt

  • ENVY 15 NOTEBOOK PC: Laptop memory internal reference

    I have a PORTABLE PC ENVY 15 product number: E2B61LA / 16 GB RAM / 512 GB SSD and is excellent / update Win10 whiout problems. What is the memory of reference, which can be inserted in the internal slot of your laptop?This isn't a memory slot? Is the

  • Error message could not initialize the canvas shared in Live mail

    When you use direct mail, error message. Failed to initialize the shared canvas: System. IO. FileNotFoundException Following a long text with strange error messages. It is having the effect that I am not able to create a live message. What should I d

  • Add Texture - shape "too complex"?

    I'm trying to take shape and add a texture bitmap (will get a texture vector in the end, it was just a dry). I did it to my blue circle placed on the texture, expanding appearance, by selecting the two and pressing command + 7:Now, I want to do the s

  • Customize smart shape - adobe captivate 9

    Hello.I read the Adobe captivate user guide 9.  He mentioned that we can custom active forms. When I check in adobe captivate 9, the list does not give me the ability to customize forms. This feature is always available?I noticed that there are a lot