Visual C++, CMap object save to blob column

I have a MFC CMap object, each object stores 160K~ entries of long data. I need to store it on Oracle SQL. we decided to save it as a blob. since we do not want to make additional table. we also thought about saving it as local file and point the SQL column to that file, but we rather just keep it as blob on the server and clear the table every couple of weeks.
The table has a sequential key as ID, and 2 column of time. I need to add the blob column in order to store on every row that CMap.
Can you recommend a guide to do so (read/write Map to blob or maybe a clob) ? Thanks.

The LOB exists in server memory. Your code cannot access that memory for a memcpy or similar calls. Your code deals with a LOB locator variable (another name for a pointer) - and casting this makes no sense. Casting it does not deference it.
The DBMS_LOB PL/SQL interface exposes the basic interface for LOBs. This, and client drivers, use the OCI (Oracle Call Interface) under the hood.
The OCI provides a ranges of features - including binding host variables (variables in your code) to bind variables (variables in PL/SQL and SQL calls to the database). See Oracle® Call Interface Programmer's Guide for binding LOBs.
The functionality of the OCI needs to be exposed by whatever db abstract interface you use. If it does not do that properly, then you can use PL/SQL as the interface. Or call the OCI directly.

Similar Messages

  • Apache FOP PDF Save in BLOB column

    Hi,
    I just want to call Apache FOP in an APEX process to create PDF reports and save these reports in a BLOB column in the same database. So I can email these reports in another process using APEX_MAIL. Does anyone know a way to achieve this?
    Thanks

    If I understand correctly, your requirements needs to be broken down into two problems:
    1) click link that pops up a window displaying a new APEX page
    2) an APEX page the displays the document, not downloads it.
    I haven't done #1 (yet).
    However, you may be able to generate a URL that points to the new page as part of the SELECT statement for the Report.
    This has a related question, but no answer yet:
    open pdf in popup browser window
    The key is target="_blank" for the anchor tag.
    To generate the URL, you should use the APEX_UTIL.prepare_URL() function.
    If that doesn't work, a Dynamic Action that does some magical JavaScript stuff may be needed.
    For #2, I lost the URL that showed how to display a PDF as part of a "form" page.
    From what I remember:
    Start with a blank page with one blank HTML region (all the Items go in the HTML region)
    Add an Item for the PK/Doc_ID
    part I forgot Create a Data Manipulation Process
    - Automated Row Fetch
    - On Load - After Header
    - (stuff for your table/view)
    part I forgot Create an (I believe) "File Browser" item type. For Settings:
    - Storage Type "BLOB column specified in Item Source" (and place the column name of the BLOB there)
    - MIME Type Column: (column name) -- since you have multiple types, this is a MUST HAVE
    - Filename Column: (column name) -- I highly recommend you have this.
    - Content Disposition == INLINE <-- this is the kicker
    Also, you will need a Browser Plugin for each of the MIME Types (otherwise, the browser may try to 'download' the file)
    Browsers can handle Image types internally. Adobe's plugin can handle PDFs. I don't know about Word/Excel.
    Again, I don't remember the exact details, but that should cover most of it.
    MK

  • Inserting Hashtable into a BLOB column..

    Hi,
    Iam trying to store a hashtable object into a BLOB column..when i try to retrieve
    from hte blob column i get the following exception
    StreamCorruptedException:out of range is 0

    I could insert into database successfully,while retrieving I got this exception.
    I could able to insert and retrieve anyother java objects except Hashtable and
    HashMap...
    also I tried putting Hasttable into a Vector..that also didn'
    t work.
    thanks in advance.
    Muthu
    public void conn(){
    ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
    ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
              try {
                   ctx = new InitialContext(ht);
                   javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("WorkFlowDataSource");
                   java.sql.Connection connection = ds.getConnection();
              connection.setAutoCommit(false);
              Statement statement = connection.createStatement();
              rs = statement.executeQuery("select blob_data from test for update");
              while (rs.next()) {
                        myRegularBlob = rs.getBlob("blob_data");
              OutputStream os = ((weblogic.jdbc.common.OracleBlob)myRegularBlob).getBinaryOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(os);
              Hashtable hash = new Hashtable();
              hash.put("1","111111111hgfdhgkdkvalue");
              oos.writeObject(hash);
              oos.flush();
              connection.commit();
              System.out.println("Object inserted into persistence..");
              rs.close();
              statement.close();
              } catch(Exception ex){
                   ex.printStackTrace();
              retrieve();
              public void retrieve(){
              try {
                        ctx = new InitialContext(ht);
                        javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("WorkFlowDataSource");
                        java.sql.Connection connection = ds.getConnection();
                        Statement statement = connection.createStatement();
                        rs = statement.executeQuery("select blob_data from test ");
              while (rs.next()) {
              myRegularBlob = rs.getBlob("blob_data");
              ObjectInputStream oos1 = new ObjectInputStream(os1);
              Hashtable sections = (Hashtable)oos1.readObject();
              System.out.println("Obj retrieved..\n"+sections);
              statement.close();
              rs.close();
              connection.close();
         } catch(Exception ex){
              ex.printStackTrace();
    "Slava Imeshev" <[email protected]> wrote:
    Muthu,
    could you show us how you write/read the hashtable?
    Regards,
    Slava Imeshev
    "Muthu" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    Iam trying to store a hashtable object into a BLOB column..when i tryto
    retrieve
    from hte blob column i get the following exception
    StreamCorruptedException:out of range is 0

  • Save Uploaded file in BLOB column of Database

    Hey,
    Anyone knows how to save uploaded file in BLOB column of database.
    Please need help asap.
    i get following error:
    Cannot convert org.apache.myfaces.trinidadinternal.config.upload.UploadedFiles$FixFilename@1c1fc8d of type class org.apache.myfaces.trinidadinternal.config.upload.UploadedFiles$FixFilename to class oracle.jbo.domain.BlobDomain.
    Can anyone tell me what needs to be done.
    Thanks,
    Sneha

    Hi Timo,
    We are using oracle Jdeveloper Studio Edition Version 11.1.1.6.0 . logs are just showing nullpointer exception. Following errors are shown in logs:
    <ActionListenerImpl> <processAction> java.lang.NullPointerException
    javax.faces.el.EvaluationException: java.lang.NullPointerException
      at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
      at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
      at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
      at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
      at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1018)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:386)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
      at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
      at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
      at java.security.AccessController.doPrivileged(Native Method)
      at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
      at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
      at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
      at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
      at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.lang.NullPointerException
      at view.bean3.ImageBean.uploadFileValueChangeEvent(ImageBean.java:80)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.el.parser.AstValue.invoke(Unknown Source)
      at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
      at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
      ... 51 more
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5
    javax.faces.FacesException: #{samplebean2.uploadFileValueChangeEvent}: java.lang.NullPointerException
    And one more error i get and i.e.
    XmlErrorHandler> <handleError> ADF_FACES-60096:Server Exception during PPR, #1
    javax.servlet.ServletException: java.lang.NullPointerException
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
      at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
      at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
      at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
      at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
      at java.security.AccessController.doPrivileged(Native Method)
      at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
      at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
      at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
      at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
      at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
      at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
      at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: javax.faces.el.EvaluationException: java.lang.NullPointerException
      at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:51)
      at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
      at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
      at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
      at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
      at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
      at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1018)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:386)
      at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
      ... 36 more
    Caused by: java.lang.NullPointerException
      at view.bean3.ImageBean.uploadFileValueChangeEvent(ImageBean.java:80)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.el.parser.AstValue.invoke(Unknown Source)
      at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
      at org.apache.myfaces.trinidad.component.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:46)
      ... 51 more
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: Attempt to access dead view row of persistent id 17
    oracle.jbo.DeadViewRowAccessException: JBO-27102: Attempt to access dead view row of persistent id 17
    Can you help me on this one. Any other details you need let me know.

  • Save Documents on BLOB Columns

    Please, help me with this:
    I created a new table:
    CREATE TABLE testfile
    (file blob);
    and created a new Form with Ole Container Item to save document on Database.
    I can insert new Word Document and edit this doing double click on the container, but, when save (commit) record on the database, I can't edit again the Word document, becuase Forms show next error:
    FRM-40501: ORACLE error: unable to reserve record for update or delete
    I checked all Block and Item Properties and all is Ok
    Insert Allowed = Yes
    Update Allowed = Yes
    Delete Allowed = Yes
    Locking Mode = Automatic
    Key Mode = Automatic
    I'm using Oracle8i Enterprise Edition Release 8.1.7.3.0
    and forms 6i (Version 6.0.8.8.0)
    Thanks for you help

    Try initializing the blob column to Empty blob and then try saving

  • Interactive Report will not save BLOB Column Attributes

    I have created many interactive reports with 4.0 and 4.1 that had BLOB columns with no problems and the download link worked fine. After upgrading to 4.2, the interactive reports get the following error when clicking on the download link:
    Not found
    The requested URL /apex/apex_util.get_blob was not found on this server
    If I open the edit page from the report, the BLOB downloads fine. When I looked at the report attributes details for the BLOB column, I noticed the BLOB Column Attributes had not been populated. I have tried repeatedly to populate them (Table Name, Column Name, Primary Key, MIMETYPE, etc.) but after applying the changes and reopening the attributes page for the blob column, the values I entered are not saved.
    For completeness, here is the select statement for the report:
    select "DESC_ATT_ID",
    "BR_ID",
    "FILENAME",
    "MIMETYPE",
    dbms_lob.getlength("DESC_ATTACHMENT") "DESC_ATTACHMENT"
    from "#OWNER#"."ALTEC_BR_DESC_ATT"
    WHERE BR_ID = :P3_BR_ID
    Also, here is the value for the Number/Date format for the BLOB Column:
    DOWNLOAD:ALTEC_BR_DESC_ATT:DESC_ATTACHMENT:DESC_ATT_ID
    Can someone please point me in the right direction to get the link for the interactive report working properly?
    Many thanks,
    Jerry

    Hello,
    How about you do not use BLOB format Column, you do it manually as this example here:
    apex.oracle.com
    workspace: somefeto
    user: test
    pwd: test
    Application 63066
    in the same workspace, there is      Sample File Upload and Download (App ID 10540), and it is working fine ....
    Otherwise, Pls, reproduce the problem on apex.oracle.com
    Best Regards,
    Fateh
    If you believe that my answer is correct or helpful to you, then pls, mark the answer as helpful or correct

  • How to open a file form a blob column?

    I'm storing some files in oracle 9.2 in a blob column, although i can't open them using php 4, I'm using this script :
    <?php
         $SQL="SELECT ID_ARCHIVO,CONTENT";
              $SQL=$SQL." FROM ARCHIVOS_PRUEBAS ";
              $SQL=$SQL." WHERE ID_ARCHIVO =".$v_ID_ARCHIVO ;
              $c=OCILogon("$v_USER" , "$v_PASS" ,"$v_CONEXION" );
              $s = OCIParse($c,$SQL );
              if (!OCIExecute($s)) { print "execution failed"; exit(); }
         OCIFetchInto($s,&$arr,OCI_RETURN_LOBS);
         echo $arr["CONTENT"]->load();
              ?>
    it shows this error
    Fatal error: Call to a member function on a non-object in ov_archivo_detail_test.php on [echo $arr["CONTENT"]->load(); ].
    I know the data is stored correctly since i used toad to save and open the blob file and it was ok, but i still can't find a right way to show the file from the web.
    Message was edited by:
    user560595

    Hi,
    <br>
    <br>
    Did you already try take a look on
    Oracle+PHP Cookbook: Working with LOBs in Oracle and PHP ?
    <br>
    <br>
    Cheers

  • BLOB column says undefined

    Hi .
    when i create a BLOB column in the table and describe the structure it says undefined. how do i fix that. also if someone can let me know how to update a RTF content from a VB to the BLOB column in the oracle table?? Tons of thanks in advance

    You can write a BLOB- VB to Oracle database using ADO function in VB. Search in MSDN for help on BLOB function. They have a ready eg.
    Just in case you don't find it.
    Here it is:
    Just copy paste this in a form with text boxes for all ODBC parameters.
    I think you cannot read directly from a BLOB column. Don't forget to initiate a BLOB column like:
    /*LOB table for storing files*/
    Drop table FileColumn;
    Create table FileColumn
    ( REPQUE_ID NUMBER(10) NOT NULL ,
    RepText_blob BLOB default empty_blob()
    Storage (initial 50K next 50K pctincrease 0)
    tablespace TEST31ORA
    lob(RepText_blob) store as
    (tablespace ACCOUNT4
    Storage (initial 100k next 100k pctincrease 0)
    chunk 16k pctversion 10 nocache logging);
    /*initialize LOB locator by making it not null, use empty lob, this will
    insert the locator value in that column
    I did this initialize in create table script, so that I can do the bulk insert
    One can do bulk inserts if there are no rows before
    insert into FileColumn
    values(1, empty_blob()); */
    Option Explicit
    Const BlockSize = 32768
    ' FUNCTION: ReadBLOB()
    ' PURPOSE:
    ' Reads a BLOB from a disk file and stores the contents in the
    ' specified table and field.
    ' PREREQUISITES:
    ' The specified table with the OLE object field to contain the
    ' binary data must be opened in Visual Basic code (Access Basic
    ' code in Microsoft Access 2.0 and earlier) and the correct record
    ' navigated to prior to calling the ReadBLOB() function.
    ' ARGUMENTS:
    ' Source - The path and filename of the binary information
    ' to be read and stored.
    ' T - The table object to store the data in.
    ' Field - The OLE object field in table T to store the data in.
    ' RETURN:
    ' The number of bytes read from the Source file.
    Function ReadBLOB(Source As String, T As Recordset, _
    sField As String)
    Dim NumBlocks As Integer, SourceFile As Integer, i As Integer
    Dim FileLength As Long, LeftOver As Long
    Dim FileData As String
    Dim RetVal As Variant
    On Error GoTo Err_ReadBLOB
    ' Open the source file.
    SourceFile = FreeFile
    Source = "c:\blob_file_folder\G63JR557.doc"
    T = mwebRepOutput
    sField = RepOut_Content
    Open Source For Binary Access Read As SourceFile
    ' Get the length of the file.
    FileLength = LOF(SourceFile)
    If FileLength = 0 Then
    ReadBLOB = 0
    Exit Function
    End If
    ' Calculate the number of blocks to read and leftover bytes.
    NumBlocks = FileLength \ BlockSize
    LeftOver = FileLength Mod BlockSize
    ' SysCmd is used to manipulate status bar meter.
    RetVal = SysCmd(acSysCmdInitMeter, "Reading BLOB", _
    FileLength \ 1000)
    ' Put first record in edit mode.
    T.MoveFirst
    T.Edit
    ' Read the leftover data, writing it to the table.
    FileData = String$(LeftOver, 32)
    Get SourceFile, , FileData
    T(sField).AppendChunk (FileData)
    RetVal = SysCmd(acSysCmdUpdateMeter, LeftOver / 1000)
    ' Read the remaining blocks of data, writing them to the table.
    FileData = String$(BlockSize, 32)
    For i = 1 To NumBlocks
    Get SourceFile, , FileData
    T(sField).AppendChunk (FileData)
    RetVal = SysCmd(acSysCmdUpdateMeter, BlockSize * i / 1000)
    Next i
    ' Update the record and terminate function.
    T.Update
    RetVal = SysCmd(acSysCmdRemoveMeter)
    Close SourceFile
    ReadBLOB = FileLength
    Exit Function
    Err_ReadBLOB:
    ReadBLOB = -Err
    Exit Function
    End Function
    null

  • Loading PDF and Video Files in BLOB Column

    Hi,
    Below is my database version
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    The Requirment is
    In a web page ( developed using Java Spring ) end user has the funtionality to upload a pdf/video file by browse the required file from his/her local computer.
    Once the webuser clicks the SAVE button then the selected file needs to be inserted in Oracle BLOB column.
    Front end needs to call an Oracle Package to achive this.
    Please suggest me how to create oracle code(Procedure) for this?
    Thanks in advance.
    Regards,
    Karthik.K

    Check BFILENAME + DBMS_LOB. Something like:
    DECLARE
        v_file BFILE;
        v_blob BLOB;
        v_size NUMBER;
    BEGIN
        v_file := BFILENAME(<ORACLE DIR OBJECT POINTING TO OS DIR WHERE FILE RESIDES>,<FILE NAME>);
        DBMS_LOB.OPEN (v_file, DBMS_LOB.lob_readonly); --Read the file
        DBMS_LOB.createtemporary(v_blob,TRUE);
        v_size := DBMS_LOB.getlength(v_file);
        DBMS_LOB.loadfromfile(v_blob,v_file,v_size);
    END;
    /SY.
    Edited by: Solomon Yakobson on Aug 24, 2011 10:01 AM

  • How to upload a file to a BLOB column in the DB using PL/SQL???

    Hi
    I am trying to upload a file to a BLOB column in my database. I wana do this using some pl/sql procedure.I don't wana use webutil. is it possible??? and if so can anybody help me with this???
    Regards
    Shiraz

    Hello,
    This is a stored procedure sample that show how insert into CLOB, BLOB and BFILE columns
    CREATE OR REPLACE PROCEDURE Insert_document
         PC$Type IN DOCUMENT.TYP%TYPE
        ,PC$Nom IN DOCUMENT.NOM_DOC%TYPE
        ,PC$Texte IN VARCHAR2
        ,PC$Image IN VARCHAR2 
        ,PC$Fichier IN VARCHAR2
       ) IS
      L$Blob BLOB;
      L$Clob CLOB;
      L$Bfile BFILE;
      LN$Len NUMBER := dbms_lob.lobmaxsize;
      LN$Num NUMBER ;
      LN$src_off PLS_INTEGER := 1 ;
      LN$dst_off PLS_INTEGER := 1 ;
      LN$Langctx NUMBER := dbms_lob.default_lang_ctx ;
      LN$Warn NUMBER;
      BEGIN
        -- Création of new raw --
        If PC$Fichier is not null Then
           L$Bfile := BFILENAME( 'FICHIERS_IN', PC$Fichier );
        End if ;
        -- Creation of temporary objetcs --
        dbms_lob.createtemporary( L$Clob, TRUE ) ;
        dbms_lob.createtemporary( L$Blob, TRUE ) ; 
        -- Loading text in CLOB column --
        If PC$Texte is not null Then
           L$Bfile := BFILENAME( 'FICHIERS_IN', PC$Texte );
           dbms_lob.fileopen(L$Bfile, dbms_lob.file_readonly);
           If dbms_lob.fileexists( L$Bfile ) = 1 Then
             dbms_output.put_line(PC$Texte || ' open' ) ;
             dbms_lob.loadclobfromfile(
                                       L$Clob,                -- Destination CLOB
                                       L$Bfile,               -- Source file pointer
                                       LN$Len,                -- # bytes to read
                                       LN$src_off,            -- Source start position
                                       LN$dst_off,            -- Target start position
                                       dbms_lob.default_csid, -- CSID
                                       LN$Langctx,            -- Language Context
                                       LN$Warn);              -- Warning message
             dbms_lob.fileclose(L$Bfile);
          Else
             raise_application_error( -20100, 'Erreur ouverture ' || PC$Texte ) ;
          End if ;
        End if ;
        -- Loading image in BLOB column --
        If PC$Image is not null Then
           L$Bfile := BFILENAME( 'FICHIERS_IN', PC$Image );
           dbms_lob.fileopen(L$Bfile, dbms_lob.file_readonly);
           dbms_lob.loadblobfromfile(
                                     L$Blob,       -- BLOB de destination
                                     L$Bfile,      -- Pointeur de fichier en entrée
                                     LN$Len,       -- Nombre d'octets à lire
                                     LN$src_off,   -- Position source de départ
                                     LN$dst_off);  -- Position destination de départ
           dbms_lob.fileclose(L$Bfile);
        End if ; 
        -- Save --
        Insert into DOCUMENT (ID, NOM_DOC, TYP, UTILISE, LOB_TEXTE, LOB_DATA, LOB_FICHIER)
               Values( SEQ_DOCUMENT.NEXTVAL, PC$Nom, PC$Type, NULL, L$Clob, L$Blob, L$Bfile ) ; 
        -- Free the temporary objects --
        dbms_lob.freetemporary( L$Clob ) ;
        dbms_lob.freetemporary( L$Blob ) ; 
      END;
    /The table structure for this sample is the following:
    CREATE TABLE DOCUMENT (
      ID           NUMBER (5) PRIMARY KEY,
      TYP          VARCHAR2 (20),
      UTILISE      VARCHAR2 (30),
      LOB_TEXTE    CLOB,
      LOB_DATA     BLOB,
      LOB_FICHIER  BFILE,
      NOM_DOC      VARCHAR2 (100))
    /Francois

  • How to display image using Carousel in ADF using BLOB column DB

    Hello everyone ,
    I tried creating a Carousel component in ADF do display an image , but it seems to be not working .
    This is what i tried .
    1 ) Created an empty page .
    2) From data control drag and drop view object ( one of the column in DB is blob which saves the image ) as Carousel .
    3 ) Drag and drop the image over Carousel component ,
    Now what should be the source for the image ?? from expression builderi tried giving #{item.Image} images are not picking up .
    Could you please advice .
    --Keerthi                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Keerthi,
    You cannot display a BLOB as image as it is. You need to convert them to display in your UI.
    Check out this blog on how to use a servlet to convert the blob into image and display in the page.
    http://tompeez.wordpress.com/2011/12/16/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-3/
    -Arun
    P.S : Always mention your JDev version and the technologies used.

  • How to view PDF files strored in a BLOB column

    Hi all,
    I want to display a PDF file, stored in a BLOB column, in a form or through a JavaBean.
    But the problem is more complicated then that. I do not want to retrieve the PDF file in the application server that show it through a browser.
    Actually, I do not want users to get the entire file, I just want them to see it or print it.
    I want, in fact, to display a "stream" of bytes through Oracle Forms. Not a file.
    This one, sounded to be a good solution, but actually not. When the file was too big (multiple pages), the application was blocked until the entire file was loaded. And when you try to print it, it wasn't printed right. The advantage of this solution is that it is open-source so we can add methods to connect to the DB, retrieve the content of the BLOB column and displays it without downloading the file.
    Here is a good solution. Really good, files are loaded quickly, the rendering is really good and the file is printed perfectly (as it was printed from Adobe Acrobat). The disadvantage of this solution is that it is not open-source and is really expansive.
    As you can see, both solutions uses PJC.
    So any help, any idea to solve my problem will be highly appreciated.
    Thanks to all of you,
    Amine
    PS : I am using F&R 11gR2

    Not entirely. At least we came to the conclusion it doesn't make (much) sense to block the save option of PDFs if you want to allow printing them
    Anyway; there is of course another possibilty: you could always write your own java bean PDF reader; there are plenty of java PDF libraries available:
    Open Source PDF Libraries in Java
    The easiest way would be to choose one which can open a PDF from a URL and render it; I would retrieve the image via mod_plsql using WPG_DOCLOAD and simply use the PDF library to render the PDF. No tempfiles anyway, and if you don't implement it there is also no save button.
    cheers

  • How to open a BLOB column stored in oracle using OLE wrappers

    Hello friends
    I have a strange problem, I have OLE objects like, *.doc, *.xls, *.bmp etc all these files have been embedded in oracle database using OLE2.0 & wrapping technology. Well I have to extract this data outof BLOB column from Oracle database & store it in OS file in its respective format
    For Eg. If the BloB data which has been embedded in Oracle database using OLE2.0 & wrapping is of *.doc file then the OS file which I have stored after extraction I should be able to open in MS word.
    Well in this task I am able to extract the file using GETCHUNK feature from VB , but I am not able to open the OS file in MS word as it is saying the error
    the document you are trying to open is not supported by MS Word
    So please any one of you can help me to solve this problem I wil be very helpful. also if you have suported code for ths problem It is welcome
    Not only using VB if you have code of any other langauges also itis welcomed
    Thanks
    Adhem

    Please "Preview" your future posts. Your formatting is awful. Especially learn to use the [ code ] tags.
    Are you sure DateTime.Now.ToString() returns a string in the format of 'MM/DD/YYYY HH:MI:SS.FF3'?
    Fix that and if you still having the problems, debug the actual result of your string.Format() and post that.

  • Error while opening PDF file downloaded  from database Blob column

    Hi All,
    I am working on jdev 11.1.1.4.0.
    In my use-case I am using filedownload Actionlistner on a link to get the PDF file stored in the database in blob field. These files are being uploaded from other use-case in adf only.
    After getting the dialog box to open/save/cancel for the PDF file when i click on open then i am getting an error *'Adobe Reader could not open 'abc.pdf' because it is either not a supported file type*
    or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly docoded)' for some files , and to my surprise I am able to open some files.
    When I open these PDF files separately from desktop I am able to view the content of each and every file in adobe reader.
    I dont know where the problem exactly lies , while uploading/downloading the file . Any ideas/thoughts to resolve this issue?
    Thanks
    Kanika

    Thanks a lot Timo...!!!
    I checked the PDF file downloaded directly from the blob column in DB, there only it is corrupted so must be the problem in uploading the file. I am checking the code line by line,, but no problem in setting the file content type,size etc.
    Here is the code snippet ..
    byte[] buff;
    buff = new byte[(int)length]; -- Length is the file size
    int bytesRead = is.read(buff);
    for (int i = 0; bytesRead < buff.length; i++) {
    // int b = is.read();
    int b = is.read();
    if (b == -1)
    break;
    buff[i] = (byte)b;
    BlobDomain blobDomian = new BlobDomain((buff));
    TestVORow = (TestVORow Impl)TestVO.createRow();
    if(blobDomian != null) {
    TestVORow.setAttachment(blobDomian);
    am.getTransaction().commit();
    This seems to be Ok to me..the same issue, file is still corrupting.
    Any thoughts from your side ???
    Thanks
    Kanika
    The problem is resolved.
    Changes made are instead of
    InputStream is;
    used ... BufferedInputStream bis ;
    and after
    for (int i = 0; bytesRead < buff.length; i++) {
    // int b = bis.read();
    int b = bis.read();
    if (b == -1)
    break;
    buff[i] = (byte)b;
    bis.close(); // use this close bufferedInput Stream.
    Able to open each and every file now..Thanks for your suggestions Timo and Frank.
    Edited by: Kanika on Mar 6, 2012 3:15 AM

  • How to display images from BLOB column via APEX 4.0

    Hello,
    I did the following in order to display images of two Oracle records on the APEX page. I am using APEX Version : 4.0.1.00.03 , Oracle DB Version : 10.2.0.4.0.
    1. Created An oracle table TEST_FORM
    with 3 columns
    ( ID number, MIME_TYPE varchar2(255) , Image BLOB )
    2. Inserted two records
    10001, image/gif, ( actual image1)
    10002, image/gif, ( actual image2)
    3. created an Oracle procedure
    CREATE OR REPLACE PROCEDURE show_my_form ( p_image_id IN test_form.id%type) AS
    l_mime test_form.mime_type%type;
    l_length NUMBER;
    l_file_name VARCHAR2 (2000);
    lob_loc test_form.IMAGE%type;
    BEGIN
    SELECT mime_type, IMAGE
    , DBMS_LOB.getlength (IMAGE)
    INTO l_mime, lob_loc, l_length
    FROM test_form
    WHERE id = p_image_id;
    owa_util.mime_header(l_mime, false);
    htp.p ('Content-length: ' || l_length);
    owa_util.http_header_close;
    wpg_docload.download_file (lob_loc);
    END show_my_form ;
    4. In Apex 4.0
    step1. Created an interactive report on a new APEX page
    step2. Specified the following in the Region Source
    select id, mime_type, '<img src="#OWNER#.show_my_form ?p_image_id=#ID#" />' photo
    from TEST_FORM
    The column result shows as <img src="CCS.show_my_form?p_image_id=#ID#" />
    I am unable to display the column image as a link to a proper image photo.
    Could you please advise me if I missed anything ?
    Thanks a lot.
    Regards
    Susanna
    Edited by: user10318332 on 13/12/2010 15:51
    Edited by: user10318332 on 13/12/2010 20:10

    Maybe the space you have before the ? is causing issues. there shouldn't be any space.
    Your procedure looks to be much the same of one that I have.
    Have you granted execute on your procedure?
    Also, what version DB are you running? This could be another issue: http://daust.blogspot.com/2006/04/xe-calling-stored-procedures.html
    But anyway, you don't need to create your own procedure these days. You could do the following:
    in your query, have a column: dbms_lob.getlength(blob) photo ; save, then in column attributes for that column, apply a format mask. There is usually a link below the text box for the format mask - BLOB Download Format Mask, which will help you build the format mask. But it is documented here: http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/advnc.htm#BCGGJHEF
    Ta,
    Trent

Maybe you are looking for

  • HT4623 My iPad will not allow me to download any apps

    My iPad will not let me download any apps, also in the APPS STORE it shows a '1' meaning that there is one new update, it will not even let me update.  Also when browsing some websites like BT, it shuts down and reverts back to the home page of all m

  • How do i sync my iphone 5 to my ipad2 for Messages?

    My 13 year old daughter has an iPhone 5, on which she uses Messages / texting. I have an iPad2. I have the latest iOS on my iPad, but she has 6.0.2 on her iPhone. When she gets a message on Messages, I want them to also come to my iPad, whether it is

  • New python

    I've uploaded a new Python package since the old one was broken (build with an older version of GCC) it can be found in the /incoming directory. Stuff like superkaramba compile with this version of python.

  • Field LFM1-SPERM not updating

    Hello Wonder if anyone can help me? If this is in the wrong part of the Forum can someone point me in the right direction? SRM version 5.5 & ECC 6.0 When putting a block on a Vendor for Purchasing Orgs in transaction XK05  it is not replicating in SR

  • Problem in Script Orientation

    Dear Freinds, I have a problem in converting script from portrait to landscape orientation. i tried a lot to find the solution before post this but nothing resolves my query. when i changed the orientation to landscape it throws an error that 'first