Blob to filesystem

How do you copy an internal blob to the filesystem?

Two options:
OCI
JDBC
(I'm assuming binary data)
null

Similar Messages

  • Copy BLOB column  to filesystem

    Hello everybody.
    Im working with RedHat Linux and Oracle Database 10gR2.
    My problem , I have some tables with Blob columns those Blob columns have pictures (jpg, gif etc) , and I need copy those pics ,blob colums, to filesystem.
    Question : Can anybody send me a link where I can see a example of how to ?.
    Thanks in advanced and regards everybody.

    You can check this asktom post
    Retrieving Data from BLOB into a file
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6379798216275
    or search for more demo on asktom.

  • Experiences with [BLOB + Oracle] vs Storing it in OS Filesystem

    Hello,
    I know Oracle 11g has improved so much when talking about LOBs, but unfortunately our application is not certified on Oracle11g. So we're developing a project which uses Oracle 10g to store binary documents. Since our system is likely to grow up to some terabytes in two years, I'd like to ask if some of you have had some experience with storing a huge amount of blob objects in Oracle. How does it scale in performance?
    Regards,
    Juliano

    Hello,
    Thank you for the response. Well I'm really concerned about filesystem performance when dealing with millions of JPG files. There's also a concern about security, since it's easier for someone to change the files when they are stored outside the database.
    I also know it will be a headache when trying to migrate it to 11G, if I store everything inside the db. It will also generate a large amount of redo, as you mentioned. But the question is: Are the presently available filesystems as reliable and scalable as a database? I've heard of people who had problems of losing the entire filesystem, but that was on Windows...
    Any additional comment will be highly appreciated!
    Juliano

  • (fileSystem::extract Blob From Local Path) after installing B.O. XI 3.1

    Hello,
    I've installed B.O. XI 3.1 client tool on a laptop, but when I try to run Designer, or Deski the following error occurs (REPOSITORY ERROR (fileSystem::extract Blob From Local Path) file not found) and the application quits.
    Anyone has an idea?

    Hi
    What operating system are you using on your laptop?
    I have a colleague having a similar problem using Windows Vista, whereas I am fine (using XP).
    Did you manage to resolve this issue? (And if so, how)
    regards, Lara

  • Writing BLOBS to the filesystem

    Here's my problem.
    I know how to read any filetype into the database using a OLE
    container mapped to a BLOB column in the Oracle 8i database.
    How do I then, write the BLOB to the filesystem.
    null

    Hello AlaaShaw,
    Best practice for this type of application is to have two loops--one that handles deterministic operations and one that performs non-deterministic operations (such as writing to file or communicating to the host PC). You can transfer data between these loops using RT FIFO variables without affecting the determinism of your main loop, or with single-process shared variables. Here is a help document explaining data communication:
     http://zone.ni.com/reference/en-XX/help/371361L-01​/lvconcepts/data_comm/
    An example for how to implement this architecture can be seen here:
    http://www.ni.com/tutorial/11198/en/
     http://www.ni.com/tutorial/52028/en/
    In the future, please post to the LabVIEW RT discussion forum.  This will increase the visibly of your issue and increase the response time.
    http://forums.ni.com/t5/forums/searchpage/tab/mess​age?submitted=true&type=message&q=rt&page_size=50&​...
    Regards,
    Thomas C.
    Applications Engineer
    National Instruments

  • Downloading BLOB from DB to local filesystem

    We have a requiremnt to provide a JSP page that allows user to select a file that is stored as a BLOB in an Oracle 9 DB and download to local machine.
    We have the listing of files working, but not 100% sure how to go about the actual file download code. Can anyone point us in the right direction? Sample code?
    Oracle 9i DB
    JDev 9.052
    Java 1.4
    Thanks,
    Mike

    Thanks, Francois.
    Is there another way?
    Basically, what our users want is to open pdf document stored as a blob column.
    My idea was to save document to AS and then open it using web.show_document().
    I would like to avoid saving file to clients PC and reduce network traffic.
    Mario
    Message was edited by:
    MarioK

  • How can I run a sequence file which is stored as BLOB

    Hallo,
    I' using (or better will use) TestStand 3.1 and a ORACLE database. Is there a way to load and execute sequence files which are not stored on the filesystem but as BLOBs in the ORACLE DB. The choice which sequence has to be executed is done dynamically within a custom built process model. A certain sequencefile should be loaded and started by referencing it not by filename but with the PrimaryKey of the table.
    I don't know if this would be a certain capability implemented in TestStand or in ORACLE. It could be something like mapping a BLOB into the Filesystem and pretend that the file is present on the filesystem, something like that!
    Any ideas are highly appreciated
    Thanks
    Oliver Friedrich

    Oliver -
    TestStand does not have any hooks to allow a test system developer to override the internal searching for a file on disk. The only simple option that I see is to to query the database and download the latest sequences ahead of time. This is similar to a Source Code Control mechanism. Keep in mind that once an execution loads a sequence file, the file is typically not released until the last execution completes so you cannot load an updated copy of the sequence file while executing, especially the client sequence file.
    Scott Richardson
    National Instruments

  • Conversion of string to BLOB format

    Hi,
    Scenario is proxy to JDBC:
    I have a requirement where my PFD file name is maintained in one ABAP R3 table and I need to convert the PDF file name to BLOB format.
    Is there any function module available in R3 for converting to BLOB data type. or java mapping is required in graphical mappping for this conversion.
    My pdf file name is:
    SHELL_INC_123456789012_851000000005290_DE_04_2008.pdf
    Thnx
    Chirag

    Hi Chirag,
    I don't think there is any FM in ABAP is written for this purpose. you should need to write an UDF. Also my concern is that "where is the PDF file located"? If the answer is "on a file system accessible to the Oracle database" Then you can use directory objects and the DBMS_LOB package. It would look something like this:
    as SYS user do:
    -- assume the PDF files are in /data/documents filesystem directory
    create or replace directory pdfdir as '/data/documents';
    grant read on directory pdfdir to <USER>;
    as USER do:
    create table mydocs (id integer primary key, doc blob);
    declare
    bf bfile;
    b blob;
    src_offset integer := 1;
    dest_offset integer := 1;
    begin
    ' insert a new blob and return it to local variable
    insert into mydocs values(1, empty_blob()) returning doc into b;
    ' open the bfile for file "summary.pdf"
    bf := bfilename('PDFDIR', 'summary.pdf');
    dbms_lob.loadBlobFromFile(b, bf, dbms_lob.lobmaxsize, dest_offset, src_offset);
    ' done
    commit;
    end;
    I assumed that you are working with 2 different machines, one client, one server.
    If you are working on a single machine, there may be a simple bug in the code.
    try adding the line
    dbms_lob.open(bf, dbms_lob.file_readonly);
    between the calls to bfilename() and loadBlobFromFile()
    Also if you want to do this using java then please have a look in this link.
    http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp?topic=/com.ibm.jccids.doc/com.ibm.db2.luw.apdv.java.doc/doc/cjvjdlbv.html
    Hopefully this will help you.
    Regards
    Aashish Sinha

  • BLOB in Oracle Forms 6.0

    I have used the following PL/SQL code in Forms 6.0 form, for inserting an Image in the BLOB type column of a database table, taken from windows filesystem.
    DECLARE
         F_LOB BFILE;
         B_LOB BLOB;
    BEGIN
         INSERT INTO IMAGES (IMAGE_ID, IMAGE_FILE) VALUES (1, EMPTY_BLOB());
         SELECT IMAGE_FILE INTO B_LOB FROM IMAGES WHERE IMAGE_ID = 1 FOR UPDATE;
         F_LOB := BFILENAME('BLOB_FILES', 'BlueHills.JPG');
         DBMS_LOB.FILEOPEN(F_LOB);
         DBMS_LOB.LOADFROMFILE(B_LOB, F_LOB, DBMS_LOB.GETLENGTH(F_LOB));
         DBMS_LOB.FILECLOSE(F_LOB);
    EXCEPTION WHEN OTHERS THEN
         MESSAGE(SQLERRM);
         MESSAGE(SQLERRM);
    END;
    When i debug or run the form, it collapses or closes at line # 2 without giving any exception, and hense does'nt inserts the image in the column, where BLOB_FILES is the database directory object mapping to a specific windows file system directory containing images.
    I would be very thankful if anyone can help me out of this problem.

    Dear Gerd Volberg,
    I have:
    Forms Version 6.0.5.0.2
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
    and with the following statement you have made in ur last post what should I do then:
    only patch 18 is certified against this database 10 g rel. 2.
    I know many problems around blobs and clobs when using too old patch-sets.
    install the newest patch 17 and try it again. 17 is certified against 10g DB rel. 1.
    18 is only for EBS-user, so you are not allowed to install it when not running the E-Business-Suite

  • Problem Trying to retrieve a PDF document from XMLP_SCHED_DATA BLOB field.

    Hello everyone,
    I'm using BI Publisher 11g to generate PDF documents. I had implemented a servlet that uses HTTP POST/GET to simulate the behaviour of BIP console since ScheduleReport Service is not implemented in this version. The problem is about the output of the final documents when i'm not using the bursting option. From my experience, the documents are not saved in any temporary folder in the filesystem. Looking at DEV_BIPLATFORM schema and analysing XMLP_* tables, i'm assuming that the generated document data is the BLOB DATA field in the XMLP_SCHED_DATA table...this is right?
    Next, in java, i'm using the BLOB field to output his binary content to a PDF file but, when i try to open the file, it gives an error: "document may be damaged"...
    Any suggestions here would be appreciated...
    Thanks in Advance
    Regards,
    NP

    831692 wrote:
    Hello everyone,
    I'm using BI Publisher 11g to generate PDF documents. I had implemented a servlet that uses HTTP POST/GET to simulate the behaviour of BIP console since ScheduleReport Service is not implemented in this version. The problem is about the output of the final documents when i'm not using the bursting option. From my experience, the documents are not saved in any temporary folder in the filesystem. Looking at DEV_BIPLATFORM schema and analysing XMLP_* tables, i'm assuming that the generated document data is the BLOB DATA field in the XMLP_SCHED_DATA table...this is right?
    Next, in java, i'm using the BLOB field to output his binary content to a PDF file but, when i try to open the file, it gives an error: "document may be damaged"...
    Any suggestions here would be appreciated...
    Thanks in Advance
    Regards,
    NP1. Yes, it contains the output document.
    2. If the output type is PDF then the BLOB contains a zip file which contains the PDF document.
    So first unzip it before rendering
    Cheers
    Jorge
    p.s. If your question is answered then please grant the points and close the thread

  • Inserting Image into BLOB field from URL

    Is it possible to insert an image into a BLOB field from a URL? I don't have access to the filesystem on the server and I have a page that uses PL/PDF to generate dynamic PDF files from data I pull from the database. I would like to include my companies official header with logo on the top of the PDFs I generate and need to somehow get the image which I currently have uploaded to the images section in Application Express and can access from the "Shared Components => Images" section of the Application Builder. I just want to be able to either query whatever table holds those images or copy the image I need to a blob field in one of my tables so I can use it in my PDF document.
    The other alternative (which is what I first mentioned above) would be to try and perform an insert into the BLOB field in my table but the location of the image file would be like "http://www.myportal.com:7777/pls/htmldb/wwv_flow_file_mgr.get_file?p_security_group_id=1234567&p_flow_id=111&p_fname=myimage.jpg".
    Is this possible? If not, what can I do?
    Thanks in advance.

    The reason why I am asking this question in this forum is two-fold:
    1. I am using Application Express (AE).
    2. Since I am using AE all images that I upload to my workspace are stored in a table in a database and not as an actual file in a directory structure like in Windows etc. This being the case, I can't ever reference any of the files that I upload to my workspace in order to insert them into my BLOB field unless I know their physical location on disk (which of course does not exist b/c they are stored in the AE database somewhere). If I knew AE's database and table structure I could do a "select into ..." from whatever table stores my uploaded images and save those images to my own custom table in my BLOB field.

  • Insert BLOB problem

    Hi:
    I'm using oracle 8.1.6 on SunOS 5.7.
    I tried to insert a MS Word file into a blob column, but failed.
    Following are what I did:
    create table test
    (id number primary key,
    text blob
    insert into test (id,text) values (1,empty_blob());
    create directory filedir as '/home/mydir';
    Declare
    lobd BLOB;
    fils BFILE;
    BEGIN
    fils := BFILENAME('filedir','test.doc');
    SELECT text INTO lobd FROM test WHERE id = 1 FOR UPDATE;
    dbms_lob.fileopen(fils, dbms_lob.file_readonly);
    dbms_lob.loadfromfile(lobd, fils, dbms_lob.getlength(fils));
    COMMIT;
    dbms_lob.fileclose(fils);
    END;
    I got error message:
    DECLARE
    ERROR at line 1:
    ORA-22285: non-existent directory or file for FILEOPEN operation
    ORA-06512: at "SYS.DBMS_LOB", line 475
    ORA-06512: at line 7
    The file test.doc is at that directory /home/mydir. I tried to replace
    'filedir' with '/home/mydir' in the line
    fils := BFILENAME('filedir','test.doc');
    but still no success.
    Could anyone give me some advices?
    Thanks,
    George

    Hi Omar,
    Could anyone tell me how to insert a file (say a word doc., or a PDF or a text document) into a column of a table of type BFILE or BLOB. I know that it is possible to map to the physical file on the filesystem thru logical directory creation. But, would like to know how to insert a file into the column and use it later for retireval, string searching, etc. from the queries. Is it thru SQL*Loader? Could u explain me(with example, if poss.) how to do this with the loader utility?
    Pls guide me thru this.
    Thanks!
    Regards,
    Sanjay

  • Blob filename

    i've a table with a blob-column
    i use webutil to save the object to the client.
    but how can i get the original filename of the object? a.e the name of the presentation (when it was uploaded) stored in the db (document.ppt).
    another question is: how can i give the user the possibility to choose between save and open the document which comes from the blob-column?

    i specialy need the file-type: gif,ppt,jpg of the database object.
    if i don't have this, it makes no sense to download the object and save it to the filesystem.

  • Creating Packages from BLOB field contents, line wrap problems

    Good afternoon,
    we use an in-house developed database-driven update system to update both our databases and filesystems, the system itself performs really well but there is still one problem I can't fix without some expert help:
    the code of to-be-updated Oracle packages is stored inside of a BLOB field, the BLOB field will contain both the package specification and package body and needs to be split into two parts to first execute the spec and then to execute the package body (I tried to execute both in a single step but this didn't work). This works for packages with less than 32767 characters and also works in some other cases but I found one case where the executed code contains an extra line wrap right in the middle of a word.
    To make it more clear (I hope it's comprehensible), imagine the following database content:
    CREATE OR REPLACE Package
    MyPack
    AS
    [... a lot procedure headers ...]
    END MyPack;
    CREATE OR REPLACE
    Package Body MyPack AS
    [... a lot more procedures ...]
    PROCEDURE myTest (intID OUT integer)
    AS
    BEGIN
      SELECT count (*) into intID FROM MyTa[--this is where the dbms_lob.substr() ends --]ble;
    END;
    END MyPack;My code searches for the second occurrence of the "Create or replace package", splits the code into spec and body, executes the specification and keeps on adding the rest of the code to a VARCHAR2A variable called "storedCode" from the BLOB. Now in the above example, after the specification has been removed from the string, the remaining characters (ending with the "MyTa" string) are added to the varchar2a variable, the next line is fetched from the BLOB via "dbms_lob.substr()" and added as long as dbms_lob.substr() does not return a NULL value (end of BLOB). When the code is executed after all has been fetched, the generated Package Body will contain an extra line wrap right in the middle of the "MyTable" word compiling the package invalid.
    This is the procedure code I use (definitely improvable, I'm better in MSSQL and MySQL dialects ...) to load, parse and execute the BLOB content:
       -- to run package code
      procedure runPackageCode (stepRef integer)
      AS
        numLines integer default 1;
        pos     integer default 1;
        storedCode    LOG_CHANGEDOBJECT.STOREDOBJECT%type;
        objectCursor  integer;
        lSqlOut     integer;
        sqlCommand  dbms_sql.varchar2a;
        emptyCommand dbms_sql.varchar2a;
        pIsError integer := 0;
        pErrorMsg varchar2(200) := '';
        updateRef integer := 0;
        currentUpdate integer := 0;
        schemaReference varchar2(20);
        -- required to do string cutting
        strLine varchar2(32767);
        strLeftFromSlash varchar2(32767);
        strRemaining varchar2(32767);
        intDelimiterPos integer := 0;
      begin
        -- retrieve update ID
        SELECT log_update_ref INTO currentUpdate FROM link_update_with_taskstep WHERE log_taskstep_ref = stepRef;
         begin
            select storedobject, change_area
            into storedCode, schemaReference
            from vw_storedobjects
            where step_id = stepRef;
         exception
          when no_data_found then
            pIsError := 1;
            pErrorMsg := 'Invalid SQL ID ' || stepRef;
            pkg_generic.LogError(updateRef, 'LocalUpdater', stepRef, 'Run package code failed: ' || pErrorMsg);
         end;
          if pIsError = 0 then     
            begin
              -- change schema
              execute immediate 'alter session set current_schema = ' || schemaReference;         
              objectCursor := dbms_sql.open_cursor;   
              loop
                strLine := UTL_RAW.CAST_TO_VARCHAR2(dbms_lob.substr(storedCode, 32767, pos));
                intDelimiterPos := regexp_instr(strLine, '\s*Create\s*or\s*Replace\s*Package', 2, 1, 0, 'i');
                while intDelimiterPos > 0
                loop
                  -- '/' found, execute currently stored statement
                  strLeftFromSlash := substr(strLine, 1, intDelimiterPos-1);
                  strLine := substr(strLine, intDelimiterPos);
                  -- execute the extracted part without any '/' in it
                  sqlCommand(numLines) := regexp_replace(strLeftFromSlash, '(^|\s+)/(\s+|$)', '', 1, 0, 'm');
                  if (sqlCommand(numLines) is not null) then
                    objectCursor := dbms_sql.open_cursor;   
                    dbms_sql.parse(objectCursor, sqlCommand, 1, numLines, true, dbms_sql.native);
                    lSqlOut := dbms_sql.execute(objectCursor);
                    dbms_sql.close_cursor(objectCursor);
                  end if;
                  -- reset sqlCommand
                  sqlCommand := emptyCommand;
                  -- reset line counter and store remaining string
                  numLines := 1;
                  -- check for further '/'s           
                  intDelimiterPos := regexp_instr(strLine, '\s*Create\s*or\s*Replace\s*Package', 2, 1, 0, 'i');
                end loop;
                -- add the remaining strLine to the sqlCommand
                strLine := regexp_replace(strLine, '(^|\s+)/(\s+|$)', '', 1, 0, 'm');
       --> I assume this line breaks the code, lpad()'ing the content to move it to the end of a varchar2a line didn't help
                sqlCommand(numLines) := strLine;
                exit when sqlCommand(numLines) is null;
                pos := pos+32767;
                numLines := numLines+1;
              end loop;
              objectCursor := dbms_sql.open_cursor;   
              dbms_sql.parse(objectCursor, sqlCommand, 1, numLines, true, dbms_sql.native);   
              lSqlOut := dbms_sql.execute(objectCursor);
              dbms_sql.close_cursor(objectCursor);
              commit;
              -- reset schema
              execute immediate 'alter session set current_schema = UPDATE_DB';
              -- set state to installed
              pkg_update.setstepstate(stepRef, 'Installed');
        exception
        when others then
              -- reset schema
              execute immediate 'alter session set current_schema = UPDATE_DB';
              -- set state to installFailed
              pkg_update.setstepstate(stepRef, 'InstallFailed');
              pkg_generic.LogError(updateRef, 'Database', stepRef, 'Run package code failed: ' || sqlerrm);
        end;
        end if;
      END;    Thanks if you kept on reading so far, I would really appreciate any feedback!
    Regards, Sascha

    Welcome to the forum!
    Whenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
    Thanks for providing an easy-to-understand problem statement and for using code tags.
    >
    the code of to-be-updated Oracle packages is stored inside of a BLOB field
    >
    This should be stored in a CLOB since it is character data. Why are you using BLOB?
    >
    the BLOB field will contain both the package specification and package body and needs to be split into two parts to first execute the spec and then to execute the package body
    >
    Good, clear problem statement. So why doesn't your code do just what you said it should do: 1) split the code into two parts, 2) execute the spec and 3) execute the body.
    Instead of writing code that does these three relatively simple steps your code tries to combine splitting and executing and mushes/mashes it all together. The result, as you found, is code that is hard to understand, hard to debug, doesn't work and doesn't report on what it is doing.
    Code like this doesn't have a performance issue so the code should implement the simple step-by-step process that you so elegantly stated in your problem description:
    1. split the code into two parts
    2. execute the spec
    3. execute the body
    My advice is to refactor your code to perform the above steps in the proper order and to add proper exception handling and reporting for each step. Then when a step isn't working you will know exactly where and what the problem is.
    Here are my recommendations.
    1. Add two CLOB variables - one will hold the spec, the second will hold the body
    2. Add a comment (you have some good ones in the code now) for every step no matter how trivial it may be
    3. Add exception/error handling to EVERY STEP
    Your code for the first step has a comment but no exception handling. What should happen if you don't get any data? Why aren't you validating the data you get? Dynamic SQL using table-driven data is great, I love it, but you MUST validate that the data you get is what you expect to get.
        -- retrieve update ID
        SELECT log_update_ref INTO currentUpdate FROM link_update_with_taskstep WHERE log_taskstep_ref = stepRef;Recommended
        -- step 1 - retrieve update ID - This is the id that determines BLAH, BLAH, BLAH - add appropriate to tell a new developer what this ID is and what it means.
        BEGIN
            SELECT log_update_ref INTO currentUpdate FROM link_update_with_taskstep WHERE log_taskstep_ref = stepRef;
        EXCEPTION
            WHEN ??? THEN -- what should happen if step 1 fails? Do it here - don't default to an exception handler that is several pages away.
        END;Your code
         begin
            select storedobject, change_area
            into storedCode, schemaReference
            from vw_storedobjects
            where step_id = stepRef;
         exception
          when no_data_found then
            pIsError := 1;
            pErrorMsg := 'Invalid SQL ID ' || stepRef;
            pkg_generic.LogError(updateRef, 'LocalUpdater', stepRef, 'Run package code failed: ' || pErrorMsg);
         end;
    Good - except there is no comment that says what this does - I assume that the query above and this block are the 'retrieve update ID ' step?
    You log an error message and set the error flag to '1'. But since you don't want to continue why aren't you exiting the procedure and returning right here?
          if pIsError = 0 then     
            beginSo now you check the error flag and do several pages of code if there were no errors.
    I don't like that 'inverted' logic.
    If you don't want to continue then STOP right now! Don't make a developer scan through pages and pages of code to find out you really aren't doing anything else if there was an error.
    Either put a RETURN statement in the exception handler above or change your code to
          if pIsError = 1 then     
            RETURN;
          end if;Now the rest of the code doesn' t have to be indented; you will never get there if there is an error. Check for errors after every step and exit right then as appropriate.
              -- change schema
              execute immediate 'alter session set current_schema = ' || schemaReference;         
              objectCursor := dbms_sql.open_cursor;   
              loop
                strLine := UTL_RAW.CAST_TO_VARCHAR2(dbms_lob.substr(storedCode, 32767, pos));
                intDelimiterPos := regexp_instr(strLine, '\s*Create\s*or\s*Replace\s*Package', 2, 1, 0, 'i');
                while intDelimiterPos > 0
                loopThis code mixes all of the steps together into one giant mess. You open a cursor, try to split the BLOB into spec and body and try to parse and execute both all within a double nested loop.
    Even if that works correctly another developer will have a hard time understanding what the code is doing and fixing it if it goes wrong. And it will go wrong if you let me test if for you because I will put garbage into the BLOB for the spec, body or both to make sure it breaks and to see how your code handles it.
    I suggest you rewrite this double nested loop to perform the three steps separately.
    1. split the code into two parts
    a. put the spec into one new CLOB variable and the body into the other.
    b. use DBMS_OUTPUT (or a work table) to output the spec and body so you can see what the code is and make sure the 'split' process worked properly. You probably created that BLOB by manually concatenating the SPEC and BODY to begin with so now create a SPLIT process to split them again and give them back to you. This is such a fundamental component that I suggest creating a new SPLIT_MY_BLOB procedure. This procedure would take a BLOB and return two CLOBS as OUT parameters: one CLOB is the spec and one is the body. Then you can reuse this 'split' procedure in other code or more complex versions of code. Modular programming is the key.
    2. execute the spec - Now have a step that executes the spec and does something appropriate if the step succeeds or if it fails. I mean, do you really want to do execute the body if the spec execution fails? What do you want to do? Should you delete the body and spec? If you don't you might wind up with an INVALID body based on old code and an INVALID spec based on the new code you were trying to use. How will anyone, including you, know that the spec and body in the ALL_SOURCE view is really two different versions of things?
    This suggests that for your use case you may want to consider DROPPING the entire package, spec and body, before trying to recreate them both. At least if the package is totally missing anyone will know that the entire thing needs to be put back. Ahhhh - but to do that you need to know the package name so you can drop it. Than may require adding another step to get the package name from your data-driven table and adding a DROP PACKAGE step.
    3. execute the body - This step executes the body. Hmmmm - we have two nearly identical steps. So why don't you create a new function/procedure that takes a CLOB as input, uses dynamic sql to execute it and returns a result code. That would be useful. Then you could execute ANY sql stored in a CLOB and have a generic function that you can use for other things.
    Right now you are using the VARCHAR2 table version of DBMS_SQL.PARSE but you would change this to use the CLOB version.
    The end result of this refactoring is a main function/procedure that acts as the CONTROL - it decides what to do and what data (BLOB) to do it with. But it doesn't actually do ANY of the work. It just controls what is done.
    And you have a couple of generic, reuseable functions that actually do the work. One knows how to split a CLOB into spec and body. The other knows how to use dynamic SQL to execute a CLOB.
    Now you have a modular architecture that is easy to understand, easy to code and easy to test.

  • How to write files to the filesystem with portal/plsql

    Hi,
    is there a way to write files to the filesystem via Portal?
    Or can i call an external programm (perl, php) to do so, while portal writes further information to database?
    thank you for the help
    Ralf Schmitt

    Hi Ralf,
    my primary task is to publish download-links to files stored ... somewhere as a linklist. I tried to store and download files to/from the database but i cant get it to run. Upload works, download doesn't.
    (i'm not talking about a single form-query-download-link! I need a report-like linklist)If you want to do this you'll have to write some code but sure it's possible - i did it myself.
    The links in the link list in your report should call a stored function retrieving the files from Wwdoc_document or whatever is the document table defined in your DAD. Simply select BLOB_CONTENT into a BLOB variable from the table, provided you know what file to read :-) The function would then read the BLOBs and send them to the client's browser via DBMS_LOB - it's poor design but it works just as smooth as it could and it's really performing. This would simply display the file into your browser or prompt for file save location, depending on what browser you are using and its client settings.
    I guess this is not so clear, if you want some more details feel free to e-mail me at [email protected]
    Another way would be to use wpg_docload to both download and upload files to/from the DB.
    Now i try to figure out if it is possible to store the files to the filesystem and write only additional info like description or path into db.Again, yes, it is. I can't recall exactly how I did it ^_^ but the trick is to create a virtual directory in the DB - pointing at a physical directory on the file system you want to write to, and you have to have full read-write permission on the directory itself, and its path must be included in the utl_file_dir database parameter. Then you use both COM Automation or UTL_FILE to write files.
    would it be possible to let a portal-form write info to the db and then pass the file to a php-script?
    regards,
    Ralf Schmitt

Maybe you are looking for

  • XI HTTP Adapter Request Verb

    Hi, Does anyone know if you can change the XI HTTP Adapter verb, so that it sends the request with a different verb e.g. PUT rather then POST? Thanks in advance, Simon

  • Switching from PC to Mac / iTunes: Rating is Gone....

    Irecently switched to Mac and got back my old library using latest itune version but my Ratings is gone... Have more than 3.000 songs and lost all the ratings now... Is there a way to get it back from my old PC Files in iTunes??? Thanks

  • FW vs. USB & can you move a backup folder to a larger drive later?

    I'm about to get an external drive to use for TM. Is Firewire (400 or 800) going to be noticeably faster than a USB drive? I ask because I would think that a single external platter can only transfer so much data to the disk at once and USB might be

  • ITunes with another ripper - keeping the library up to date

    I use dbPowerAmp to rip my music, it handles music in LOTS of formats and converts them in a very efficient way. When it is done ripping the music, it places the songs in my My Music subdirectory. I asked iTunes to "Keep iTunes Music Folder organized

  • EAS/Architecture Question

    Doing some research regarding EAS version 11. I've read on some other threads that Shared Services is not necessary for EAS. However, some other threads seem to indicate it is required for installation. Can anyone help clear this up for me? Thanks. D