Download the content of the blob object

Hi all
I am facing a problem when inserting content of the BLOB in the database.
I have a table (table1) with cat (char) of following column PK, download BLOB, mimetype varchar (1000), type of file varchar (1000)
To insert values in DB (table1), I use the following process here, it works fine
BEGIN
IF (: P9_X IS NOT NULL)
THEN
INSERT INTO table1 (cat, UPLOAD, MIMETYPE, FILETYPE)
SELECT: p9_cat, blob_content, MIME_TYPE, Type_de_fichier FROM wwv_flow_files where name =: P9_X;
END IF;
END;

But, when I tried to have some ID (number PK) in table1 with the process above, I am not able to insert values. During the creation of the process, it throws following error.
INSERT INTO table1 (ID, UPLOAD, MIMETYPE, FILETYPE)
SELECT DEL_SEQ. NEXTVAL, blob_content, MIME_TYPE, Type_de_fichier FROM wwv_flow_files where name =: P9_X;
ORA-06550: line 6, column 24: PL/SQL: ORA-00932: incompatible data types: expected NUMBER obtained BLOB ORA-06550: line 5, column 7: PL/SQL: statement ignored

Thank you.

Hello

If I understand correctly, your UPLOAD table column format is number and you try to insert a BLOB to it.

Kind regards
Jari

Tags: Database

