Array of blob

I have to do a bulk files insert in vb.net to a oracle db table. I've my bytes array and I would to pass that to a stored procedure.
So in my stored I've declared:
TYPE blobarray IS TABLE OF BLOB
INDEX BY BINARY_INTEGER;
PROCEDURE prc_set_files (
p_files blobarray,
p_out OUT INTEGER,
p_the_cur OUT cur
Then, in my vb.net function, I've mapped my bytes array as a parameter like this:
Dim filesArray(2)() As Byte
commandParameters(i).OracleDbType = OracleDbType.Blob
commandParameters(i).CollectionType = OracleCollectionType.PLSQLAssociativeArray
commandParameters(i).Value = filesArray
But doesn't work (no exception, only doesn't write). If I don't pass the vb array, it works.
Could anyone help me?
Thanks

Hi,
It is currently a limitation of the OCI layer that only scalar types can be used for associative arrays. As such, blobs, clobs, timestamps, intervals, and I suppose xmltypes, cannot be used.
I'm a little surprised you're not getting an error or exception. I'd rather expect an ora-600 to occur, based on the enhancement request that was filed for support to be added for non-scalar types.
cheers,
Greg

Similar Messages

  • Associative Array and Blob

    I’m currently working on a system that allows the users to upload an Excel spreadsheet (.xls) in the system. The upload page is a PL/SQL cartridge. Then I’ve written a Java servlet (using Oracle Clean Content) to convert the XLS into a CSV and store it back in the database. (it is stored in the “uploaded_files” table as a blob). I’m trying to create another procedure to read the contents of the blob and display a preview of the data on the screen (using an html table (will be done using cartridge)). After the preview, the user can choose to submit the data into the database into the “detail_records” table or simply discard everything.
    I've been trying to use an associative array to grab all the data from the blob but I’m getting confused about how to implement it in my situation.
    Can someone provide any examples of this nature?
    Any help is greatly appreciated.

    I decided to create a "record" type with all the columns from my excel spreadsheet. Then I will create a table type of records
    I am doing something like this:
    declare
    type s_record is record
                            (l_name varchar2(100),
                             f_code varchar2(4) ,
                             l_code varchar2(6),
                             d_date varchar2(5),
                             d_type varchar2(5),
                             price number,
                             volume number,
                             tax number,
                             amount_paid number
    type s_data_tab is table of s_record index by binary_integer;
    v_s_data s_data_tab;
    v_indx binary_integer :=0;
    begin
    end; I am getting confused about parsing an entire row of values separated by commas into a row in the temporary table created above.
    I know I need a loop, but from what I understand, the way to populate data needs to be something like this, for example:
    for v_indx in 0..data_size loop
       v_s_data(v_indx).l_name:= 'Company A';
       v_s_data(v_indx).f_code := '2700';
    end loop; But I'm not sure how this approach should be used to parse an entire row at once.
    Any help appreciated.

  • External Procedure Call: Temporary Blob Array out.

    Hello,
    I am having difficulty getting out an array of blob from the external procedure call interface. I am trying to create an array of blob initialized with temporary blobs. I was successfully able to create single blob parameter out but no success with the array type.
    I am including the code for PLSQL wrapper, test code, and the main C code.
    I appreciate your help.
    The error message of the test run:
    0
    10
    DECLARE
    ERROR at line 1:
    ORA-22275: invalid LOB locator specified
    ORA-06512: at "SYS.DBMS_LOB", line 554
    ORA-06512: at line 7
    CREATE OR REPLACE PROCEDURE blob_coll (
    cintarray IN OUT VDC_BLOB_ARRAY ) IS
    LANGUAGE C
    NAME "blob_coll"
    LIBRARY sjc_lib WITH CONTEXT
    PARAMETERS (
    context,
    cintarray OCIColl);
    DECLARE
    BLOBARRAY VDC_BLOB_ARRAY:= VDC_BLOB_ARRAY();
    BEGIN
    dbms_output.put_line( BLOBARRAY.count);
    SCOTT.BLOB_COLL ( BLOBARRAY );
    dbms_output.put_line( BLOBARRAY.count);
    dbms_output.put_line( dbms_lob.getlength( BLOBARRAY(1)));
    END;
    void blob_coll( OCIExtProcContext *ctx,
    OCIColl **cintarray )
    sword status;
    int i;
    OCILobLocator *lobp[10];
    status = OCIExtProcGetEnv( (OCIExtProcContext *)ctx, (OCIEnv **)&envhp,
    (OCISvcCtx **)&svchp, (OCIError **)&errhp );
    for (i=0; i < 10; i++)
    status=OCIDescriptorAlloc( (dvoid *)envhp, (dvoid **) &lobp,
    (ub4)OCI_DTYPE_LOB, (size_t)0, (dvoid**)0);
    status=OCILobCreateTemporary((dvoid *)svchp,
    (dvoid *)envhp,
    lobp[i], (ub2)0, SQLCS_IMPLICIT,
    OCI_TEMP_BLOB, OCI_ATTR_CACHE,
    OCI_DURATION_SESSION);
    status = OCICollAppend( (OCIEnv *)envhp,(OCIError *)errhp,
    (CONST dvoid*) lobp[i],
    (CONST dvoid*)0,
    (OCIColl *)*cintarray);

    The "X" in the second registerOutParameter is the type name which
    you have created in oracle DB.
    eg. if you have created a nested table
    create Type integer_table is table of number(10);
    then "X" = "INTEGER_TABLE" and it has to be in caps
    and other thing to keep in mind is that it only works with nested
    table or varray and not with pl/sql table.
    Al Pivonka (guest) wrote:
    : How can I pass pl/sql record in and out
    : and pl/sql tables in out thru a pl/sql procedure using jdbc
    with
    : the zip file of 816classes12.zip...
    : I have tried everything I know...
    : I know the procedure is working, others are using it with in
    : Oracle...
    : I need to use the information it generates.
    : here is what I have so far...
    : try
    : Class.forName ("oracle.jdbc.driver.OracleDriver");
    : DriverManager.registerDriver (new
    : oracle.jdbc.driver.OracleDriver());
    : oracle.jdbc.driver.OracleConnection conn =
    : (oracle.jdbc.driver.OracleConnection
    : DriverManager.getConnection
    ("jdbc:oracle:thin:@--","NA","NA");
    : // SQL92 SyntaxCallableStatement
    : oracle.jdbc.driver.OracleCallableStatement cstmt =
    : (oracle.jdbc.driver.OracleCallableStatement)conn.prepareCall
    : ("{call cbmd_proposal_PKG.DefaultTerms (?,?,?,?)}" ) ;
    : cstmt.setString(1,"5118");
    : cstmt.setString(2,"3");
    : cstmt.registerOutParameter
    : (2,oracle.jdbc.driver.OracleTypes.NUMBER);
    : cstmt.registerOutParameter
    (1,oracle.jdbc.driver.OracleTypes.ARRAY,"X");
    : cstmt.execute();
    : catch(Exception e)
    : System.err.println(e.toString());
    : e.printStackTrace();
    : The "X" in the second registerOutParameter is still unknown to
    : me.
    : The JavaDoc for the
    OracleCallableStatement.registerOutParameter
    : is not clear.
    : Can any One help simplify this...
    : Thanks
    null

  • The size limit of the OCI LOB Array Insert is 64K for one field?

    I have a table with 4 field, and one is BLOB field. I want to insert 16 rows in one OCIStmtExecute. I know I can specify the iter parameter with 16 to execute sql 16 times.
    I found example in "Application Developer's Guide - Large Objects" in page "Data Interface for Persistent LOBs 13-17", there is a example function called "array_insert". It shows the usage of OCIBindArrayOfStruct, but can only insert LOB with same size, the LOB field of each row filled with the same size data.
    But I have to insert LOB with different size, for example 8K for row 1, and 16K for row 2, 128K for row 3. Than I find the alenp parameter of OCIBindByName/OCIBindByPos. It is "pointer to array of actual lengths of array elements."(OCI document). So I think I find the solution for my problem. But the type of alenp parameter is ub2*, is it means I can only insert 64K data for each row in my array insert? It is too small, I hope I can array insert BLOB with 16M each row.
    Or there is any other solution for my problem? I look forward to it for a long time! thanks every one!

    It is called Data Interface to work with LOB datatypes by APIs designed for use with legacy datatypes. I can specify SQLT_BIN to bind memory binary data to BLOB column, and INSERT or UPDATE directly. It can be without LOB locator and save round-trip to the server. This is very fit my needs, because I have to insert very much BLOBs to server as soon as possible.
    I have make a test program, and multi-row with different size blob( less than 65536 bytes) can be insert at one time, without locators. Multi-row wiht same size blob( more than 64K) also can be insert at one time--the alenp parameter is not used. I only can not insert multi-row with different size blob( more than 64k) because the type of alenp is ub2*.
    thank you for your reply!

  • Bulk loading BLOBs using PL/SQL - is it possible?

    Hi -
    Does anyone have a good reference article or example of how I can bulk load BLOBs (videos, images, audio, office docs/pdf) into the database using PL/SQL?
    Every example I've ever seen in PL/SQL for loading BLOBs does a commit; after each file loaded ... which doesn't seem very scalable.
    Can we pass in an array of BLOBs from the application, into PL/SQL and loop through that array and then issue a commit after the loop terminates?
    Any advice or help is appreciated. Thanks
    LJ

    It is easy enough to modify the example to commit every N files. If you are loading large amounts of media, I think that you will find that the time to load the media is far greater than the time spent in SQL statements doing inserts or retrieves. Thus, I would not expect to see any significant benefit to changing the example to use PL/SQL collection types in order to do bulk row operations.
    If your goal is high performance bulk load of binary content then I would suggest that you look to use Sqlldr. A PL/SQL program loading from BFILEs is limited to loading files that are accessible from the database server file system. Sqlldr can do this but it can also load data from a remote client. Sqlldr has parameters to control batching of operations.
    See section 7.3 of the Oracle Multimedia DICOM Developer's Guide for the example Loading DICOM Content Using the SQL*Loader Utility. You will need to adapt this example to the other Multimedia objects (ORDImage, ORDAudio .. etc) but the basic concepts are the same.
    Once the binary content is loaded into the database, you will need a to write a program to loop over the new content and initialize the Multimedia objects (extract attributes). The example in 7.3 contains a sample program that does this for the ORDDicom object.

  • Parsing BLOB (CSV file with special characters) into table

    Hello everyone,
    In my application, user uploads a CSV file (it is stored as BLOB), which is later read and parsed into table. The parsing engine is shown bellow...
    The problem is, that it won't read national characters as Ö, Ü etc., they simply dissapear.
    Is there any CSV parser that supports national characters? Or, said in other words - is it possible to read BLOB by characters (where characters can be Ö, Ü etc.)?
    Regards,
    Adam
      |
      | helper function for csv parsing
      |
      +-----------------------------------------------*/
      FUNCTION hex_to_decimal(p_hex_str in varchar2) return number
      --this function is based on one by Connor McDonald
        --http://www.jlcomp.demon.co.uk/faq/base_convert.html
       is
        v_dec number;
        v_hex varchar2(16) := '0123456789ABCDEF';
      begin
        v_dec := 0;
        for indx in 1 .. length(p_hex_str) loop
          v_dec := v_dec * 16 + instr(v_hex, upper(substr(p_hex_str, indx, 1))) - 1;
        end loop;
        return v_dec;
      end hex_to_decimal;
      |
      | csv parsing
      |
      +-----------------------------------------------*/
      FUNCTION parse_csv_to_imp_table(in_import_id in number) RETURN boolean IS
        PRAGMA autonomous_transaction;
        v_blob_data   BLOB;
        n_blob_len    NUMBER;
        v_entity_name VARCHAR2(100);
        n_skip_rows   INTEGER;
        n_columns     INTEGER;
        n_col         INTEGER := 0;
        n_position    NUMBER;
        v_raw_chunk   RAW(10000);
        v_char        CHAR(1);
        c_chunk_len   number := 1;
        v_line        VARCHAR2(32767) := NULL;
        n_rows        number := 0;
        n_temp        number;
      BEGIN
        -- shortened
        n_blob_len := dbms_lob.getlength(v_blob_data);
        n_position := 1;
        -- Read and convert binary to char
        WHILE (n_position <= n_blob_len) LOOP
          v_raw_chunk := dbms_lob.substr(v_blob_data, c_chunk_len, n_position);
          v_char      := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
          n_temp      := ascii(v_char);
          n_position  := n_position + c_chunk_len;
          -- When a whole line is retrieved
          IF v_char = CHR(10) THEN
            n_rows := n_rows + 1;
            if n_rows > n_skip_rows then
              -- Shortened
              -- Perform some action with the line (store into table etc.)
            end if;
            -- Clear out
            v_line := NULL;
            n_col := 0;
          ELSIF v_char != chr(10) and v_char != chr(13) THEN
            v_line := v_line || v_char;
            if v_char = ';' then
              n_col := n_col+1;
            end if;
          END IF;
        END LOOP;
        COMMIT;
        return true;
      EXCEPTION
         -- some exception handling
      END;

    Uploading CSV files into LOB columns and then reading them in PL/SQL: [It&#146;s|http://forums.oracle.com/forums/thread.jspa?messageID=3454184&#3454184] Re: Reading a Blob (CSV file) and displaying the contents Re: Associative Array and Blob Number of rows in a clob doncha know.
    Anyway, it woudl help if you gave us some basic information: database version and NLS settings would seem particularly relevant here.
    Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • Oci post varray of blobs  to the database - any ideas?

    This seems wierd to me and i can't help thinking I'm missing something obvious.
    I can create a varray of blob on the db - called say "varrblob"; I can create an array of blob(string) in PHP; I can get multiple blobs from the db in one go via a cursor
    ....BUT I can't find a way to save multiple blobs to the db in one group ie. like a varray of blob.
    - I have tried creating a write using an oci collection with "Oracle named type" - "varrblob" in my case but it errors with type 113 (blob) not possible when executing mycollection->append.
    - I have trolled the web and found nothing better than a single blob write (which i can already do no problem)
    Are there any gurus out there with any ideas?
    thanks!

    It is a limitation

  • How to store a  blob with toplink

    Hi .. I am using toplink 10g (10.1.3.0) and oracle9 and I am trying to insert a blob with toplink in the database but I dont know how I need to use a resultset and a PreparedStatement if it is the case hor how use toplink???

    You should be able to read the file in and convert its data to a byte-array in your object. TopLink will handle the conversion from byte-array to BLOB in the database.
    If you are using the Oracle thin JDBC drivers, they have a 5k size limit, if your file is larger than this you will need to use the Oracle8/9Platform in your login and a TypeConversionMapping and set the fieldClassification to java.sql.Blob.

  • Serializing objects with arrays - JDBC

    Hello,
    Are there any known issues with serializing arrays into Blobs with JDBC?
    I have an object with a complex array. It’s basically name/value pairs, but the values
    can be arrays as well. The type of the values array can be of different types, i.e. string, Boolean, int, etc. These arrays are a unioned, and a discriminator identifies what type of array I have.
    Array (name, value.discriminator, value) where the value is also an array of some type.
    An example of some data would be.
    Name = ‘Employee Name’ values = { ‘Fred’} discriminator = StringType
    Name = ‘address’ values = { ‘addr1’, ‘addr2’, ‘addr3’} discriminator = StringType
    Name = ‘Insured’ values = {true} discriminator = booleanType
    Name = ‘Some_Int_values’ values = {1,2,3,4} discriminator = IntegerType
    Name = ‘SomeOther_Int_values’ values = {1,2,3,4} discriminator = IntegerType
    It does not need to be that complex… it might just be
    Name = ‘Employee Name’ values = { ‘Fred’} discriminator = StringType
    The issues I’m having is before I serialize the object and write it into a blob, I can repeat through the length of the outer array and print the value arrays. After I read the object for the blob, I cannot do this. It seems to have a problem identifying the discriminator type.
    Thanks!

    421780,
    Sounds like a good candidate for XML. Have you considered that? Have you seen Oracle's XML Technology Center?
    Good Luck,
    Avi.

  • BLOB management

    Hello,
    I have to manipulate blob field from my vb application. I have to use a oracle client 7.3. When I connect to the DB with MS OLE DB provider for Oracle, an error occurs when I try to retrieve the blob field (datatype unsupported). So I see that the Oracle OLE DB provider supports blob field in ADO recordset. But Oracle OLEDB provider is only available from client 8i.
    Is it possible to install Oracle OLEDB provider on a client 7.3 ?
    Do you know another way to retrieve blob field from a vb application and using oracle client 7.3 ?
    Thanks.

    Database is 11gR2.
    Inserting data from Java Program through prepared statement.
    Sample code of Java program :
    orclRawTrapsInsertStmt.setLong(1, rts.id);
                                  orclRawTrapsInsertStmt.setString(2, rts.source_ip);
                                  orclRawTrapsInsertStmt.setString(3, rts.oid);
                                  orclRawTrapsInsertStmt.setString(4, rts.varbinds);
                                  orclRawTrapsInsertStmt.setBytes(5, rts.trapObject); ------------ This is the line setting Java Object (as byte array) as Blob column value
                                  orclRawTrapsInsertStmt.setString(6, rts.receivedTime);
                                  orclRawTrapsInsertStmt.setInt(7, rts.trapVersion);
    orclRawTrapsInsertStmt.executeUpdate();

  • Howto insert blob using pear mdb2

    Hi,
    we need a php code snippet showing how to insert in a blob column using pear::mdb2. I know who to make it using oci8 (there is an example in the faq), but we only use mdb2 to access the database.
    thanks in advance

    //...some code here to instantiate MDB2 class...
    $buf = file_get_contents('/path/to/blobfile');
    $fieldsValues = array(
    'MYFIELD1'=>$someVar,//integer
    'BLOB_DATA'=>$buf,
    $table_name = 'mytable';
    $types = array('integer', 'blob');
    $db->loadModule('Extended');
    $sth = $db->extended->autoExecute($table_name, $fieldsValues, MDB2_AUTOQUERY_INSERT, null, $types);
    if (PEAR::isError($sth)) {
    die($sth->getMessage());
    Note that you CANNOT insert a blob when using the 'prepare' method with placeholders. That seemed to be the problem.

  • Using longblob in hibernate

    I'm new to the hibernate world and i am using it to map a table that stores files of all types. i am however recieving a very strange error :
    javax.servlet.ServletException: java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
    I have mapped my MySql LONGBLOB column has: `<property name="fileData" type="blob" .../>` and `<property name="fileData" type="longblog" .../>` but both dont work.
    I'm currently using spring mvc version 3.x the latest version and tomcant 7 if that helps.
    edit: here is how my POJO looks like for fileObject:
    [CODE]package com.kc.models;
    public class FileObject {
         private String fileName;
         private String type;
         private double size;
         private byte[] file;
         private int id;
         public int getId() {
              return id;
         public void setId(int id) {
              this.id = id;
         public String getFileName() {
              return fileName;
         public void setFileName(String fileName) {
              this.fileName = fileName;
         public String getType() {
              return type;
         public void setType(String type) {
              this.type = type;
         public double getSize() {
              return size;
         public void setSize(double size) {
              this.size = size;
         public byte[] getFile() {
              return file;
         public void setFile(byte[] file) {
              this.file = file;
    And here is how my hbm.xml file looks like:
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
            "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
            "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping package="com.kc.models.FileObject" >
         <class name="com.kc.models.FileObject" table="FILES">
              <id name="id" column="ID">
                   <generator class="native" />
              </id>
              <property name="fileName" type="string" column="FILENAME" />
              <property name="type" type="string" column="TYPE" />
              <property name="size" type="double" column="SIZE" />
              <property name="file" type="blob" column="FILE" />
         </class>
    </hibernate-mapping>O and here is a print screen of mySql:

    shienna17 wrote:
    javax.servlet.ServletException: java.lang.ClassCastException: [B cannot be cast to java.sql.Blob
    That means you're trying to cast a byte array to Blob.                                                                                                                                                                                                                                                                                                                                                                                                   

  • Retrieve Image from SQL Server and Store in Oracle

    Hi All
    I want to retrieve the image stored in sql server as a image type and store that image to oracle as a BLOB type.
    I tried to retrive the image from sqlserver using getBytes and when storing to Oracle i have to type cast the byte array to BLOB then only it will be inserted please tell how to typecast byte array to BLOB.
    Or is there alternative way how to retrieve the image stored in sql server as a image type and store that image to oracle as a BLOB type.
    Regards
    Majid

    Hi Rajaram
    Thanks for UR Reply
    I tried what you have suggested but i am getting following exception
    java.lang.NullPointerException
    CDVLogger--getInstance--entered in ----getInstance----- null
    CDVLogger--getInstance--entered in ----logPrinter----- null
    CDVLogger--getInstance--entered in ----logger----- com.uttra.cdv.base.util.CDVLogger@b0ce8f
    at javax.sql.rowset.serial.SerialBlob.<init>(SerialBlob.java:82)
    at com.uttra.cdv.bulkimport.oracletca.image.FamilyMemberPhoto.createFamilyMemberPhotoRec(FamilyMemberPhoto.java:95)
    at com.uttra.cdv.bulkimport.oracletca.image.FamilyMemberPhoto.LoadFamilyMemberPhoto(FamilyMemberPhoto.java:55)
    at com.uttra.cdv.bulkimport.oracletca.image.FamilyMemberPhoto.main(FamilyMemberPhoto.java:136)
    Please Suggest

  • Problem with applyusagerights

    Hi,
    I recently downloaded the new eval JBOSS server from the adobe web site and I'm trying to assign reader extension rights to a pdf file via a web service call, as demonstrated in the following example:
    http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/wwhelp/wwhimpl/js/html/w whelp.htm?&accessible=true
    My crendential alias is called "test", and it's pointing to the .pfx file I got with the download. I was able to successfully create it using the administration console.
    In my .net code, I am using the following code, like in the example:
    Dim objOutputBlob As New BLOB
    objOutputBlob = objReaderExClient.applyUsageRights(objInputBlob, "test", "the_password_I_received", objReaderExtensionsOptionSpec)
    This function is supposed to return a byte() representing the output pdf file, but for some reason it is always returning a null array.
    Here's my entire code. Any help would be appreciated.
    Thanks.
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim objBinaryWriter As BinaryWriter
    Dim objFileStream2 As FileStream
    Try
    Dim sInputFileName As String = "C:\test.pdf"
    Dim sOutputFileName As String = "C:\test1.pdf"
    'Create a ReaderExtensionsServiceService client object
    Dim objReaderExClient As New ReaderExtensionsServiceService()
    objReaderExClient.Credentials = New System.Net.NetworkCredential("administrator", "password")
    'Create a BLOB to store the PDF document to which usage rights are applied
    Dim objInputBlob As New BLOB()
    'Get the length of the file stream
    Dim objFileInfo As New FileInfo(sInputFileName)
    Dim lNumBytes As Long = objFileInfo.Length
    'Specify the PDF document, open a file stream, read into a binary reader, and place into a
    'byte array. then, assign value of the byte array to a blob.
    Dim objFileStream As New FileStream(sInputFileName, FileMode.Open, FileAccess.Read)
    Dim objBinaryReader As New BinaryReader(objFileStream)
    Dim objByteArray As Byte() = objBinaryReader.ReadBytes(CInt(lNumBytes))
    objBinaryReader.Close()
    objInputBlob.binaryData = objByteArray
    '***I DID AN OUTPUT OF THE UBOUND(objByteArray) here, and it IS correct
    'Create a UsageRight object and specify usage rights
    Dim objUseRights As New UsageRights()
    objUseRights.enabledComments = True
    objUseRights.enabledFormFillIn = True
    objUseRights.enabledDigitalSignatures = True
    'Create a ReaderExtensionsOptions object
    Dim objReaderExtensionsOptionSpec As New ReaderExtensionsOptionSpec()
    objReaderExtensionsOptionSpec.usageRights = objUseRights
    objReaderExtensionsOptionSpec.message = "This is a Rights-Enabled PDF Document"
    'Apply usage rights to a PDF document
    Dim objOutputBlob As New BLOB
    objOutputBlob = objReaderExClient.applyUsageRights(objInputBlob, "cyril_test", "I6ta8e==VI", objReaderExtensionsOptionSpec)
    'Populate a byte array with BLOB data
    Dim objOutputByteArray As Byte()
    objOutputByteArray = objOutputBlob.binaryData
    '***WHEN I CHECK THIS objOutputByteArray, IT IS NULL ***
    'Create the new file .pdf file
    objFileStream2 = New FileStream(sOutputFileName, FileMode.OpenOrCreate)
    'Create a BinaryWriter object
    objBinaryWriter = New BinaryWriter(objFileStream2)
    objBinaryWriter.Write(objOutputByteArray) '***NULL REFERENCE
    objBinaryWriter.Close()
    objFileStream2.Close()
    Catch Ex As Exception
    Log.writeLog("Error: " & Ex.ToString())
    End Try
    End Sub

    Hi,
    I'm having the same problem.  When I try to apply usage rights, the byte array that's supposed to contain the unlocked PDF comes back null.  Was this problem ever solved.  Thanks in advance for your help.

  • How to write bytearray  in sqlite

    I do not see where mentioned this problem.

    Hi,
    you've 3115 unrecognized token error - which could be for example that statement do not contains required/expected value - or contains value that is not recognized (unexpected) I think. Have you tried parameters?
    var sql:String = "INSERT INTO thumbnail (fileName, filePath, fileData) VALUES (@name, @path, @data)";
    ssm.text = sql;
    ssm.parameters["@name"] = name;
    ssm.parameters["@path"] = path;
    ssm.parameters["@data"] = data;
    or:
    var sql:String = "INSERT INTO thumbnail (fileName, filePath, fileData) VALUES (:name, :path, :data)";
    ssm.text = sql;
    ssm.parameters[":name"] = name;
    ssm.parameters[":path"] = path;
    ssm.parameters[":data"] = data;
    or:
    var sql:String = "INSERT INTO thumbnail (fileName, filePath, fileData) VALUES (?, ?, ?)";
    ssm.text = sql;
    ssm.parameters[0] = name;
    ssm.parameters[1] = path;
    ssm.parameters[2] = data;
    Your "data" needs to be ByteArray (as it is raw byte blob). You need parameters because (as in linked doc) when parametrized value is used it is directly:
    Values supplied as parameters using the SQLStatement.parameters associative array are assigned the storage class that most closely matches the native data type bound. For example  [...] ByteArray objects are given the BLOB storage class.
    When using object to be written as BLOB in SQL string literal (as in your sample) the previous paragraph in Adobe's docs says it is expected to provide data in special hexadecimal notation and I haven't yet seen someone using bytearray with that way of data conversion during sql injection  - but I've seen people using parametrized values to insert byte array into blob already.
    regards,
    Peter

Maybe you are looking for

  • Can i use a macbook pro to drive an iMac as a monitor?

    can i use a macbook pro to drive an iMac as a monitor?

  • Can't add artwork to iTunes...

    I have been adding art work gradually to my iTunes for the songs I ripped from my CDs. I was doing just fine by highlighting the entire album, right clicking, hitting "Get Info", and just adding the art work. But just recently it has decided that eno

  • The Mac App Store Discussion, what is it for?

    Disclaimer: Apple does not necessarily endorse any suggestions, solutions, or third-party software products that may be mentioned in the topic below. Apple encourages you to first seek a solution at Apple Support. The following links are provided as

  • Drop Down - maintaining Order of the List Problem

    Hi, I have a Drop Down where the Code is   <h:selectOneMenu styleClass="alignRight" id="myDropDown"                        value="#{myBean.yCode}"                        onchange="submitPageX();"                        title="select any one in this m

  • Problem with retrieve - wrong outline structure?

    Hi all, I use essbase 11.1.2. I have a Cube with a dimension "Employee" (10000 member) and a dimension "CostCenter" (1700 member). They all have a measure value of 1. When i make a drill down on Employee i get a list of 10 k entries. When i do an add