Update Blob type field

I don't understand why.... I can't seems to update blob field type. Is there a special type of update for blob type? I will get the value from the form, typecast it to string then update the db. All fields can be updated except the blob type field....

It depends. Eg. Oracle requires to call its own factory classes. You cannot use standard JDBC.
The same with DB2.

Similar Messages

  • Updating action type field in infotype 0000.

    Hi experts,
    I have to update the action type(MASSN)field and reason for action(MASSG)field in infotype 0000 for the existing record. I am trying to use function module HR_INFOTYPE_OPERATION to update it,but i am not able to update the action type field.Below is the code.Can anybody please give me a solution for this.
    DATA:ls_p0000 type p0000.
    DATA : RETURN like BAPIRETURN1.
    DATA : KEY like BAPIPAKEY.
    DATA : RETURNE like BAPIRETURN1 .
    DATA :NOCOMMIT like BAPI_STAND-NO_COMMIT.
    PARAMETERS:is_pernr type pernr.
    ls_P0000-SUBTY = 'IG'.
    ls_P0000-PERNR = IS_pernr.
    ls_P0000-BEGDA = '20100101'.
    ls_P0000-ENDDA = '99991231'.
    ls_P0000-MASSN = 'IG'.        "action type
    ls_P0000-MASSG = '01'  .      "reason for action
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
    NUMBER = IS_PERNR
    IMPORTING
    RETURN = RETURNE.
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
    INFTY = '0000'
    NUMBER = ls_P0000-PERNR
    SUBTYPE =   ls_P0000-SUBTY
    OBJECTID = ls_P0000-OBJPS
    LOCKINDICATOR = ls_P0000-SPRPS
    VALIDITYEND = ls_P0000-ENDDA
    VALIDITYBEGIN = ls_P0000-BEGDA
    RECORDNUMBER = ls_P0000-SEQNR
    RECORD = ls_P0000
    OPERATION = 'INS'
    TCLAS = 'A'
    DIALOG_MODE = '0'
    NOCOMMIT = NOCOMMIT
    IMPORTING
    RETURN = RETURN
    KEY = KEY.
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
    EXPORTING
    NUMBER = IS_PERNR
    Thanks in advance.

    operation "INS" is for insertion,check the FM documentation for value to be passed to operation parameter for change.
    I think its "MOD"
    Edited by: abapuser on Sep 15, 2010 2:02 PM

  • UPDATE BLOB type with J2SE (JDBC ORACLE outbound adapter)

    Hi all,
    I'm trying update row into Oracle table with column type BLOB via XI 3.0, but it doesn't work.
    Does anyone send me some sample of correct XML file, with update column type BLOB ?
    Thanks
    My test XML document :
    ?xml version="1.0" encoding="UTF-8"?>
    <root>
    <StatementName1>
    <SAPXI_OUTPUT action="UPDATE">
    <access>
                <DGPODPIS >sdcfo2JTiXE=</DGPODPIS>
    </access>
    <key1>
                <SAPO_ID>1001</SAPO_ID>
    </key1>
    </SAPXI_OUTPUT>
    </StatementName1>
    </root>

    Hi !
    I have make some test's today. I copy the adapter from our productive system P15 SP3 to the developers D15 SP6. Then we take the same message and send this from sap p42 to sap xi d15 sp5 to the adapter d15 (copy from p15 sp3) to the same Oracle database and it's working.
    SAP P42 - Orders - XI D15 SP6 - Orders - Adapter D15 (copy from P15SP3) = it's working Record > ca. 800
    I think we have a problem in the patch sp5.
    We found also some different size in the adapter files.
    This are the jar- files with different size:
    SAPAdapterService.exe
    adapter.properties
    aii_msg_adapter.jar
    aii_msg_runtime.jar
    aii_rfcadapter.jar
    aii_util_grmg.jar
    aii_util_misc.jar
    aii_util_rb.jar
    inqmyxml.jar
    lcrclient.jar
    logging.jar
    I make tomorow, a test with a adapter sp4.
    Regards Thomas Neuhaus

  • Updating blob files

    can somebody help me, can mysql update blob data fields? or is there another way to change data i blob columns/...

    Hi,
    I've done this before in Oracle so not sure about mysql.
    In Oracle, we have to insert a row into the database with an empty BLOB using the empty_blob() function within Oracle.
    Then its a matter of calling a select on the row for UPDATE and streaming the BLOB into the database.
    eg.
    String sql = "INSERT into TABLE values (a,empty_blob());
    ... execute sql
    then select on the table like this
    String sql = "Select BLOB from TABLE where id = a for UPDATE; (Where BLOB is your Blob column name)
    execute sql and the BLOB value returned can be used
    BLOB blob = (BLOB)rs.getBlob(1);
    I had to cast from the java.sql.Blob type to the oracle.sql.BLOB type then get an output stream and stream your data in. I used a byte[] to do this.
    I'm not sure how you would go about this in mysql but maybe I've pointed you in the right direction.
    hope this helps

  • Error while migrating BLOB type data

    Hi ,
    I am migrating the data from oracle to oracle and both soruce and target tables have BLOB type field.
    I am getting error when I am executing the interface with these blob fields. But My interface is successfull if I am not maaping this blob files.
    Below is the error message.
    ODI-1217: Session BLOB (162501) fails with return code 942.
    ODI-1226: Step BLOB fails after 1 attempt(s).
    ODI-1240: Flow BLOB fails while performing a Loading operation. This flow loads target table IMAGES.
    ODI-1228: Task SrcSet0 (Loading) fails on the target ORACLE connection YAGLD.
    Caused By: java.sql.BatchUpdateException: ORA-00942: table or view does not exist
    Thanks,
    Patel.

    Duplicate of
    Error while migrating BLOB type data

  • How to Update Date data type field value in oracle

    I want to update records in a table that has a Date data type field. It's a oracle databse. I use the oracle thin drive to connect to the database. The everything works well, only when i try to update records that have date type value, something doesn't work.
    I use the following stmt to update DB:
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Conn = DriverManager.getConnection("jdbc:oracle:thin:@hostname:portnumber:schname", "uid","pwd");
    stmt=Conn.createStatement();
    String updStr = "UPDATE Article SET Archive = ' Disable' WHERE ArticleDate = # " + sqlDate +"# " ;
    stmt.executeUpdate( updAStr ) ;
    But I always got the SQLException run time error, which is "ORA-00911: invalid character"
    Who can help me to find out how to write the above Update statement correctly? esp. that how to present the Date type variable in the statement.!
    BTW, sqlDate is a Java.sql.Date variable, Is it "# " + sqlDate + "# " the right way?
    Many thanks

    What do you get out of Oracle's TO_DATE that java.sql.PreparedStatement.setDate()
    won't give you? - MODWell, I don't know that I've used all capabilities of either, but when it comes to managing Date Strings my Oracle bias :) would be to code using Oracle's TO_CHAR and TO_DATE functions. Perhaps someone can tell me vendor neutral ways to do something simiilar to managing these input date/times (and hopefully just as easily, pretty much all done in a single line, single function)?
    WHERE aDATE > TO_DATE('2010','YYYY')
    WHERE aDATE > TO_DATE('2010 AUG 22','YYYY MMM DD')
    WHERE aDATE > TO_DATE( 'January 15, 1989, 11:00 A.M.', 'Month dd, YYYY, HH:MI A.M.')
    I believe most databases have something similar to this, although I have found Oracle's to be the most flexible and consistent, if not the most intuitive. Other vendors (DB2, SQL Server, Access) don't force you to always be explicit, and can accept a variety of date strings without masks. The problem is that while you might not be getting an error, it also may not be parsing your date as expected.
    One could argue that this vendor specific hodgepodge of literal date/time strings is only one program modification away from disaster. They might be right.
    Just to be clear. I'm not recommending using a vendor specific approach, but it's not a perfect world and somtimes you have to use what works easiest or best or fastest, and in some cases, that is the vendor specific alternatives.

  • Image Field and Blob Type

    Hi!
    I´m working on form that will works lika a image database.
    In my table I store the imagens in a blob type column.
    In my form, I use a Image Field to display the imagem from database.
    It works.
    Now I want to generate a md5 hash for the image file, so I createa function that receive a blob variable
    and calculates the md5 hash.
    That works too.
    The problem is that I want to get the hash at runtime, right after the file is chosen.
    So I did this:
    wfilename := WEBUTIL_FILE.FILE_OPEN_DIALOG (wdirname, NULL, file_types_variable);
    wmd5    := my_functions_package.md5(my_file => :data_block.image_field);
    When I try to compile, I get the error: Bad bind variable 'data_block.image_field'
    I guess the forms doesn´t see the image_field as a blob even if it is.
    Some one know how can I work arround this? To get the image_field as blob (It already is at database).
    Forms [32 Bit] Version 9.0.4.0.19 (Production)
    Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
    Thanks.

    hi
    try something like this.
    declare
          f varchar2(100);
    begin
         f := webutil_file.file_open_dialog();
         if f is not null then
              :block.item := f;
              end if;
         end;or try the following code.
    declare
    l_file_name varchar2(383);
    begin
    l_file_name := webutil_file.file_open_dialog( );
    if
      l_file_name is not null
    then
      if
        :block.rowid is not null
      then
        create_record;
      end if;
      client_image.read_image_file ( l_file_name, substr ( l_file_name, instr ( l_file_name , -1 ) ), 'block.item' );
    end if;
    end;sarah
    Edited by: QGIRCO on Jan 20, 2010 8:51 AM

  • Weird Problem with BLOB CMP field

    Hi,
    I am trying to deploy an EJB2.0 CMP Bean in Weblogic6.1 .The Bean has one of the CMP Field as a serializable object mapped to a BLOB Datatype in Oracle8i
    When i try to creae this Entity Bean
    I get "java.io.IOException: ORA-22920: row containing the LOB value is not locked" as a nested exception.
    When i increased the isolation level . I got "java.io.IOException: ORA-01002 fetch out of sequence" as the nested exception
    And one more horrible thing that is happening is the other arguments to the create method are getting updated in the DB except the Blob field(Supposed to rollback? when there is an EJB Exception ??)
    Any thoughts? Comments?
    Regards
    Sathya

    Hi,
    I seem to recall that there are multiple issues with BLOBS & WLS. I'll describe my setup, and you can see if your missing anything:
    - In weblogic-cmp-rdbms-jar.xml you need to set the column type as a Blob:
    <field-map>
    <cmp-field>binary</cmp-field>
    <dbms-column>binary</dbms-column>
    <dbms-column-type>OracleBlob</dbms-column-type>
    </field-map>
    - In weblogic-ejb-jar.xml you may need to set the isolation level of your set method:
    <transaction-isolation>
    <isolation-level>TRANSACTION_READ_COMMITTED_FOR_UPDATE</isolation-level>
    <method>
         <ejb-name>TerminalSoftwareKernelBDO</ejb-name>
         <method-name>setBinary</method-name>
    </method>
    </transaction-isolation>
    - The bean get/set methods should look like this:
    public abstract void setBinary(java.lang.Object binary);
    public abstract java.lang.Object getBinary();
    - In WLS 6.1 up to Service Pack 2 (I don't know about SP3 yet), BLOBs are incorrectly implemented. For some (odd) reason you can only put serialized objects into the DB... I think this means that if you have a BLOB put in by anything but WLS, WLS get very unhappy. So empty out your table with the blobs first.
    Hope that helps.
    Daniel.

  • How to update a single field in Word macro

    Hello,
    I am trying to create an AutoOpen() macro that will update the file name and path when user opens in a Word document, but I can't seem to find anything explaining how to update a single field, specifically the {FILENAME \p} field.  There
    are other fields in the document, so I do not want to update all the fields.  Most of the links I found only explain how to update ALL fields. Can somebody please tell me how I can update only the filename and path field using an autoopen macro?
    Thank you

    Stefan's response is correct.
    Here is a macro that should update only filename fields.
    Sub FileNameFieldUpdateAllStory()
    ' Written by Charles Kyle Kenyon 15 November 2001 - modified for filename 10 Sept 2014
    ' repaired by Jezebel
    ' All Story Field Updater - Filename fields
    Dim oField As Field
    Dim oStory As Range
    ' On Error Resume Next
    For Each oStory In ActiveDocument.StoryRanges
    ' This goes into headers and footers as well as the regular document
    Do
    For Each oField In oStory.Fields
    If oField.Type = wdFieldFileName Then
    oField.Update
    End If
    Next oField
    Set oStory = oStory.NextStoryRange
    Loop Until oStory Is Nothing
    Next oStory
    End Sub
    See Installing Macros for help in using this.
    Charles Kenyon Madison, WI

  • Updation of Custom Fields in AFRU table Using Customerexit

    Hi all,
    I added two fields in CO11n Tcode using SCREEN EXIT - CONFPP07 and iam trying to update these two fields in AFRU table
    using CONFPP05.  But iam unable to update these two field .
    see this code in CONFPP05
      LOOP AT afrud_tab.
        afrud_tab-zzshift = wa_afrud-zzshift1 .
        afrud_tab-zzoperator = wa_afrud-zzoperator1 .
        MODIFY afrud_tab.
      ENDLOOP.
    Plz help me regarding this..

    Thanks for reply
    Ya i added two fields in confpp07 .
    see the code :
    *&  Include           ZXCOFTOP
    tables : afrud.
    DATA : WA_AFRUD TYPE AFRUD,
            IT_AFRUD TYPE TABLE OF AFRUD.
    Include           ZXCOFU24
    MOVE afrud-zzshift1 TO wa_afrud-zzshift1.
    MOVE afrud-zzoperator1 TO wa_afrud-zzoperator1.
    Even though it is not updating . except these two fields.
    Regards,
    Srinivas

  • How do store a time type field in a database table?

    We added a UDF of time type.  SQL Server says its a small integer.  After I pull the time off a date, I convert it to an integer.  For example, I convert 6:00 AM to 600.  When I try to store 600 in the field, I get a type mismatch exception.  What am I doing wrong?

    Adele,
    Thanks a bunch!
    Your code was syntactically incorrect but it moved me in the right direction.  Here is the code I ended up with:
    DateString = DateIn.ToString("yyyyMMdd HHmm")
    Time = Date.ParseExact(DateString, "yyyyMMdd HHmm", system.Globalization.DateTimeFormatInfo.InvariantInfo)
    Then update the Time field with the Time variable.
    This does the trick.  It looks like it is only necessary to save a date data type in a time type field and only the time piece of it is saved.
    Thanks again,
    Mike

  • Wrong updation of value fields

    hello,
    In a sales return invoice, the cost is getting updated in value field cost of free goods rather than value field cost .
    Please guide me in this .
    Thanks

    Hi Muscan
    What is the condition type in SD Pricing procedure for Cost during sale return? (Check your Sales Order - Pricing tab)
    See assignment of that cond type to val field in KE4I
    Regards
    Ajay M

  • Modifying/Updating User Defined Field in a Scheduled Task

    I've written a notification task to send an e-mail to a manager who has a contract employee with a contract that is about to expire.
    Once we isolate a user who has a contract about to expire, we send a notification to the manager. The date that the notification is sent out should be stored in the USR table in a user-defined field, "USR_UDF_LASTSENT."
    Updating this USR_UDF_LASTSENT field is where I'm having difficulty.
    I've tried using the UserManager in a couple of ways. Suppose I've isolated a single user using SearchCriteria and the UserManager and have a single User object called "currentUser." I want to store a Date object in the user defined field "USR_UDF_LASTSENT". Date today = new Date();
    I've tried: currentUser.setAttribute("USR_UDF_LASTSENT", today); //This will run without error, but when I check the DB there is no change to the attribute.
    With a defined instance of UserManager userManager, I've tried: userManager.modify("USR_UDF_LASTSENT", today, currentUser); //This errored out with this error - oracle.iam.identity.exception.NoSuchUserException: IAM-3054135:No user found for the criteria USR_UDF_LASTSENT-9/24/13 2:58 PM.:USR_UDF_LASTSENT:9/24/13 2:58 PM. It looks like it's doing a search rather than a modification.
    I've also tried using the entity manager in the following way:
    Date today = new Date();
    HashMap<String, Object> mapAttrs = new HashMap<String, Object>(); 
    mapAttrs.put("USR_UDF_LASTSENT", today); 
    EntityManager entMgr = Platform.getService(EntityManager.class); 
    entMgr.modifyEntity("User", currentUser.getEntityId(), mapAttrs);
    But it returns with this error: Failed: oracle.iam.platform.entitymgr.UnknownAttributeException: User : [USR_UDF_LASTSENT]
    Is my entityType, "User" inappropriate in this case? What should be used here?
    How can I Set or Update this user defined field from a scheduled task?

    Thanks guys. I did go to Identity System Administration console and chose 'Export' from under "System Managment" which I believe Kevin may have been hinting at. I got an xml export of the AttributeDefinitions for our user defined fields. In this file, there was a header for the attribute I was looking for:
    <AttributeDefinition repo-type="API" name="LastSent" subtype="User Metadata">
       <multiValued>
       <backendName>usr_udf_lastsent</backendName>
    I put the string "LastSent" in place of USR_UDF_LASTSENT in the EntityManager version of my attempt at this task. I believe this is what Kevin and delhi were getting at.
    This didn't work:
    Date today = new Date();
    HashMap<String, Object> mapAttrs = new HashMap<String, Object>(); 
    mapAttrs.put("USR_UDF_LASTSENT", today); 
    EntityManager entMgr = Platform.getService(EntityManager.class); 
    entMgr.modifyEntity("User", currentUser.getEntityId(), mapAttrs);
    But this did:
    Date today = new Date();
    HashMap<String, Object> mapAttrs = new HashMap<String, Object>(); 
    mapAttrs.put("LastSent", today); 
    EntityManager entMgr = Platform.getService(EntityManager.class); 
    entMgr.modifyEntity("User", currentUser.getEntityId(), mapAttrs);
    I wonder if currentUser.setAttribute("LastSent", today); would work... Hmm.

  • Download link to file saved in BLOB type in database

    Hi all,
    I have made a page where i am letting users upload a file in any format, and i'm saving it to database in BLOB datatype field of a table.
    The filetype is also saved in a different column of the table.
    Now I want to retrieve the contents back in that particular format by converting the data in BLOB type to filetype.
    And a link should be provided to download the file.
    A little help can be taken from this link which uses EJB session to do the same thing.
    [http://jdev1013.blogspot.com.au/2009/08/file-upload-and-download-in-toplink-adf.html]
    I want to do the same in ADF 11g JDeveloper using Oracle XE database connection.
    Below is the code i used to upload file data - now i want to download file data -
    public String uploadFile() {
    String amDef = "cabinet.model.AppModule";
    String config = "AppModuleLocal";
    ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
    ViewObject vo1 = am.findViewObject("XfileView1");
    Row row = vo1.createRow();
    if (uploadedFile.getFilename() != null){       
    byte[] array=new byte[(int)uploadedFile.getLength()];
    row.setAttribute("FileName", uploadedFile.getFilename());
    row.setAttribute("FileContent",createBlobDomain(uploadedFile));
    row.setAttribute("FileType", uploadedFile.getContentType());
    row.setAttribute("FileSize", uploadedFile.getLength());
    vo1.insertRow(row);
    am.getTransaction().commit();
    DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcItteratorBindings =
    bindings.findIteratorBinding("XfileView1Iterator");
    dcItteratorBindings.refresh(1);
    Configuration.releaseRootApplicationModule(am, true);
    return "added";
    private BlobDomain createBlobDomain(UploadedFile file)
    // init the internal variables
    InputStream in = null;
    BlobDomain blobDomain = null;
    OutputStream out = null;
    try
    // Get the input stream representing the data from the client
    in = file.getInputStream();
    // create the BlobDomain datatype to store the data in the db
    blobDomain = new BlobDomain();
    // get the outputStream for hte BlobDomain
    out = blobDomain.getBinaryOutputStream();
    IOUtils.copy(in, out);
    catch (IOException e)
    e.printStackTrace();
    catch (SQLException e)
    e.fillInStackTrace();
    // return the filled BlobDomain
    return blobDomain;
    Thanks
    Cheena Malhotra

    Check my 3 part blog about this. This should cover your needs. http://wp.me/pcBZk-aU
    Timo

  • Can "SPML Web Service Complex Data Type field" take multiple values ?

    In Generic Technology Connector's -SPML design parameters section, Can we give multiple values in SPML Web Service Complex Data Type field?
    If not, how can i call methods directly instead of calling them through a values of the "name" attribute of the "complexType" element in SPML Web Service Complex Data Type?
    I need 'SPML Web Service Complex Data Type' to hold multiple values.And based on the request it has to initiate appropriate method of action.
    Presently i have three methods add,modify and delete which i am calling through a single value of the "name" attribute of the "complexType" element in SPML Web Service Complex Data Type.
    I want to replace this single value with multiple menthods , so that a direct interaction between the method,OIM and target can be established.
    Edited by: 821054 on 16/02/2011 04:23

    Thanks Robert.
    You'll need to create your own interface to the webapp database for those kind of data operations
    by this, are you speaking of the internal BC database which stores web app schema data? That would be great if it were possible to update that programmatically because I need to use the List (Checkbox List) field type (for the search functionality), but I need to supply the checkbox options from a web app rather than by manually updating the list entered in the Fields view of the web app settings (shown below).
    I'm curious if anyone else has tried this?
    Again, my reason for needing to use the List (Checkbox List) field type is that the page which processes searches knows to expect a comma separated list for this field type and then appears to be parsing out the individual values for searching out web app items with 1 or more matching values. You're right that text fields (string and multiline) just check for 'string contains' matches, and this would be ok if I was only ever needing to search just one value at a time. Here's an example of what I might do:
    Web App item field value (as recorded against the List (Checkbox List) field type:
    8294877,8294878
    Web App Search value (for this same field):
    8294879,8294877,8294885
    The search would return this web app item because the field contains 2 (1 or more) individual values even though they were entered into the search field in a different order. If this web app item were just a Text (string or multiline) field, the searched value is not a substring of the web app item's stored value, so it would not find a match. Hence the need to use Checkbox List field type.
    The web app will have thousands if not 10s of thousands of records, so dumping them all into one big array or object and searching on the front-end won't be practical (though it works great on smaller datasets).

Maybe you are looking for