Storing BLOB data with my own procedure

Hi guys,
I'm kind of new on APEX, already search through the forum and did not find something about my issue.
I have a procedure, that inserts a new record on a table, this new record has a BLOB column. Also the procedure does some parallel validations and insertions to other tables (totally unrelated but it depends on the unique ID generated for the row where the BLOB is).
I want to know if I use my own procedure for inserting a new BLOB will it populate the mimetype, filename, last_update and character_set columns? or, that can only be done by using the predetermined Form Wizard that APEX offers, with the Automatic Row Processing (DML).
I really need to use my procedure cause I have some extra validations and I depend of the unique ID that is generated in Real Time, and I dont think there is a way to modify an Automatic Row Processing.
And if I create a parallel process, how can I get the same ID APEX just used for the row with the Blob file, to update with other information I need to store after validating it?
I thought on retrieving the last ID generated to go back and insert what my procedure does but this can be risky as other user can be inserting a new blob record at the same moment.

>
Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and ensure you have updated with your profile with a real handle instead of "876236".
You'll get a faster, more effective response to your questions by including as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB version and edition
<li>Web server architecture (EPG, OHS or APEX listener)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region type(s)
I have a procedure, that inserts a new record on a table, this new record has a BLOB column. Also the procedure does some parallel validations and insertions to other tables (totally unrelated but it depends on the unique ID generated for the row where the BLOB is).How can it be "totally unrelated" if it "depends on the unique ID generated for the row where the BLOB is"?
I want to know if I use my own procedure for inserting a new BLOB will it populate the mimetype, filename, last_update and character_set columns? Magically? No. You would have to use the Table WWV_FLOW_FILES Storage Type for the file browse item, transferring the BLOB from the <tt>apex_application_files</tt> view (the preferred way to access <tt>wwv_flow_files</tt>). This also contains columns for the file metadata:
select blob_content, filename, mime_type, last_updated
into   ... /* procedure variables */
from   apex_application_files
where  name = :p1_blob_file /* BLOB file browse item */Character set information has to be handled using a separate item as in declarative BLOB support.

