The adapter DB BPEL - how to insert XML (variable content) as BLOB?

Hello

I have a scenario where I need to insert a piece of XML (Webservice response in a variable) into a BLOB column in a database.

If I directly passes the value of the blob column, it shows no errors, but I see a "null" inserted into the BLOB column.

Instead, I tried this (coz I didn't know what else to do)...

ORA: parseEscapedXML (ora:getContentAsString(bpws:getVariableData('Invoke_hds_rulebase_Assess_OutputVariable','AssessResponse','/ns1:assess-response')))

I get an error.

Can anyone help me please with the right approach (if any)?

Kind regards
OD EMEA ATC

You must ensure that the data type is base64Binary. As you have here xml, you must convert it to binary. There is no translator delivered for string / binary xml so you should use embedded java

Take a look at this post, there are a lot of another examle in both forums

Re: How to convert String to base64Binary in BPEL process

see you soon
James

Tags: Fusion Middleware

Similar Questions

  • for the first time using the do not know how to insert video to start editing

    for the first time using the do not know how to insert video to start editing

    First thing you need to know is that After Effects is not a video editor. First is to put some shots together to tell stories (that is changing), After Effects for creating those shots (compositing and Visual effects) and to create animated graphics.

    To use AE, start here: starting After Effects

  • Property lists: how to insert a variable as a property?

    Hello.

    I'm trying to insert a variable instead of a newly defined property to add to a list of poroperty.

    This would normally add a new a new property to a list of poroperty:

    Database [#needtogetvariablehere] = typedPassword

    -"Database" is the list of properties, "needtogetvariablehere" is the new poperty and "typedPassword" is the value of the property of the new - thisall works very well.

    I want to generate new names of properties dynamically using an editable text area. How to replace the new 'nedtogetvariablehere' with a variable property name?

    I don't know I put some media rounded somewhere, but everything I try spit a syntax error.

    for example:

    $myvariable = 'blah '.

    Database [#(myVariable)] = typedPassword


    Any ideas?

    Thank you.

    type these one at a time in the message window to see how it works

    g = [:]
    x = 'abc '.
    g [Symbol (x)] = '123 '.
    g to

    -[#abc: "123"]

  • How to insert xml into a table in different format

    Hello
    My version of db: database Oracle 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    I have a xml as below:
    <?xml version="1.0"?>
        <ROWSET>
        <ROW>
        <a>CNET</a>
        <b>21416911</b>
        <c>12345678</c>
        <d>878787</d>
        </ROW>
    </ROWSET>
    
    creating a test table:
    CREATE TABLE test (
        friendlyname VARCHAR2(150),
        value varchar2(200));
    I want to insert the XML in the test of the table as below
    SELECT * FROM test;
    friendlyname value
    a   CNET
    b   21416911
    c   12345678
    d   878787
    Please advice.

    Here's the idea:

    SQL> DECLARE
      2
      3    xmldoc xmltype := xmltype(
      4  '
      5      
      6      
      7      CNET
      8      21416911
      9      12345678
     10      878787
     11      
     12  ') ;
     13
     14  BEGIN
     15
     16    INSERT INTO test (friendlyname, value)
     17    SELECT x.fname, x.value
     18    FROM XMLTable(
     19           '/ROWSET/ROW/*'
     20           passing xmldoc
     21           columns fname varchar2(150) path 'local-name(.)'
     22                 , value varchar2(200) path 'text()'
     23         ) x ;
     24
     25  END;
     26  /
    
    PL/SQL procedure successfully completed
    
    SQL> select * from test;
    
    FRIENDLYNAME     VALUE
    ---------------- ------------
    a                CNET
    b                21416911
    c                12345678
    d                878787
     
    

    Can be optimized according to the size of input XML code and its location.

  • How to insert directly variable cursor in a table

    Hi all

    I use an attribute % ROWCOUNT cursor and I would like to insert the value into a table. When I try to do this directly, I got the error ORA-00911 invalid character. Inserting however more intermediate variable works. No idea why?

    Consider that I have a table called une_table with for example two rows and SOME_TABLE2 with a column of type NUMBER (10) for example. Then I try to run the code like this:

    DECLARE

    CURSOR cur_Test IS

    SELECT * FROM UNE_TABLE;

    BEGIN

    FOR c IN LOOP cur_Test

    DBMS_OUTPUT. Put_line (cur_Test % RowCount); -This line is ok

    INSERT INTO SOME_TABLE2 (COL1) VALUES (cur_Test % ROWCOUNT); - here, it fails

    END LOOP;

    END;

    However when I run it like this:

    DECLARE

    I have SEVERAL;

    CURSOR cur_Test IS

    SELECT * FROM UNE_TABLE;

    BEGIN

    FOR c IN LOOP cur_Test

    DBMS_OUTPUT. Put_line (cur_Test % RowCount); -This line is ok

    I: = cur_Test % ROWCOUNT;

    INSERT INTO SOME_TABLE2 (COL1) VALUES (i); - now it works

    END LOOP;

    END;

    I guess that the character '%' the cause of the problem. Maybe there is some way of backslash or something?

    Of course I can use ROWNUM value or another solution, I'm just curious as to why it does not work.

    Thanks for help

    > I'm just curious as to why it does not work.

    Use of the attributes of PL/SQL in SQL cursor is not taken in charge, according to the documents.

  • The ODI 11 G, how can I validate variable against another variable?


    Hi, I'm trying to validate the outcome of a variable against another variable, I can validate my first variable against any number value, but not against the result of another variable, see the image below, no idea what to do in this case? Thank you!

    Var.gif

    Hi, you can do this by using the prefix of your project in the value of the variable that you are evaluating, like this:

    Here's an example I created. TEST receives 1 and TEST2 receives 1 as well in the test he compares the value of variable against variable TEST1 TEST2:

    I hope that helps!

  • How to insert or update in the data type date

    Hai All

    I have two table T1 and T2 from T1 to T2 I have to move data

    T1 structure code var, varchar of time that I said and T2 intimate outtime, intrinsically, all the introut are the date data type, so I need to pass the data to date the type varchar data


    How to insert or update varchar to date

    Concerning

    Srikkanth.M

    Hello

    SQL> create table tabDate
      2  (dt date);
    
    Table created.
    SQL> declare
      2  v_date varchar2(10):='10-03-2010';
      3  v_time varchar2(10):='0815';
      4   Begin
      5   insert into tabDate values(to_date(v_date||v_time,'dd-mon-yyyy hh24mi'));
      6   end;
      7   /
    declare
    *
    ERROR at line 1:
    ORA-01843: not a valid month
    ORA-06512: at line 5
    
    SQL>  declare
      2   v_date varchar2(10):='10-03-2010';
      3   v_time varchar2(10):='0815';
      4    Begin
      5    insert into tabDate values(to_date(v_date||v_time,'dd-mm-yyyy hh24mi'));
      6  end;
      7  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select to_char(dt,'dd-mm-yyyy hh24mi') from tabDate;
    
    TO_CHAR(DT,'DD-
    ---------------
    
    10-03-2010 0815
    

    Twinkle

  • analysis of values are inserted XML

    SQL> create directory tmp_dir as 'c:\temp';
     
    Directory created
     
    SQL> create table zipcodes (
      2   state_abbreviation  varchar2(2),
      3   zipcode             varchar2(5),
      4   zip_code_extn       varchar2(10),
      5   city                varchar2(80),
      6   num            number(5)
      7  );
     
    Table created
     
    SQL> CREATE OR REPLACE PROCEDURE insertZipcodes (
      2    p_directory IN VARCHAR2
      3  , p_filename  IN VARCHAR2
      4  )
      5  IS       l_num number(5);
      6  BEGIN
      7  l_num := 55;
      8    INSERT INTO zipcodes (state_abbreviation, zipcode, zip_code_extn, city, num)
      9    SELECT state_abbreviation
     10         , zipcode
     11         , zip_code_extn
     12         , city  ,num            
     13    FROM XMLTable('/Zipcodes/mappings'
     14           passing xmltype(bfilename(p_directory, p_filename), nls_charset_id('AL32UTF8'))
     15           columns state_abbreviation varchar2(2)  path 'STATE_ABBREVIATION'
     16                 , zipcode            varchar2(5)  path 'ZIPCODE'
     17                 , zip_code_extn      varchar2(10) path 'ZIP_CODE_EXTN'
     18                 , city               varchar2(80) path 'CITY'
     19                   , num               number(5) 'l_num'
     20         )
     21    ;
     22  
     23  END;
     24  / 
     
    
    null value inserting if i execute the above program..
    how to insert dynamically l_num ??

    Firstly, the procedure does not compile because of the syntax error:

     , num               number(5) 'l_num'
    

    And you don't have to push the XMLTable variable, just use it directly in the SELECT clause:

    INSERT INTO zipcodes (state_abbreviation, zipcode, zip_code_extn, city, num)
    SELECT state_abbreviation
         , zipcode
         , zip_code_extn
         , city
         , l_num
    ...
    
  • How to insert data in the XML file?

    Hi guys,.

    How to insert information into an XML file. I tell you, I have a CFM file with some questions to the user

    When users submit this form within the form information is send in an XML file.

    How can insert this information in the XML file?

    When I don't have a DB?

    Thank you

    Kind regards

    Fabiano Magno Pechibella

    You must

    1. Read in the XML file
    2. Analyze the document in an XML (just one big struct) object
    3. Insert your XML code of the object where you need
    4. rewrite the XML file with your data now included

    You can Google 'ColdFusion working with XML' and find hundreds of items to help you. Here's a beginning tutorial to help you get started:

    Intermediate ColdFusion Tutorials - working with XML

  • How to insert an XML document to the database table

    Here's one my XML document example I want to import into database

    Example XML Document
    <? XML version = "1.0"? >
    rowset <>
    < ROW >
    < DEPTXML department_id = "10" >
    SALES of < DEPARTMENT_NAME > < / DEPARTMENT_NAME >
    < EMPLIST >
    < EMP_T EMPLOYEE_ID = "30" >
    Scott < LAST_NAME > < / LAST_NAME >
    < / EMP_T >
    < EMP_T EMPLOYEE_ID = "31" >
    Marie < LAST_NAME > < / LAST_NAME >
    < / EMP_T >
    < / EMPLIST >
    < / DEPTXML >
    < / ROW >
    < ROW >
    < DEPTXML department_id = "20" >
    < DEPARTMENT_NAME > ACCOUNTING < / DEPARTMENT_NAME >
    < EMPLIST >
    < EMP_T EMPLOYEE_ID = "40" >
    John < LAST_NAME > < / LAST_NAME >
    < / EMP_T >
    < EMP_T EMPLOYEE_ID = "41" >
    Jerry < LAST_NAME > < / LAST_NAME >
    < / EMP_T >
    < / EMPLIST >
    < / DEPTXML >
    < / ROW >
    < / LINES >
    ********End***********

    Table in which I want to import this file

    hr_new_emp
    (
    department_id number,
    department_name varchar2 (50).
    Number of employe_id
    last_name varchar2 (50)
    )

    If your XML code is in a file, the easiest is to load as a CLOB in the file (google search will give you lots of results to load a file into a CLOB, so I won't detail it here). Once you have it as a CLOB you can fairly easily convert that XMLTYPE for example

      v_xml := XMLTYPE(v_clob);
    

    (assuming that v_xml is declared as XMLTYPE and v_clob is declared as a CLOB)

    Once you have it as an XMLTYPE that is simple to use XMLTABLE to break the XML into its components using SQL...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select xmltype('
      2  
      3  
      4  
      5  SALES
      6  
      7  
      8  Scott
      9  
     10  
     11  Mary
     12  
     13  
     14  
     15  
     16  
     17  
     18  ACCOUNTING
     19  
     20  
     21  John
     22  
     23  
     24  Jerry
     25  
     26  
     27  
     28  
     29  ') as xml from dual)
     30  --
     31  -- END OF TEST DATA
     32  --
     33  select x.department_id, x.department_name, y.employee_id, y.last_name
     34  from t
     35      ,xmltable('/ROWSET/ROW'
     36                passing t.xml
     37                columns department_id   number       path '/ROW/DEPTXML/@DEPARTMENT_ID'
     38                       ,department_name varchar2(30) path '/ROW/DEPTXML/DEPARTMENT_NAME'
     39                       ,emplist         xmltype      path '/ROW/DEPTXML/EMPLIST'
     40               ) x
     41      ,xmltable('/EMPLIST/EMP_T'
     42                passing x.emplist
     43                columns employee_id     number       path '/EMP_T/@EMPLOYEE_ID'
     44                       ,last_name       varchar2(30) path '/EMP_T/LAST_NAME'
     45*              ) y
    SQL> /
    
    DEPARTMENT_ID DEPARTMENT_NAME                EMPLOYEE_ID LAST_NAME
    ------------- ------------------------------ ----------- ------------------------------
               10 SALES                                   30 Scott
               10 SALES                                   31 Mary
               20 ACCOUNTING                              40 John
               20 ACCOUNTING                              41 Jerry
    

    ... and once you have selected the data as it is quite easy to use an INSERT statement around it to insert data into a table, as in a regular INSERT... Select...

    If you are dealing with large amounts of data or a more complex XML structure, you can consider using an XML schema to shred the data in tables.

    Example here...

    Re: XML processing in oracle file

    And you can also load XML data easily by using the function XDB (WebDAV) to Oracle. Details in the Oracle documentation for that or you could find help in the forum XML DB, which also has a FAQ detailing the different methods how to load XML shred data...

    DB XML FAQ

  • How to use the loop in BPEL process

    Hi friends

    I did a bpel process that picks up the XMl file using the File adapter and imports the data from the XMl file into db oracle table using the DB adapter...

    But here the XML in the file that have only one line... If I want to insert the XML code in the file that have two or more lines I want to use a loop in my process BPEL how to use loop in my bpel process?

    In my BPEL process, that I have que j' ai utilise used receive, process and call activity where I can use in my BPEL process

    Thanks in advance

    AT

    Here is a basic example of while activity in BPEL

    http://blogs.Oracle.com/ajaysharma/

    Thank you
    AJ

  • How to insert data into the table by using the expression builder in the assign activity

    How to insert data into the table by using the expression builder in affect business in BPEl, I use SOA Suite 11.1.1.5
    Can someone help me please

    Hello

    I don't think that oraext:query-database() can insert data into the table.

    What are your needs?
    Can not you plan to use the DB adapter with the insert operation?

    Kind regards
    Neeraj Sehgal

  • Satellite P200-1FZ: how to insert the smart media card into the card slot

    Hello

    I have read the slim manual, and I can't find any info on the card slot. (other than where he lives on the laptop)

    Could someone tell me please how to insert my card SmartMedia? the slot is huge and I'm worried about losing the card inside the laptop! I assume that the smart media will be automatically run?...

    Thanks in advance!

    It would be good to know what model of laptop you have.
    But, normally, for the smaller cards, you will need an adapter that is often included, as for the memory stick pro duo.
    I think it's just normal size and you have to put in the middle of the card reader slot until you hear a click.

    If you have not changed the AutoPlay settings, you must get a new window with the files on your card, when you put it on your laptop.

  • Insert xml files into the table

    Hi all

    How to create an application, which allows me to download an xml file and insert the file into a table, looking something like what makes the apex, with 'data-> data-> Data Load XML Workshop'.

    I tried to create it using this link https://forums.Oracle.com/message/9170494 # 9170494

    but when loading the file and send it (current executing the "sp") sends the error "ORA-22285: file for FILEOPEN operation or non-existent directory.

    I could slightly auxiliary

    concerning

    This idea is troubling for me.

    The XML file DOES NOT CHANGE.  This is the goal.  You have a DTD/XST that defines where in the XML hierarchy, a data element is and (so) how to access it.  With this information, you can hardcode things.

    Therefore, you should have no reason for that functionality 'map the data column in the table column"of the data loader since all mappings will be always the same.

    As a simple INSERT... The SELECT statement can (and should) be used.

    (use the FUSION if you update / insert data).

    I copy + paste some of my code in a procedure that I use.

    You will need to replace the parameter name (p_filename) with the value of appropriate link (name of item)

      declare
        l_XML XMLType;
      begin
        /* get file from APEX WWV_FLOW_FILES */
        begin
            select XMLType( blob_content, 1 ) -- 1 means that the file is USACII encoded. this may need to be changed.
              into l_XML
            from wwv_flow_files where name = p_filename; -- replace this with the appropriate ITEM NAME
        exception
          when no_data_found then
            raise_application_error( -20001, 'not in FLOW: ''' || p_filename || '''' );
        end;
    
        /* you'll need to figure this one out */
        INSERT INTO T (...)
        SELECT ..
        FROM  XMLTable( '/'
    pasing l_xml
                columns
                       PATH  -- repeat for each "column" you want to extract
            );
    
       delete from wwv_flow_files where name=p_filename;
      end;
    
  • Insert XML data into the MySQL database

    Hi all, I'm new with XML and I need help with the insertion of XML data in the mysql database using coldfusion. I looked on the Coldfusion Documentation and saw how to convert XML to a Coldfusion query... but there was no example of how to do an insert. If anyone can give me a good example or point me towards a good direction on how to do it, I would really appreciate it.

    Thank you very much in advance
    Alfie

    Nevermind, I finally managed to do work!

Maybe you are looking for