Load a disk file into a BLOB

I'm trying to load a file into a BLOB in 10 g express what I'm doing wrong?


CREATE a DIRECTORY rpt_working_dir AS '... » ;

GRANT READ, WRITE on DIRECTORY rpt_working_dir TO username;


create the table blob_test
(
ID INTEGER,
bin_data BLOB
)


insert into blob_test (id) values ('1')




DECLARE
src_file BFILE: = bfilename ('RPT_WORKING_DIR', '100.pdf');
dst_file BLOB;
lgh_file directory.
BEGIN

dst_file: = EMPTY_BLOB();
-Open the file
DBMS_LOB. FileOpen (src_file, dbms_lob.file_readonly);

-determine the length
lgh_file: = dbms_lob.getlength (src_file);

-Read the file
DBMS_LOB. LoadFromFile (dst_file, src_file, lgh_file);

-update the blob field
UPDATE blob_test
SET bin_data = dst_file;
COMMIT;

-close file
DBMS_LOB. FileClose (src_file);
END;


This results in this error:

ORA-22275: specified incorrect LOB Locator
ORA-06512: at "SYS." DBMS_LOB", line 637
ORA-06512: at line 15 level
22275 00000 - "specified incorrect LOB Locator.
* Cause: There are several causes
initialized; (2) the Locator is a BFILE type and routine
expects a BLOB/CLOB/NCLOB Locator; (3) the Locator is for a
BLOB/CLOB/NCLOB and routine expects a co-locator type BFILE.
(4) to attempt to update the LOB in a body of trigger - LOBs in
bodies of trigger are read-only; (5) the Locator is for a
BFILE/BLOB and the routine expects a co-Locator CLOB/NCLOB;
(6) the Locator for a CLOB/NCLOB and waiting for the routine
a BFILE/BLOB Locator;
* Action: (1) initialize the LOB Locator by selecting in the Locator
variable or by defining the empty LOB index. For (2), (3),
(5) and (6) pass the correct type of mark in the routine.
(4), remove the trigger body code that updates the LOB value.

Empty_blob must be equivalent to a null value. try to use DBMS_lob.create_temporary.

Example of

dbms_lob.createtemporary(,true);

http://download.Oracle.com/docs/CD/B19306_01/AppDev.102/b14258/d_lob.htm#i997788

Alessandro Bye

Tags: Database