Similar Messages

  • How to handle blob data with java and mysql and hibernate

    Dear all,
    I am using java 1.6 and mysql 5.5 and hibernate 3.0 . Some time i use blob data type . Earlier my project's data base was oracle 10g but now i am converting it to Mysql and now i am facing problem to save and fetch blob data to mysql database . Can anybody give me the source code for blob handling with java+Mysql+Hibernate
    now my code is :--
    ==================================================
    *.hbm.xml :--
    <property name="image" column="IMAGE" type="com.shrisure.server.usertype.BinaryBlobType" insert="true" update="true" lazy="false"/>
    ===================================================
    *.java :--
    package com.shrisure.server.usertype;
    import java.io.OutputStream;
    import java.io.Serializable;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Types;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import oracle.sql.BLOB;
    import org.hibernate.HibernateException;
    import org.hibernate.usertype.UserType;
    import org.jboss.resource.adapter.jdbc.WrappedConnection;
    import com.google.gwt.user.client.rpc.IsSerializable;
    public class BinaryBlobType implements UserType, java.io.Serializable, IsSerializable {
    private static final long serialVersionUID = 1111222233331231L;
    public int[] sqlTypes() {
    return new int[] { Types.BLOB };
    public Class returnedClass() {
    return byte[].class;
    public boolean equals(Object x, Object y) {
    return (x == y) || (x != null && y != null && java.util.Arrays.equals((byte[]) x, (byte[]) y));
    public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
    BLOB tempBlob = null;
    WrappedConnection wc = null;
    try {
    if (value != null) {
    Connection oracleConnection = st.getConnection();
    if (oracleConnection instanceof oracle.jdbc.driver.OracleConnection) {
    tempBlob = BLOB.createTemporary(oracleConnection, true, BLOB.DURATION_SESSION);
    if (oracleConnection instanceof org.jboss.resource.adapter.jdbc.WrappedConnection) {
    InitialContext ctx = new InitialContext();
    DataSource dataSource = (DataSource) ctx.lookup("java:/DefaultDS");
    Connection dsConn = dataSource.getConnection();
    wc = (WrappedConnection) dsConn;
    // with getUnderlying connection method , cast it to Oracle
    // Connection
    oracleConnection = wc.getUnderlyingConnection();
    tempBlob = BLOB.createTemporary(oracleConnection, true, BLOB.DURATION_SESSION);
    tempBlob.open(BLOB.MODE_READWRITE);
    OutputStream tempBlobWriter = tempBlob.getBinaryOutputStream();// setBinaryStream(1);
    tempBlobWriter.write((byte[]) value);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    tempBlob.close();
    st.setBlob(index, tempBlob);
    } else {
    st.setBlob(index, BLOB.empty_lob());
    } catch (Exception exp) {
    if (tempBlob != null) {
    tempBlob.freeTemporary();
    exp.printStackTrace();
    st.setBlob(index, BLOB.empty_lob());
    // throw new RuntimeException();
    } finally {
    if (wc != null) {
    wc.close();
    public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
    final Blob blob = rs.getBlob(names[0]);
    return blob != null ? blob.getBytes(1, (int) blob.length()) : null;
    public Object deepCopy(Object value) {
    if (value == null)
    return null;
    byte[] bytes = (byte[]) value;
    byte[] result = new byte[bytes.length];
    System.arraycopy(bytes, 0, result, 0, bytes.length);
    return result;
    public boolean isMutable() {
    return true;
    public Object assemble(Serializable arg0, Object arg1) throws HibernateException {
    return assemble(arg0, arg1);
    public Serializable disassemble(Object arg0) throws HibernateException {
    return disassemble(arg0);
    public int hashCode(Object arg0) throws HibernateException {
    return hashCode();
    public Object replace(Object arg0, Object arg1, Object arg2) throws HibernateException {
    return replace(arg0, arg1, arg2);
    =================================================================
    can anyone give me the source code for this BinaryBlobType.java according to mysql blob handling ..

    Moderator action: crosspost deleted.

  • Problem storing BLOB data

    Hello all
    I have created a directory where I have some images and I'm trying to store these in my database using the code below. The code, schema for the image table and the error is shown below.
    SQL> DECLARE
    2 photo_loc BFILE;
    3 photo BLOB;
    4 BEGIN
    5 INSERT INTO image_ids VALUES(1,'P44240', EMPTY_BLOB(), 'an_image')
    6 returning image into photo;
    7
    8 photo_loc := BFILENAME('IMAGE_DATA', '18.jpg');
    9 DBMS_LOB.FILEOPEN(photo_loc);
    10
    11 DBMS_LOB.LOADBLOBFROMFILE(photo, photo_loc, DBMS_LOB.getlength(photo_loc), 1,1);
    12 DBMS_LOB.FILECLOSE(photo_loc);
    13 END;
    14 /
    DBMS_LOB.LOADBLOBFROMFILE(photo, photo_loc, DBMS_LOB.getlength(photo_loc), 1,1);
    ERROR at line 11:
    ORA-06550: line 11, column 77:
    PLS-00363: expression '1' cannot be used as an assignment target
    ORA-06550: line 11, column 79:
    PLS-00363: expression '1' cannot be used as an assignment target
    ORA-06550: line 11, column 2:
    PL/SQL: Statement ignored
    IMAGE_ID NOT NULL NUMBER(10)
    SI_PRODUCT_ID NOT NULL VARCHAR2(10)
    IMAGE BLOB
    IMAGE_DESCRIPTION VARCHAR2(100)
    Any help would be greatly appreciated.
    Thanks
    Ben.

    the error says that you have to replace the constant 1 with a variable. Please review the syntax.

  • How does Sharepoint 2013 Server farm using BLOB data, Hyper-V with virtual machines storing the BLOB data?

    Hello Community
        A Sharepoint 2013 Server farm created on a physical server
    stores it's documents in SQL Server according to how SQL Server is setup.
        If a Sharepoint 2013 Server farm is using Hyper-V and Virtual machines
    how is BLOB data stored ?  
        Thank you
        Shabeaut

    Are you looking to use Remote Blob Storage? or RBS of SQL with SP?
    It is going to be same way as it is configured for physical server.
    Thanks, Ashish | Please mark a post helpful/answer if it is helpful or answer your query.

  • Oracle 01g and forms 6i with BLOB Data type

    Dear All,
    I have upgraded my database from oracle 9i R2 to oracle 10g R2. i have an application developed using oracle forms and reports 6i. this application have a form where it stores and retirive an image from the database, this image is stored in a table with a BLOB data type, it was being retrieved fine until we did the upgrade and now it is impossible for me to see the image and i am getting an error every time i retrive the data. it always pop a message saying that "INCONSISTENT DATA TYPE"
    please guys help.
    Regards

    you can try this procedure
    DECLARE
    t_blob BLOB;
    t_len NUMBER;
    t_file_name VARCHAR2(100);
    t_output UTL_FILE.file_type;
    t_TotalSize number;
    t_position number := 1;
    t_chucklen NUMBER := 4096;
    t_chuck raw(4096);
    t_remain number;
    BEGIN
    -- Get length of blob
    SELECT DBMS_LOB.getlength (PHOTO), ename || '_1.jpg'
    INTO t_TotalSize, t_file_name FROM DEMO WHERE ENAME ='moon';
    t_remain := t_TotalSize;
    -- The directory TEMPDIR should exist before executing
    t_output := UTL_FILE.fopen ('TEMPDIR', t_file_name, 'wb', 32760);
    -- Get BLOB
    SELECT PHOTO INTO t_blob FROM DEMO WHERE ENAME ='moon';
    -- Retrieving BLOB
    WHILE t_position < t_TotalSize
    LOOP
    DBMS_LOB.READ (t_blob, t_chucklen, t_position, t_chuck);
    UTL_FILE.put_raw (t_output, t_chuck);
    UTL_FILE.fflush (t_output);
    t_position := t_position + t_chucklen;
    t_remain := t_remain - t_chucklen;
    IF t_remain < 4096
    THEN
    t_chucklen := t_remain;
    END IF;
    END LOOP;
    END;
    it will work

  • Can i use iCloud keychain with my own passwords and not with what is assigned and stored?

    Can i use iCloud keychain with my own passwords and not with what is assigned and stored?

    tammersalem wrote:) <-HDMI-> (HDTV)
    My main concerns are:
    -If I use iTunes on my main computer, will it then be available to Apple TV?
    -If I use Apple TV to download will it be available to my Main computer?
    -Can the Apple TV use a media server for storage over LAN (using NTFS Samab or otherwise)?
    Basically iTunes feeds AppleTv with media either syncing (copying to it) or streaming live.
    Media must be compatible with AppleTV.
    AppleTV requires a proper iTunes instance running - it cannot access a NAS directly.
    If you store media in a folder on a NAS and it's part of the computer iTunes library (just stored on the NAS vs internal/external drive), then when running iTunes makes this content available to AppleTV.
    Data will travel:
    NAS > network > iTunes > network to AppleTV
    As the path is potentially slower than internal/external attached drive > iTunes > network > AppleTV, it may or may not work robustly for streaming.
    If AppleTv is set to sync (it can also stream in this mode), when you purchase direct on AppleTV, the media should sync back to where the itunes library is stored (via iTunes) to keep things in sync and to allow you to backup the media.
    You cannot drag/drop media to/from AppleTv across the network, nor can it directly access storage itself - iTunes is an essential cog in the wheel.
    The majority of commercial 'in-built iTunes media servers' will not work directly with AppleTV as it has to be 'paired' with iTunes by entering a numerical code in iTunes and does not simply see 'shared libraries'.

  • How to Scramble BLOB data stored in Tables

    I have received a directive from the top management, in their drive to comply with security standards, that BLOB data stored in the database ( e.g., Word, Excel, PDF, .... documents) needs to be scrambled in DEV environment.
    I have written up a routine which will scramble CHAR/VARCHAR/NUMBER, as this sounded more logical to me.
    But, have come to a stand-still in figuring out how to scramble binary data??????
    Is this at all possible? To me, it sounds impossible, but I'm open to ideas.
    Has anyone out there thought up of a solution to this?
    If so, please do advice.
    Eager to know.

    Hello Dave & BluShadow,
    Thanks for your responses.
    So, 10g is the answer huh.... That's not going to make people jump with joy, at least they'll hold off on this for now. My other possible alternative, is to have one dummy BLOB each of Word Doc, Excel, PDF, ... and overwrite each actual file attachment with the dummy. I know... I know.. not the best.
    Regarding the management stuff... Hmm... This entire thing comes up because of the policy of refreshing the DEV / TEST environments with the actual production data. They've been doing this for a long long time.... The Good side to this is that they've taken the step in the right direction on this one, though I wish it would have been to totally avoid doing this kind of a refresh and use test data.
    Thanks again. Do let me know if there's anyother alternative too.

  • I would like to freeze saving to icloud and perhaps transfer some of that data to my own external hard drive.  I don't want to lose anything already stored there, but don't want to purchase anymore cloud space.  How do i accomplish this?

    I would like to freeze saving to icloud and perhaps transfer some of that data to my own external hard drive.  I don't want to lose anything already stored there, but don't want to purchase anymore cloud space.  How do i accomplish this?

    It seems that saving to iCloud is a default.  My Pages documents automatically save there unless I change to save to destination.  I probably just need help in setting up the cloud.  When I tried to change the setting, though, it told me that if I made the change, all data on icloud would be eliminated and i don't want that.  I would ideally like to save everything on my external HD and not bother with iCloud.  Certainly don't want to buy more storage space.  Thanks for replying so promptly.

  • HT4859 How can I verify that my App data is actually stored in iCloud. With Dropbox, I can actually see my stored files. With iCloud, itseems I'm supposed 2 just trust that Appl has the data. Short of doing a restore is there no way to check the data?

    How can I verify that my App data is actually stored in the iCloud. I can see and access my notebook, contacts etc. on the iCloud website, and I can see my photos in a folder on my Windows-based desktop compter (iCloud/Photostream). But no app data.
    With Dropbox, I can actually see all of my stored files. With iCloud, it seems, I'm supposed to just trust that Apple has my back. Short of deliberately trashing my app data and then attempting a restore, is there no way to check the data?

    You can't access them on Windows (unless you have iCloud enabled Windows programs) and I don't think any are, yet.
    iCloud data is accessed via Apps/Programs, the Windows programs vendors will have to step up (just to make it worse Microsoft have not yet enabled their Mac programs, such as Office yet) I doubt that iCloud access is much of a priority for them, complain to MS, when enough Windows users complain maybe they'll do something.

  • Problem with Exporting a Table with BLOB data.

    Hello All,
    I get error messages while exporting a table from Oracle8i ( 8.1.7.4.1), containing BLOB data:
    ORA-01555: snapshot too old: rollback segment number with name "" too small
    ORA-22924: snapshot too old
    Metalink says there is a bug in release 8.1.7.4.1 and suggests to create a new tablespace (with manual space management) ant move BLOB object to this TB.
    Can i solve this problem without creating a new tablespace ?
    Maybe somebody's experienced in such problem.
    thank you in advance.

    Maybe you could solve Your problem without creating new tablespace.
    Consider changing the value of MAX_ROLLBACK_SEGMENTS to max value if currently is not at that value and creating new bigger rollback segments.

  • If i associate my apple id with another email will i lose my icloud data or i will still be able to access all my stored data with the new linked to my apple id email address?

    hi there
    if i associate my apple id with another email will i lose my icloud data or i will still be able to access all my stored data with the new linked to my apple id email address?
    i mean i am not signing up for a new account, just changing my old id primary email which is my apple id login into account.
    in other words, www.icloud.com will recognize that it is still me if i login on the site? will i be able to see there all my stored information?
    and if i change my password, does it automatically changes the @icloud.com password which should be the same as my apple id pass?
    thanks

    After opening the email it shoud of had you enter the Apple ID and password. Using certian web browser's can cause errors. You can adjust securty settings (big pain) or you use another browser. Using Firefox or Safari should do the trick.
    Let me know if using Firefox or Safari resolved it.

  • Migrating MySQL5 database to Oracle 10g - table with blob data fails

    During data migration phase from MySQL5 to Oracle, noticed that the tables that have record length greater than 64K fails. It just says FINISHED for those tables without migrating any data. This is specially happening in the tables that have text and blob columns with data more than 20Meg in the blob fields.
    Is this a bug? If not is ther any configuration file to increase the record size? Does it use SQL*Loader underneath to transfer the data or some other mechanism?

    Thanks Spain, but using Offline scripts does not work for me as my record length is around 28MB and SQL*loader allows maximum record length of 20MB.
    Is there any way to dump just the blob column data out of MySQL into a separate file?

  • Need help for storing time along with the date

    Hi,
    I have one procedure as follows, In last_update_column of the table job_data having date and time.But after execution of this procedure only date is inserting into the job_master.
    If I queires the table job_master with to_char(Last_Update_Date, 'DD-MM-YYYY HH24:MI:SS') , then it is showing time as 12:00:00.
    I tried to insert date with to_char,to_date format but it is not working.
    Please provide me the solution.
    Thanks in advance.
    create or replace
    PROCEDURE         SP_LOAD_JOB
    IS
    CURSOR CUR_DATA  IS
            SELECT   PARENT_ITEM,
         `               CHILD_ITEM_ID,
                   LAST_UPDATE_DATE
      FROM job_data,
    BEGIN
      For Cursor_job In CUR_DATA
                 Loop
                 Exit When CUR_DATA%Notfound;           
        Insert Into job_master(parent_Code,
                                       child_code,
                                       last_update_date)
    values(
                             Cursor_job.PARENT_ITEM,
                             Cursor_job.CHILD_ITEM_ID, ,
                             Cursor_job.Assembly_Item_Id,
                              Cursor_Bom.LAST_UPDATE_DATE)
    commit;
    end loop;
    END;

    Hi,
    I don't believe you
    First to input time to job_master from job_data table first you have to store time in job_data.
    execute 
    select LAST_UPDATE_DATE from job_data
    and show result.
    Second remark : your procedure will not compile success Because
        Insert Into job_master(parent_Code,
                                       child_code,
                                       last_update_date)  ---3columns
       values(
                             Cursor_job.PARENT_ITEM,
                             Cursor_job.CHILD_ITEM_ID, ,
                             Cursor_job.Assembly_Item_Id,
                              Cursor_Bom.LAST_UPDATE_DATE) ----4columns
    Third remark : why to insert into table from other you wrote procedure???! you need only type insert stmt like this
        Insert Into job_master(parent_Code,
                                       child_code,
                                       last_update_date)
        select .... from  job_data
    Ramin Hashimzade

  • Output Further Data : Send with application own transaction

    Hi ,
    I have a ungernt issue as..We have an invoice print output processing at different times for same dealer as the despatch time is same i.e Send with application own transaction.(Further data , despatch time is 3 , send with application own transaction)
    Ex:
    XXXXinvoice; YD00 created on 09/19/2007 21:54:47 Actual processing time: 09/19/2007 21:57:34  diff is 167 sec
    YYYY invoice; YD00 created on 10/21/2007 22:08:26 Actual processing time is 10/23/2007 20:18:26 diff is appox 2 days
    Can anybody look into this and respond with why it is taking different times for the same dealer and what is this send with application own transaction meant for..
    Thanks in advance,
    Sastry

    'Send with application own transaction' basically means that the message would not ordinarily be processed by the transaction or by RSNAST00 in batch. Instead a user might manually release the output, or it might be released by a custom program. We use this in our organisation to release outputs under certain conditions, conditions that cannot be met within an output requirement. For example, we use a certain Shipment status to release all of it's Delivery outputs.
    I would suspect a program is processing the outputs in your system, either directly, or indirectly by changing the NAST-VSZTP to '1' for a subsequent RSNAST00 batch run to pickup. Find out which user processed the output, and if a batch user, see if there are any jobs in SM37 for that user for that timeframe.
    Good luck,
    Paul.

  • Pdf file stored as BLOB data type on Oracle

    I store PDF file as BLOB data type on Oracle. There are cases
    where I get multiple records from the database, that means I get
    multiple PDF files. They have to be merged and displayed on the web
    page. I tried CFContent which can display only one PDF file at a
    time but not more than one, whereas cfdocument is having problem
    converting binary data to string. I am kind of stuck.
    Can you anybody please help me out? Please let me know if you
    have any questions or this does not make sense to you.
    Thank you in advance.

    BALAJI_JAY wrote:
    > Can you anybody please help me out? Please let me know
    if you have any
    > questions or this does not make sense to you.
    if by "merge" you mean 3 pdf into 1 pdf, try cfpdf (if on
    cf8) or see this
    thread if cf version less than 8:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=1&catid=7&threadid=11 14635&messageid=4032202

Maybe you are looking for

  • Email and BBM Notifications

    I just got a replacement phone and I get sounds notifications for both email and BBM that I want to adjust or turn off.  That said, when I go to the "notifications" area of "System Settings" and scroll down to "Applications" I do not have either "Ema

  • How can i transfer a field value in the main report to its sub-report?

    <p><font face="Arial" size="2">How can i transfer a field value in the main report to its sub-report?</font></p><p><font face="Arial" size="2">Please eloberate with example if possible!</font></p><p><font face="Arial" size="2">Thanks...</font></p><p>

  • Lion, mail 5.0 and PDF problem

    Hi guys, I've got couple of problems with sending PDF files: (my OS is in finnish, so the translations are not accurate, but you get the picture) a) from print-pdf-send to mail. The PDF attachment is visible in the mail to be sent, but when you write

  • How do I disable InContext Editing code hints in Dreamweaver CS6?

    The service was discontinued in 2011, why does the latest version of Dreamweaver not make it easy to disable these code hints? There are no options to disable them, and I've gone so far as to comment out every individual line of the ICE.vtm file yet

  • Dynamic  include file question

    I need to use dynamically generated file names in my <%@ include file="" %> directive. I am using objects (such as database connection) in the files included which I created in my base JSP file. For this reason, I cannot use the jsp:include tag (sinc