Similar Questions

  • Download the Blob file

    I use ADF BC, Jdeveloper11g 1.1.1.4

    in my application, I need the list down all the files stored in the Blob from a database table field in the af: table, if the user clicks on the name of the file that is linked to af:link, then the file will be opened to show the user the contents of the file.

    There is a sample built in 10g of http://technology.amis.nl/blog/category/oracle/adf-jheadstart, but only limited to types of files as 'doc', 'pdf', 'excel '.

    I think there is a solution put forward 11 g and also not be limited only these three types of file upload & dwonload to & database right of files?

    Could you expert give me only a sample built in 11g to let me study, thank you very much!

    http://KR.forums.Oracle.com/forums/thread.jspa?threadID=1982213 - looks like, you may need to change the contentType depending on the use case

  • Download the BLOB table

    Hello

    How can I download BLOB table. On my page, I use a table with a row displaying the name of the file and I put the af:commandlink type. It is possible with af:fileDownloadListener?

    Hello

    In your table, add a new column

    
      
      
    
    

    You supporting bean (myBean) add this method and replace my your values (name, attribute name iterator)

      public void downloadFileAction(FacesContext ctx, OutputStream out) {
    
          ExternalContext ectx = ctx.getExternalContext();
          Row currentRow = ADFUtils.findIterator("MyIterator").getCurrentRow();
          String fileName = (String)currentRow.getAttribute("FileName");
          BlobDomain content =  (BlobDomain)currentRow.getAttribute("FileContent");
          Long length = content.getLength();
    
          HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
          response.setHeader("Content-Disposition", "attachment;filename=\"" + fileName + "\"");
          response.setContentLength(length.intValue());
          try {
              InputStream in = content.getBinaryStream();
              byte[] buf = new byte[1024];
              int count;
              while ((count = in.read(buf)) >= 0) {
                  out.write(buf, 0, count);
              }
              in.close();
              out.flush();
              out.close();
              ctx.responseComplete();
           } catch (IOException ex) {
              ex.printStackTrace();
          }
    
      }
    

    Concerning

    Nicolas

  • Manually download the blob file in apex

    Hello


    Currently, I load csv files in a table via an apex user interface. The table that contains the data is constructed as follows:

    TBL_UPLOADS

    (

    ID NOT NULL

    BLOB_CONTENT BLOB

    MIME_TYPE VARCHAR2 (255)

    NAME VARCHAR2 (255)

    LAST_UPDATED DATE

    CHARACTER_SET VARCHAR2 (128)

    )

    I have an automatic line (DML) process that defines the operations allowed on the table. In my case, it's only "insert." I also mentioned here a condition that the process runs only when you press the UPLOAD button. I also filled all the attributes of source as Element containing primary key column value (required) etc.

    I also have a DOWNLOAD button. In the section Action when the button clicked on this button the following applies:

    Action: SEND the PAGE

    Run validations: YES
    Action of the databases: ACTION of INSERT SQL

    It all works just fine. I just want the action to the database manually because I want to do more things then just insert. First thing I need to do is to replicate. It is where I am confused. Now I know I need to use a dynamic action for this. I don't know how to insert values into my tbl_uploads (the query insert himself). I looked at examples such as Denes Kubicek - ApEx Solutions , but I do not use the wwv_flow_files table. On the other hand, looks like a history of chickens and eggs for me because I need to insert data in my table (uploads) first.


    Can someone put back me on track?

    You can have multiple processes that have the same State (same IE "when button pressed")

    Thus, when BUTTON_X is pressed, all the processes that meet the condition will run accordingly.

    On this particular page, the first process is the Excel2Collection plugin.  This loads the data in a Collection of the APEX.

    The next process uses a PL/SQL code that transforms and loads data in the actual table.

    The two processes have the Condition "when button pressed" defined on the same button. (P19_UPLOAD)

    MK

    (I don't like the view of 'the tree')

    Details of the process ' file in the Collection ': ('Collection of process' process is identical)

  • Download the Blob in ADF

    Hello

    I want to downlod file Blob of the Oracle database in the adf, can someone help me with this task.

    Thanx.

    See online, download and store the data into a blob

    JDev11.1.2.1.0: Manipulation of images/files ADF (part 2) | JDev & amp; Goodies from the ADF

  • Download the BLOB form

    I have a form with a BLOB column. The column is set to "Browse file". In the value of the source or the expression of the column, it is on:

    'STUDENT_DOCUMENT:attachment:Download '.

    After loading the data and view the page, the 'Download' link poster. I can upload most file types, but when I try to download a word doc, it does not work. I see this in the download dialog box

    'Type - unknown file type '.

    I checked the mimtype in the DB and it has the value "application/msword".

    Have you thought about trying to add the mime_type column in the format for the field of file mask?

    See: http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm#t3

    Trent

  • Download the content of the BLOB from a custom table

    In our application hosted the apex, the following code from the Express on the Application Developer's Guide works great to allow a user to download the contents of the blob of one of our paintings customized via a download button. However, the code does not work on the Cloud Oracle because the 'owa_util' package is no longer available. The code is as follows:

    CREATE OR REPLACE PROCEDURE download_my_file (p_file in number) AS
    v_mime VARCHAR2 (48);
    V_LENGTH NUMBER;
    v_file_name VARCHAR2 (2000);
    Lob_loc BLOB;
    BEGIN
    Name of SELECT MIME_TYPE, BLOB_CONTENT, DBMS_LOB. GETLENGTH (blob_content)
    IN lob_loc, v_file_name, v_mime, v_length
    OF file_subjects
    WHERE id = p_file;
    --
    -set up the HTTP header
    --
    -Use a NVL around the mime type and
    -If it is null it the value application/octect
    -application/octect can initiate a download of windows window
    owa_util.mime_header (nvl(v_mime,'application/octet'), FALSE);

    -set the size so that the browser knows how to download
    HTP.p ("Content-length: ' |") v_length);
    -the name of the file will be used by the browser if users only one save as
    HTP.p ('Content-Disposition: attachment; filename = "" | ") Replace (Replace (substr (v_file_name, InStr(v_file_name,'/') + 1), Chr (10), null), Chr (13), null). '"');
    -close the headers
    owa_util.http_header_close;
    -Download the BLOB
    wpg_docload.download_file (Lob_loc);
    end download_my_file;
    /

    In addition to the use of web services, does anyone know how to do this? Is it possible to add access to the package 'owa_util' in the cloud? I also tried apex_util.get_blob_file_src but that is also not available in the Oracle cloud.

    Thank you

    Steve

    Hi Steve,.

    (1) sys.owa_util is certainly available. You should be able to issue this block very well SQL commands:

    Start
    owa_util.print_cgi_env;
    end;

    ((2) I think the problem is that you have created a procedure that a) cannot not be granted run to the PUBLIC and b) cannot be called directly from the URL (because of a properly locked APEX listener which restricts entry points, i.e..) What procedures can be called directly from the URL).

    Even if there was no prohibition of granting something to the PUBLIC, you would never get by the restriction on the call of your own point of entry of the URL. Also in a facility non - Cloud APEX (and even when you're using mod_plsql), the list of entry points is applied through the PlsqlRequestValidationFunction (http://docs.oracle.com/cd/E23943_01/web.1111/e10144/under_mods.htm#HSADM698).

    Two ways around this:

    (1) you can define a request of the process which, when called, downloads the requested file

    or

    (2) you may want to expose this functionality via a RESTful Service of media resources, even though right now, I'm not necessarily details how you would ensure access to it.

    I hope this helps.

    Joel

  • Download the procedure not found on the server.

    Hello

    I created a feature to download files using the Oracle (http://download.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28839/up_dn_files.htm#CIHBFCDH) tutorial. The files are copied from the flow table in a custom table named SR_ATTACHMENTS with the following structure:

    Default primary key Type Nullable data column name
    IMAGE_ID NUMBER - 1
    NAME VARCHAR2 (60) Yes.
    Filename VARCHAR2 (60) Yes.
    Mime_type VARCHAR2 (60) Yes.
    DOC_SIZE NUMBER Yes-
    CREATED_BY VARCHAR2 (255) Yes.
    DATE of CREATED_ON Yes-
    Content_type VARCHAR2 (60) Yes.
    BLOB BLOB_CONTENT Yes-
    REQ_ID NUMBER Yes-


    There is a file record in the SR_ATTACHMENTS table:

    SELECT MIME_TYPE, BLOB_CONTENT, filename, DBMS_LOB. GETLENGTH (blob_content)
    OF SR_ATTACHMENTS
    WHERE IMAGE_ID = '41090122232687300';

    Results:
    'MIME_TYPE', 'BLOB_CONTENT', 'FILENAME', 'DBMS_LOB. GETLENGTH (BLOB_CONTENT).
    ' application/pdf', "[no support for data type]", "relish_menu.pdf", "90353"


    Here is the link which is built in the apex in the column links:

    #OWNER # .file_download? p_index = #IMAGE_ID #.


    Here is the link as it appears on the page when the cursor is placed:

    http://My_server:7777/pls/Apex/PRSVCREQDEV.file_download?p_index=41090122232687300



    When the user clicks on the link, I get the following error:
    Not found
    The requested URL /pls/apex/PRSVCREQDEV.file_download was not found on this server.



    Here is the procedure:

    CREATE OR REPLACE PROCEDURE file_download (p_file in number) AS
    v_mime VARCHAR2 (48);
    V_LENGTH NUMBER;
    v_file_name VARCHAR2 (2000);
    Lob_loc BLOB;
    BEGIN
    SELECT MIME_TYPE, BLOB_CONTENT, filename, DBMS_LOB. GETLENGTH (blob_content)
    IN lob_loc, v_file_name, v_mime, v_length
    OF SR_ATTACHMENTS
    WHERE IMAGE_ID = p_file;
    --
    -set up the HTTP header
    --
    -Use a NVL around the mime type and
    -If it is null it the value application/octect
    -application/octect can initiate a download of windows window
    owa_util.mime_header (nvl(v_mime,'application/octet'), FALSE);

    -set the size so that the browser knows how to download
    HTP.p ("Content-length: ' |") v_length);
    -the name of the file will be used by the browser if users only one save as
    HTP.p ('Content-Disposition: attachment; filename = "" | ") Replace (Replace (substr (v_file_name, InStr(v_file_name,'/') + 1), Chr (10), null), Chr (13), null). '"');
    -close the headers
    owa_util.http_header_close;
    -Download the BLOB
    wpg_docload.download_file (Lob_loc);
    end file_download;
    /


    Grants are:

    Name of the constituent object of the privilege dealer
    NO PUBLIC PERFORMANCE NO PRSVCREQDEV FILE_DOWNLOAD


    Any help is greatly appreciated!

    Thank you
    Matt

    Hello

    No problem, by the way, don't forget you can assign points to get useful answers here ;)

    John
    --------------------------------------------
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd

  • Not able to see the contents of the BLOB download link in report object

    Hello

    I have a report on a table, the columns of this table is of type blob.

    In the report of the blob column is showing.
    [datatype]
    I wanted a link by which we will be able to d/l the blob file.
    When I check the column to blob column attributes, I don't see "Content BLOB" download under number/Date Format link.
    We have Apex 4.1.1

    Should I change something, so that we can see "Content BLOB" download link?

    Thank you.

    Machan wrote:
    I tried. It just displays the length (integer).
    I don't always get the link!

    What is the value of the attribute Display as ?

    What happens if you enter a BLOB format directly mask as in the example in the docs:

    DOWNLOAD:EMP:RESUME:EMPNO::RESUME_MIMETYPE:RESUME_FILENAME:RESUME_LAST_UPDATE::attachment:Resume
    

    substituting the values of your table/application?

  • How to download the contents of a cd of documents

    I copied some material from my old Mac 10.6 on a CD.

    I downloaded the CD in my new MacPro.  The image of the cd remains... How can I get these documents on my Mac Pro?

    Should I make a new folder? How the content of this CD on my laptop?

    If you haven't already done so, click twice on the CD and drag its content in the Documents folder; It works the same way for other folders. Eject the CD.

    (144519)

  • Is there a way in which I can download iBooks content directly to iCloud by car through my device (iPhone or iPad) without the use of a Mac? If it isn't, I suggest and ask for an update which includes my needs inside. Thank you

    Is there a way in which I can download iBooks content directly to iCloud drive through my device (iPhone or iPad),without the use of a Mac?

    Otherwise, I suggest and ask for an update which includes my needs inside. Thank you

    See synchronize ePub, Books author iBooks and PDFs with iBooks and iCloud - Apple Support.

    TT2

  • After downloading 4.0 I get this message: application JavaScript is unable to create the plugin object of mcafee: TypeError: components.classes['@ [cid] is undefined

    I finished to download Firefox for my Mac OS 4.o. X.
    When I try to open a Web site, I get the message:
    [JavaScript Application] cannot create the plugin object of mcafee: TypeError: components.classes['@ [cid] is undefined
    If I click on the OK button, the site opens, but without the alert McAfee at the bottom of the window.
    I had just downloaded 3.6.16 and got box suggesting version 4.0 download for better security, but that seems to be where the problem is!

    This indicates that an add-on that you use is not compatible, considering the other errors, maybe it's the McAfee add-in. To confirm that the module is originally, use the procedure in this link - https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Fed up with Mail. When I open mail it says it is downloading the messages, it can be 2, 3 or more and that is true for a long time. I have to close and reopen to get the content of the messages. Often the mail charge the same messages.

    Fed up with Mail.

    When I open mail it says it is downloading the messages, there may be 2 or 3 messages to load and this is true for several minutes. While showing that it's always getting new messages, Mail displays the message header but not the content, I have to close to stop this lengthy process erratic and reopen it to get the content of the messages. Often Mail load the same message 2 or 3 times, even if I leave the app end its process, Yes, because sometimes it ends.

    Is there anyone who has the answer to this?

    I am seriously thinking of abandonment of post and take something else to manage my emails.

    Thank you for your community!

    You have created all of the subfolders of the Inbox for the account?

  • I can't download the application for mac windows phone. The message: you are interested in the content is now available in the store. How can I synchronize microsoft limia and macbook?

    I can't download the application for mac windows phone. The message: you are interested in the content is now available in the store. How can I synchronize microsoft limia and macbook?

    Contact Ms and ask them.  Only they dictate where their application is made available.

  • How to download the content of the HTML page

    Is it possible to download the content of the HTML page...

    I mean frm application click on webpage link open HTML... Download its contents to a location specific to the BlackBerry.

    How if it is possible?

    And another question... How do I navigate the application in the way...

    ---> text is displayed as link... click goto... another screen to display information about this text...

    Waiting for your kind answers...

    Thnx

    Download html would be using a httpconnection. check the samples that are provided with the jde or use the strength of the research.

    You can catch clicks by navigationclick by replacing or by implementing and adding a fieldchangelistener.

Maybe you are looking for

  • FaceTime problems

    I tried to configure Facetime on my iOS9 running of the iPad 2. I go as far as to connect and iOS says that I have to use an email address verified - who I am and since I bought the iPad at the time when it was new. can someone tell me what I'm doing

  • Satellite M40X-309 LCD problem

    When I see movies .avi (MediaPlayer or WinDVD) images are vertically pixelated.The icons are not quite correct. It seems that some vertical lines have no color information.Can anyone help? I downloaded the latest Toshiba display driver.

  • Help with LM358 op amp circuit

    I'm simulating a circuit using LM358N op amp to amplify the signal of the IC NE555P timer and then this signal amplified to switch the LED by a transistor switch. In theory, I think that when the key switch is off, there must be no signal no signal g

  • During the selction DLL I always get error 1097

    Hello! I would like to include a DLL in my labview program. I fear, I still get the error 1097. ------------------------------- Possible reasons: LabVIEW: An exception occurred in the external code that is called by a node call library feature. The e

  • I would like to know if windows xp professional keeps a log of the files burned on a cd.

    I conduct an investigation for a case of data theft. I want to know: 1. what files were burned/texts on cd. 2. If windows xp professional keeps a log of these activities. If Yes, how to access?