Similar Questions

  • Load the XML file into oracle DB using OWB

    Hi friends,

    I'm new XML data.
    I had a requirememnt to load the xml file into an oracle table.
    Can someone procedure to load the data.

    Thanks in advance

    see this

    http://blogs.Oracle.com/warehousebuilder/2007/09/leveraging_xdb.html

  • Load the text file into the Textarea

    Hi How can I load text files into Textarea I use this method seems like it load text file but I can't show it in a textarea a certain pls help

    Hi all
    Finally I found the way to load the text file into the textArea, that's like


    private function loadText (): void {}
    var l:URLLoader = new URLLoader (new URLRequest('2.txt'))
    l.addEventListener (Event.COMPLETE, finishLoading);

    }
    public void finishLoading(evt:Event):void {}
    var myData:String = new String (evt.target.data)
    txtBox.text = myData;
    }

    ]]>

    It should works because it is a work with me
    Take advantage of the code
    Sanji

  • Load the XML file into oracle using sql loader

    Hello

    I'm trying to load an xml file into a table using sqlldr.
    I have a table as follows:
    CREATE TABLE xmlloadtable
    ( id number,
     data_xml XMLType
     )
      XmlType data_xml STORE AS CLOB;
    I have a control file that I know is perfectly false:
    LOAD DATA 
    INFILE '/home/oraread/'
    INTO TABLE xmlloadtable 
    (
    id,
    data_xml 
    )
    I googled for the file control and tried in different ways, but of no use.
    I want to load the entire xml file into the table.
    Can someone help me with the correct control file. Any help is appreciated!

    Try this

    LOAD DATA
    INFILE '/home/oraread/'
    INTO TABLE xmlloadtable
    (id,
     file_name          filler,
     data_xml          lobfile(file_name) terminated by eof
    )
    

    You can add the file as a column name field to your table between the id and xml column and remove the word to fill in the .ldr file if you need to keep the name of the file

  • 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

  • How can I load multiple RAW files into the same workspace (in layers)?

    I want to load several raw files from my windows files in a workspace to manpulate together. How can I do this?

    You can place in the RAW files as layers of smat object. I also think that you can also use the script load Photoshop files in a stack. Other Scripts cal also be downloaded and used >

    Photo Collage Toolkit

    Scripts for Photoshop is powerful and I think that this package demonstrates this a video showing a collage of 5 model PSD image fills with images:

    The package includes four simple rules to follow to make Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.

    1. Models of photo collage for the desired print size - width and height of the size and DPI print resolution.
    2. Photo collage templates must have a background layer in Photoshop. The content of this layer can be anything.
    3. Photo collage templates must have alpha channels named "Picture 1", "Picture 2"... "Picture n".
    4. Photo collage templates layers above the background layers must provide transparent areas to reveal the images which will be placed below them.

    There are fifteen scripts in this package, they provide the following functions:

    1. HelpPhotoCollageToolkit.jsx - online help
    2. TestCollageTemplate.jsx - used to test a model of Collage of Photo while you're doing it with Photoshop.
    3. CollageTemplateBuilder.jsx - can build models that are compatible with this toolkit scripts.
    4. LayerToAlphaChan.jsx - used to convert a stack of the Prototype Image layers in a document template.
    5. InteractivePopulateCollage.jsx - used to fill interactively model Any Photo Collage. Offers more user control insert images and text.
    6. ReplaceCollageImage.jsx - allows to replace an object layer dynamic image collage populated with another image resized and positioned correctly.
    7. ChangeTextSize.jsx - this script can be used to change the size of text Image stamps when the size used by the filling did not work well.
    8. PopulateCollageTemplate.jsx - used to fill a Photo Collage template and leave the populated copy automatically opened in Photoshop.
    9. BatchOneImageCollage.jsx - used for the models automatically batch fill Collage that have only a single image inserted. The Collage or picture may be stamped with the text.
    10. BatchMultiImageCollage.jsx - used to model automatically batch fill any Photo Collage with images in an image source folder. Easier to use than the interactive script. Recorded collages can be twisted.
    11. PasteImageRoll.jsx - paste Images into a document to print on roll paper.
    12. BatchPicturePackage.jsx - used to model automatically batch fill any Photo Collage with an image in the image source folder.  Rotation of images for a better fit.
    13. BatchPicturePackageNoRotate.jsx - used to model automatically batch fill any Photo Collage with an image in the image source folder.
    14. PopulatePicturePackage.jsx - used to fill a Photo Collage fill with the same single image model and leave the populated copy automatically opened in Photoshop.
    15. PCTpreferences.jsx - edit this file to customize Collage fill preset scripts and add your own layer styles.

    Documentation and examples

  • 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).

  • Load a CSV file into a table like in dataworkshop

    Workshop of data has a function to load a CSV file and create a table based on it, the same, I want to create in my application.



    I went through the forum http://forums.oracle.com/forums/thread.jspa?threadID=334988 & start = 60 & tstart = 0

    but not able to download all the files (application, package HTMLDB_TOOLS and PAGE_SENTRY function) could not find the PAGE_SENTRY function.

    AND when I open this link http://apex.oracle.com/pls/apex/f?p=27746

    I could not run the application. I've provided a CSV file and when I click on SEND, I get the error:

    ORA-06550: line 1, column 7: PLS-00201: identifier ' HTMLDB_TOOLS. PARSE_FILE' must be declared

    tried in apex.oracle.com host as shown in the previous post.

    any help pls..,.

    Another method to load data into the tables..., (as dataworkshop)

    Hello

    I have check app works very well.

    Have you read instructions?
    Load a CSV file in a table
    >
    Create a small csv file as

    col1, col2, col3
    VARCHAR2 (10), Number, "Number (10.2)" "
    Cat, 2, 3.2
    dog, 99, 10.4
    >
    First row must have valid column names. To verify that your first line of titles have no spaces or those who are not words reserved.
    Second line of the CSV file must have column of table data types.

    When you meet these requirements app works perfectly

    Kind regards
    Jari

  • I am trying to load a MPEG file into windows Movie Maker 2013 and load only the audio part. What can be done to fix this

    I have MPEG files that I'm editing and when I load in Movie Maker only the audio part load. During loading, I get the following message at the bottom of the screen for the audio to load but when that ends more nother is responsible and the screens indicate only the audio track.

    Hello friend. I know that windows movie maker supports wmv video well, you can convert your videos to wmv mpeg video for a trial, it should work. If you don't know how to convert a video, this video converter will help you a lot.

  • How to load the text file into a table and retrieve data line by line?

    I'm looking to help understand how to open a text file, each line in a table of load.  The data will be called to change the content of the text layer.  Thanks for any help.

    I did not test this code, but something like

    var a = [];

    var f = new File (Folder.desktop + "/ TestFile.txt");

    If (f.open ('r')) {}

    While (! f.eof) {}

    a.push (f.Readln ());

    }

    f.Close ();

    }

    Alert ("I read" + a.length + "lines in the file.");

    for (var i = 0; i)< a.length;="" i++)="">

    DoSomethingWithThisLine (a [i]); //<-- you="" need="" to="" write="">

    }

  • How to load external swf files into the AIR

    I try this code its working at the computer, but when I publish this .apk or .ipa file, my external swf file does not open

    (I included my external file as well)

    places_btn.addEventListener (MouseEvent.MOUSE_DOWN, newvid);

    function newvid(event:MouseEvent) {}

    trace ("you clicked me");

    var loadit = new Loader();

    addChild (loadit);

    loadit. Load (new URLRequest ("scene02.swf"));

    }

    01.jpg

    Add this in your newid function:

    You forgot to put the beginning of your original function:

    var loadit = new Loader();

    addChild (loadit);

    var _lc:LoaderContext = new LoaderContext (false null, ApplicationDomain.currentDomain),

    loadit. Load (new URLRequest ("scene02.swf"), _lc);

  • Loading a SWF file into the feeder of a third person

    Hello again.

    I have a Master SWF, which has several buttons on its stage.  These buttons are loading a remote SWF to an interactive chart in the master left upper corner of the film.  These loaded clips inside are several clickable areas which I would like to use to load yet another movie in the bottom half of the Master clip... so it loads a remote SWF to third party scene.

    I'm having a problem of simple targeting.  I'm not sure how to call a movie to load into a loader on the stage of a different clip.  I use 'parent'... but I got something wrong:

    _________________________________

    var unitSwfLoader:Loader = new Loader();
    unitSwfLoader.x = 25;
    unitSwfLoader.y = 390;

    function getUnitSWF(e:MouseEvent):void
    {
    unitSwfLoader.load (new URLRequest ("units /" + e.currentTarget.name + ".swf"));
    parent.addChild (unitSwfLoader);
    }

    You can use root to reference the main timeline from anywhere.  You may have only thrown like a movieclip:

    MovieClip (this.root) .addChild (unitSwfLoader);

  • Problem with the date when you load the XML file into Oracle Database 10g

    Hi all

    I have the interface as shown in the screenshot below. In this document, among other things, I am mapping to an element XML file representing a date to an Oracle table column defined as DATE. The source and target columns are highlighted in the screenshot.

    ! http://img223.imageshack.us/img223/1565/odiscr275.jpg!

    When I run the interface, I get the following error message:

    java.lang.IllegalArgumentException to java.sql.Date.valueOf(Date.java:103)

    I guess that this is the conversion of the date!

    I already tried to replace SRC_TRADES. DEAL_DATE with TO_DATE (SRC_TRADES. DEAL_DATE, ' DD/MM/YYYY') on the implementation tab. This feature was not recognized when I executed the interface, so it did not work! The value of date in the XML file is in the format DD/MM/YYYY .

    I guess that Date SQL Oracle functions do not work in the implementation tab. Could someone let me know:

    1. what the Date Conversion function I could use instead?
    2. where can I find a reference to the methods/functions that I use in the implementation tab (if such a reference exists)?

    See you soon.

    James

    Hello.

    Try changing the area of execution at the staging area. Once you change it, write in the map box just SRC_TRADERS. DEAL_DATE. When you use TO_DATE, the source field typu should be varchar2, no date (as it is in store for your data source)

  • Question to load the XML file into Oracle via ODI: LKM and IKM adjustment

    Hi all

    I am currently building an ODI interface to upload my file system XML local in a 10 g to Oracle database.

    I received the error message shown in the screenshot below:

    ! http://img529.imageshack.us/img529/3491/odiscr175.jpg!

    The main problem I have is, I don't know all what LKM or IKM assign.

    Can someone offer any assistance/advice?

    Thanks in advance.

    James

    James
    You must select the LKM SQL for Oracle (or LKM SQL for SQL) and then within Oracle to integrate Oracle the IKM incremental update or append IKM SQL command.
    Reading XML, you can just use the standard SQL KMs. (when writing, there's a little more necessary artifice, and this can be done by using specific IKMs)
    Hope this helps

  • 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.

Maybe you are looking for

  • How do we install the new memory on Satellite A200-1DN?

    Hi all I recently bought new ram (2 x 2 GB) for my Toshiba A200-1DN and I would really appreciate if you could give a step by step guide to install myself. Also I heard only static could be bad time doing so. Is this true? If so, how can I make sure

  • Does not take into account selection keyboard MCE Vista after recent update?

    Hello I am running localized (CZ) Home Premium SP2 Vista64(No Answers.cs - CZ groups). I use United States and CZ keyboard layouts, displayed in the taskbar.Left ALT + SHIFT to switch on. After the recent update of MCE since MS update,(I think Yes, b

  • ACS initialization fail

    Hello Last week we had a lot of power failure. Since these problems, our ACS 1113 device unbootable. At the start, we have the following message: ***************************************************************************** * Main processors: Intel (

  • Do not let me access my account, saying: I am not an authorized user.

    I am trying to download the software, but it won't let me access the page I need to say that I am not recognized as an authorized user.

  • Cannot change calendar view

    My desktop software and the device is in French and the display of the calendar/month (my notice of default) starts the week Monday. I want to change this so that the week starts on Sunday (I'm in Canada, not Europe!) but I can't find how to do this