Oracle XQuery replacement value

Hello world

Used Oracle: version 11.2.0.3.0

After a few days, I gave up, but I'm sure you have a solution.

I want to change some items, always the same element (same name), with the use of a string tokenize function. I use one, but my problem is the index of the item to change in the loop. I tried to use the $position () function, but without success. Maybe we can use an index but how, because the XQuery variables are immutable.

Here is an example:

update the ingredients set sections = XMLQuery (' copy $gr: = (.modify)

Let $values: = "1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0".

for $i in $gr/ingredients/section/sub_section/ingredient/value_gr

return the value of replacement of the $i with ora:tokenize($values,",") node [5])

return $snf' by the way the sections referring content) where ingredient_id = 601;

This application works, but of course I want to change [5] by 1,2,3...

I think you see what I want.

Thanks in advance

Hello

You are amazing!

I wrote my answer and suddenly your second answer, Oh wait, phew (in french), my question was clear.

I tried and now the update is OK.

This writing is ok for you?

update the ingredients set sections = XMLQuery (' copy $gr = .modify ())

Let $values: = ora:tokenize("1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0,11.0,12.0,13.0",",")

for $i to $p in $gr/ingredients/section/sub_section/ingredient/value_gr

return the replacement value of the node $i with $values [$p])

return $gr' by the way the sections referring content) where ingredient_id = 601;

I have to send you a box of chocolates for Christmas!

Thank you very much

Tags: Database

Similar Questions

  • Replace values with image using DECODE

    I am struggeling to replace the values in a table with images using DECODE, as shown here'https://apex.oracle.com/pls/otn/f?p=21195:1:0:.

    The query itself is no problem and works great:

    SELECT JOB_NAME Job status, DECODE(ENABLED, 'TRUE', '<img src="/i/orcl/up.gif">', 'FALSE', '<img src="/i/orcl/down.gif">') AS

    OF USER_SCHEDULER_JOBS

    Easy as pie, but...

    Somewhere along the line the support < and > are replaced by & lt; and & gt; and the quote with & quot;

    "As a result, the browser displays literally < img src="/i/orcl/up.gif "> and no image.

    What I'm doing wrong?

    635160df-de20-4FE3-9807-b51b06b91919 wrote:

    Please update your forum profile with a real handle instead of '635160df-de20-4fe3-9807-b51b06b91919 '.

    Somewhere along the line of the support < and=""> are replaced by < and > and quotes with '. '.

    Therefore, the browser displays literally and no image.

    What I'm doing wrong?

    The column attribute the text to display as should be the Standard report column rather than the default display text (escape special characters).

  • you place your order in xquery-distinct values

    I was surprised to see the return of the following different results, is this a bug in the XML Query rewrite, or is the order of not only guaranteed the distinct values?

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    With partitioning, OLAP, Data Mining and Real Application Testing options

    SQL > SELECT XMLQUERY)

    2 ' (string code points

    3 distinct-values ((99,98,97)))'

    4 ELECTION CONTENT) result

    5 FROM dual;

    RESULT

    --------------------------------------------------------------------------------

    ABC

    SQL > SELECT / * + NO_XML_QUERY_REWRITE * /.

    () 2 XMLQUERY

    3 ' (string code points

    distinct-values ((99,98,97))) 4'

    5 ELECTION CONTENT) result

    6 FROM dual;

    RESULT

    --------------------------------------------------------------------------------

    CBA

    SQL >

    Hello

    The specs say the order is "dependent application": fn: distinct values

    Summary so is (I guess), strict language point of view, should not rest on any apparent order in the resulting sequence.

    The results collected by the two queries probably be different for the same reason: different implementation.

    First one with XQuery Rewrite active is solved using the SQL operators and functions, something along these lines:

    SELECT 'CODEPOINT2STR_FUNC' ('SEQUENCE')

    DE)

    SELECT 'AGGREGATE_FUNC' (VALUE (T) SEPARATE) "SEQUENCES".

    TABLE ("SEQUENCE_FUNC"(99, 98, 97)) T

    ) ;

    While the second is evaluated by the XVM and apparently maintains the original order.

  • Replace values web.xml with a deployment plan.  Does not not on WL 10.3.2

    Hi All-

    I am trying to replace a value of web.xml to one on a weblogic deployment plan. I deployed the application on WL 10.3.2 and used the deployment below plan. No matter what I do it does not seem to appreciate in value.

    Web.XML:

    <? XML version = "1.0" encoding = "windows-1252"? >
    <! DOCTYPE web - app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3 / / IN" "http://java.sun.com/dtd/web-app_2_3.dtd" >
    <>web - app
    ...
    < context-param >
    TokenGroup < param-name > < / param-name >
    OldValue < param-value > < / param-value >
    < / context-param >
    ...
    < / web - app >

    Deployment plan:

    <? XML version = "1.0" encoding = "UTF - 8"? >
    <-plan of deployment xmlns = "http://xmlns.oracle.com/weblogic/deployment-plan."
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance".
    xsi: schemaLocation = "http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd".
    global variables = "false" >


    APPName < application name > - < / application_name >

    > definition of variable <
    < variable >
    < name > TokenGroup < / name >
    < value > Key123456 < / value >
    < / variable >

    < / variable-definition >


    < module-override >
    < module name > APPName.war < / module-name >
    war of < module-type > < / module-type >
    < descriptor-external module = "false" >
    Web - app of the < root > < / root >
    < uri > WEB-INF/web.xml < / uri >

    > assignment of variable <
    < name > TokenGroup < / name >
    < xpath > / web-app/context-param / [param-name = "TokenGroup"] / param-value < / xpath >
    Replace < operation > < / operation >
    < / variable assignment >


    < / module-descriptor >
    < / module-override >
    < / deployment plan >


    I also tried other formats for the xpath expression such as:

    / Web-App/Context-param / {param-name = "TokenGroup"} / param-value
    / Web-App/Context-param [param-name = "TokenGroup"] / param-value

    Any ideas why it does not work?

    Thank you
    Joe

    "web.xml".
    -------------




    name
    Joe


    password
    password


    ParameterServlet
    ParameterServlet


    ParameterServlet
    / ParameterServlet

    ParameterServlet
    ------------------------
    import java.io.IOException;

    import javax.servlet.ServletConfig;
    to import javax.servlet.ServletContext;
    to import javax.servlet.ServletException;
    Import javax.servlet.ServletOutputStream;
    Import javax.servlet.http.HttpServlet;
    to import javax.servlet.http.HttpServletRequest;
    to import javax.servlet.http.HttpServletResponse;

    SerializableAttribute public class ParameterServlet extends HttpServlet {}
    private String dbName = "";

    private String dbPassword = "";

    Public Sub init (ServletConfig config) throws ServletException {}
    Super.init (config);
    ServletContext context = getServletContext();
    dbName = context.getInitParameter ("name");
    dbPassword = context.getInitParameter ("password");

    }

    ' Public Sub doGet (HttpServletRequest req, HttpServletResponse res)
    throws IOException {}
    ServletOutputStream out = res.getOutputStream ();
    res.setContentType("text/html");
    out.println(")Basic servlet");
    out.println(")Database user name is "+ dbName);
    out.println(")

    Database password is "+ dbPassword +"");
    out.println(")");
    }
    }

    'Plan '.
    --------------


    virtual


         name

         akshay1
         
         
         password
         koul1
         



    virtual
    war

    Web - app
    WEB-INF/web.xml
         
              name
              / Web-App/Context-param / [param-name = 'name'] / param-value
              replace
         

         
              password
              / Web-App/Context-param / [param-name = "password"] / param-value
              replace
         



    C:\DOCUME~1\user\LOCALS~1\Temp\user\.\config\deployments\virtual\plan

    It works for me... I think that your file "web.xml" is the origin of the problem.

    Try to replace



    with


    I hope this helps.

    -Akshay

  • Search and replace values in the text field before the values are stored in DB

    Hello
    There is a question - answer and text box text field - in my application. Problem is, some of the answers are stored with the apostrophes to the DB and I have a problem while recovering in the DB. I need to replace the single quotes 1 with 2 apostrophes. The values are stored in the DB when you click on the submit button.

    So, I'm using the following javascript code:
    italics
    < script type = "text/javascript" >
    function test().
    {
    var str = "& P2_S1.";
    document. Write (Escape (STR));
    }
    < /script >
    italics
    I need to call this javascript function, when the user clicks on the button submit, but BEFORE the values are stored in the DB. How can I get this done?

    Please let me know.

    Hi Suzi,

    Just use

    begin
    update test set S1=replace(:P2_S1, '''', '''''') where name=:APP_USER;
    end;
    

    as you did in your SELECT statement.

    But I shake also why you want to do? Where do you have problems with the apostrophe?

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • function Oracle detects not value space, or null

    I have a feature of oracle that take two id parameter, newClientLegalName. On the basis of the second function parameter performs a specific action. the specified condition is


    IF (newClientLegalName! = "BDU")) THEN

    -do something

    ON THE OTHER

    -do something

    END IF

    It works very well in all conditions except when I pass null or space in the second parameter. How do I create a condition that fetch the value null or space when it is passed as a second parameter. signature of the function is

    copyReview (caseID in NUMBERS, newClientLegalName IN Client.Legal_Name%TYPE)

    Thank you
    signhm

    Use the NVL function.

    for example

    IF (nvl (newClientLegalName, 'empty')! = "BDU")) THEN

    Published by: Robert Geier on October 14, 2009 16:02

  • Oracle OLAP: same values according to dimensions members

    We had a request from a customer who says:
    By Essbase, the same value of dimension member can exist in several dimensions. for example if we have an account with Member 1001 dimension, it is not possible to have the dimension of product with the same value of Member 1001. It is essentially because it implements Essbase as a shared member. Apparently, Essbase Excel-addin will not know what dimension to search for if both have the same values.

    According to our understanding, there is no such restriction in Oracle OLAP both during cube generation or querying through Excel add-in. that is to say we can have the size of account with 1001 members and same value member can exist in a product dimension. Please notify and if anyone has any reference to all documentation in this regard please let us know.

    Hello

    You're right - there is no such limitation in Oracle OLAP.

    A dimension value must be unique within a given dimension, but may be repeated in other dimensions.

    I have all the documentation, but it's really easy to prove using the OLAP in AWM worksheet, for example:

    AW create test
    set the text of side dim1
    maintain dim1 add 'member1 '.
    report dim1
    set the text of side dim2
    maintain dim2 add 'member1 '.
    report dim2
    AW detach test
    AW delete test

    I hope this helps

    Thank you

    Stuart Bunby

    OLAP blog: http://oracleOLAP.blogspot.com
    OLAP Wiki: http://wiki.oracle.com/page/Oracle+OLAP+Option
    OLAP OTN: http://www.oracle.com/technology/products/bi/olap/index.html
    DW OTN: http://www.oracle.com/technology/products/bi/db/11g/index.html

  • Page updated replacement values

    I have a review of the score card that allows an employee to submit a request for compensation via a pop-up window. After submitting their application, it refreshes the main window to show them their request pending with other data. On the original page, there are several questions that the employee is asked to answer via radio buttons. Because the popup refreshes the page, button responses must be delivered in. Is it possible to save these answers during the updating of the forced page occurs? (This is a refresh of the page JavaScript - not a branch of the APEX). Thank you.

    PS - I'm still working in 3.2, so I do not have access to dynamic actions 4.0...

    If you can control the call already with a refresh of the page Javascript window, can force you to submit the page? That should save the values to the database through the process that fires after submit, no?

  • How do I know how many nodes updated

    Hello

    I can say after doing an update of XQuery (replacement value of the node) how many nodes have been updated to XmlResult?

    Thank you.

    As far as I KNOW, XQuery update itself does not provide these means. It would be up to DB XML to provide such a feature, as it did with XmlModify. XmlModify is removed from the latest version but still once as I KNOW DB XML currently does not provide the features that you are talking about. The DB XML guys should know better, however.

    Vyacheslav

  • All AR Oracle seeded available reports what FDF shows values?

    Hello

    I would like if someone is aware of reports Oracle seeded showing values of de FACTO at the level header Transaction that can help eliminate having different demand for RICE.

    Please answer.

    Thank you.

    Nope

  • Impossible to compile the XQuery modify

    Hi gurus. Oracle 11.2 EA running on Linux. SQL Dev 3.2.30.09.

    I'm pretty decent with XPath and XSLT, but I'm new to XQuery. I've set up a few simple FLOWRs, but I'm getting a little more complex. I have an XQuery query where I am trying to replace some of the inline data. I've clipped the real XML and code down to a very simple example that will always return the same error.

    The error:

    ORA-19112: error raised during the evaluation: XQuery Update cannot be compiled

    19112 00000 - "triggered when evaluating error: %s.

    * Cause: The error function was called during the evaluation of the XQuery expression.

    * Action: Check the error message for possible causes.

    Error on line: column 7:14

    My Xquery:

    SELECT XMLQuery( 
      'copy $tmp := $xmldata 
           modify (replace value of node $tmp/MSG_CNTNT_XML/Message/msgHdr/Source/Format/text() with "abc") 
         return $tmp' 
         PASSING msg_cntnt_xml as "xmldata"
         RETURNING CONTENT ) xmlmct
    FROM (SELECT xmltype('<Message>
       <msgHdr>
          <Source>
             <Format>CTS</Format>
          </Source>
       </msgHdr>
    </Message>') msg_cntnt_xml
           FROM DUAL) 
    ;
    
    

    Any general advice for XQuery and change is cool, but what I am really looking for, that's why I get the "update cannot be compiled. (BTW, note the misspelling, cannot, I don't judge).

    Tips for debugging or be able to view the intermediate outcomes would be great also.

    Thank you.

    LewisC

    Hi Lewis,

    What is your version of the database accurate?

    You try to use XQuery Update Facility (a small extension to XQuery 1.0) which is available only from 11.2.0.3 .

    On previous versions, you can use the updateXML() function:

    SQL > SELECT updateXML)

    2 msg_cntnt_xml

    3, ' / message/msgHdr/Source/Format / text () '

    4, 'abc '.

    (5) xmlmct

    6 (SELECT xmltype ('))

    7

    8

    9           CTS

    10

    11

    12 ') msg_cntnt_xml

    13 DOUBLE)

    14;

    XMLMCT

    --------------------------------------------------------------------------------

    ABC

  • Help - syntax nested XMLQuery (XQuery)

    I need to query a relational table that includes an XMLType column to binary XML.  The XMLType column contains an arbitrary length XML document. My query is in part dependent on values of the relational columns and data values in XML documents.  The body of the XML document with the root element, consists of 3 main sections (items): Header1, 1/document; In - tete2, 1/document; and the details, 1/document.  The details section consists of multiple, arbitrary number, sections of details (elements). Provision of data and sample table are below.

    For a particular TLID CUST or SHIP_DATE, etc... I need to return the Header1, in tete2 and several sections detail where the values of elements within the sections of specific details correspond to additional qualifications.

    If I just want back the sections in detail, I can do this successfully with the following query:

    Select cust, tlid, xmlquery('declare default element namespace ""http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd";") (::)

    for $i in/C52R09/DETAILS/DETAIL

    where $i / OrderNumber = "SBC00999."

                            return $i' PASSAGE xml_doc

    HAPPY RETURN) .getClobVal (retail)

    of xml_truck_info

    where tlid = '424500'

    and xmlexists (' declare default element namespace ""http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd";") (::)

    $x/C52R09/HEADER1 [TruckNumber = "424500"]' Xml_doc of PASSAGE AS 'x');

    However, I must return the sections Header1 and tete2 once per document, if the query returns all the sections in detail, regardless of the question of if the query returns 1 or more details sections.

    My impression is that this will necessitate a nested XQuery.  I had no success, get the correct syntax for this.  I lost a lot of time searching the web for examples that would again my scenario.  It seems that there is a lack of detailed and clear information and examples available on the implementation of Oracle XQuery and the structure.  I found a few examples that are close to what I'm trying to do; However, when I twist them, the query spit upwards.

    Based on the 2 following examples from the web or Oracle documentation:

    SELECT rownum, XMLQuery)

    <>counties

    {for $c in ora:view("CHAMBER_OF_COMMERCE")

    Let $coc_county: = $c / ROW/COC_COUNTY/text (),.

    $coc_name: = $c/ROW/COC_NAME,.

    $coc_phone: = $c / ROW/COC_PHONE/textb)

    where $coc_county = $cc_county/county / text)

    order of $coc_county

    return

    < population = "{xs County:unsignedInt(sum(/cities/city/population))}" >

    < name > {$coc_county} < / name >

    < Room phone = "{$coc_phone}" > {$coc_name / text ()} < / room >

    < attractions >

    {for $a in collection ("/public")

    where $coc_county = $a / attraction/county/text)

    return $a

    }

    < / attractions >

    {< / county >}

    < / counties >

    THROUGH THE VALUE cc_city_populations,

    XMLTYPE ("< count > ' |") cc_county | ("< / County >") AS "cc_county".

    RETURN CONTENT)

    OF county_census;

    and

    (SELECT XMLQuery

    ' for $i in $h / / channel

    return

    < headlines >

    new articles < title > OTN on Oracle Solaris < /title >

    elements <>

    {

    for $j in $h / / article

    where ora: contains ($j, "Oracle Solaris")

    return < element > {($j/title, $j/link)} < / item >

    }

    < / object >

    < / news > '

    PASSAGE xmlparse (document httpuritype ('http://feeds.delicious.com/v2/rss/OracleTechnologyNetwork/ ))

    otntecharticle') .getCLOB ()) as 'h '.

    HAPPY RETURN) .getStringVal () as a RESULT OF THE DOUBLE;

    I modified my simple and successful query above the following:

    Select tlid, XMLQuery('declare default element namespace ""http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd";") (::)

    for $i in /C52R09

    return

    headers <>

    "{$i / Header1}.

    "{$i / in tete2}.

    < / header >

    {

    for $x in $i/DETAILS/DETAILS

    where $x / MarvinOrderNumber = "SBC00999".

    return $x

    }'

    PASSAGE xml_doc

    HAPPY RETURN) .getClobVal (retail)

    of xml_truck_info

    where TLID = '424500'

    and xmlexists (' declare default element namespace ""http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd";") (::)

    $x/C52R09/HEADER1 [TruckNumber = "424500"]' Xml_doc of PASSAGE AS 'x');

    When it is running in SQLDeveloper the result still reflects a problem with the curly braces "{" around the second 'for' expression.  I ran this with different iterations, to remove the braces around the $i / Header1 and $i / tete2 sections.  It makes no difference.  I get similar results as follows:

    Error in the command line: 16 column: 6

    Error report:

    SQL error: ORA-19114: XPST0003 - error during parsing of the XQuery expression:

    LPX-00801: XQuery syntax error in ' {'}

    9                   {

    -                   ^

    19114 00000 - "error during the analysis of the XQuery expression: %s.

    * Cause: An error occurred during parsing of the XQuery expression.

    * Action: Check the error message for possible causes.

    My table, XML_TRUCK_INFO, looks like this:

    Name Type

    -----------------   ----------------------------

    CUST VARCHAR2 (7)

    LOC VARCHAR2 (5)

    NUMBER OF TLID

    NUMBER OF STID

    SHIP_DATE DATE

    SHIPPED_FLAG VARCHAR2 (1)

    SYS XML_DOC. XMLTYPE BINARY STORAGE

    Here is a sample of the content XML_DOC I run the XQuery query against.

    <? XML version = "1.0" standalone = "yes"? >

    " < C52R09 xmlns: xsi =" http://www.w3.org/2001/XMLSchema-instance "

    ' xsi:noNamspaceSchemaLocation = ' http://abhist.acme.com:8080/Acme/schema/C52R09_v2.xsd                                           

    http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd' > .

    < HEADER1 >

    < TruckNumber > 424500 < / TruckNumber >

    < StopID > 16 < / StopID >

    < ShipFrom > CITYNAME < / ShipFrom >

    < ShippingDate > 10 June 2013 < / ShippingDate >

    < PlannedDepartureDate > 10 June 2013 05:00 < / PlannedDepartureDate >

    < ETADate > 11 June 2013 < / ETADate >

    < LoadName > SW 29 < / LoadName >

    < StopName > 16 - FREEPORT, < / StopName >

    < StopComment / >

    BILL to < TruckStatus > < / TruckStatus >

    < ReportType > C < / ReportType >

    < / HEADER1 >

    -< tete2 >

    < DestAddrName > - NAME of the CLIENT-COMPANY < / DestAddrName >

    < DestAddrLine1 > 23 EAST 4TH AVENUE < / DestAddrLine1 >

    < DestAddrLine2 / >

    < DestCity / >

    < DestState / >

    < DestZip > 55555 < / DestZip >

    < /-tete2 >

    < DETAILS >

    < DETAIL >

    SBC00999 < OrderNumber > < / OrderNumber >

    < LineNumber > 3 < / LineNumber >

    ORDER CUSTOMER < OrderType > STANDARD < / OrderType >

    < OrderStatus > SHIPPED COMPLETE < / OrderStatus >

    < OrderDate > 23 May 2013 < / OrderDate >

    Job1 < JobName > < / JobName >

    < QtyOrdered > 3 < / QtyOrdered >

    < QtyShipped > 3 < / QtyShipped >

    < WeekofDelivery > 10 June 2013 < / WeekofDelivery >

    < status > CE TRUCK < / status >

    < Numeroclient > 5000 - 000 < / Numeroclient >

    CUSTNAME1 < CustomerName > < / CustomerName >

    W163409 < CustomerPONumber > < / CustomerPONumber >

    < > 4.56 CubicFeet < / CubicFeet >

    < ListPrice > 677 < / ListPrice >

    < SpecialMQSCode >

    < ProductType > AAZG < / ProductType >

    < UnitType > ABEG < / UnitType >

    < / SpecialMQSCode >

    MOUNTING INSERT < ShortDescription > < / ShortDescription >

    < OpeningCount > 5 < / OpeningCount >

    < TrackingLines >

    < TrackingNo > 0YD 746 < / TrackingNo >

    Shipped from < TrackingStatus > < / TrackingStatus >

    < ScanData >

    < ScanDate > 11 June 2013 07:05 < / ScanDate >

    brand of < signature > < / Signature >

    SCANNED < ScanStatus > < / ScanStatus >

    < / ScanData >

    < TrackingNo > 0YD 747 < / TrackingNo >

    Shipped from < TrackingStatus > < / TrackingStatus >

    < ScanData >

    < ScanDate > 11 June 2013 07:31 < / ScanDate >

    brand of < signature > < / Signature >

    SCANNED < ScanStatus > < / ScanStatus >

    < / ScanData >

    < TrackingNo > 0YD 748 < / TrackingNo >

    Shipped from < TrackingStatus > < / TrackingStatus >

    < ScanData >

    < ScanDate > 11 June 2013 07:06 < / ScanDate >

    brand of < signature > < / Signature >

    SCANNED < ScanStatus > < / ScanStatus >

    < / ScanData >

    < / TrackingLines >

    < / DETAILS >

    < DETAIL >

    SBC00999 < OrderNumber > < / OrderNumber >

    < LineNumber > 4 < / LineNumber >

    ORDER CUSTOMER < OrderType > STANDARD < / OrderType >

    < OrderStatus > SHIPPED COMPLETE < / OrderStatus >

    < OrderDate > 23 May 2013 < / OrderDate >

    Job1 < JobName > < / JobName >

    < QtyOrdered > 3 < / QtyOrdered >

    < QtyShipped > 3 < / QtyShipped >

    < WeekofDelivery > 10 June 2013 < / WeekofDelivery >

    < status > CE TRUCK < / status >

    < Numeroclient > 5000 - 000 < / Numeroclient >

    CUSTNAME1 < CustomerName > < / CustomerName >

    W163409 < CustomerPONumber > < / CustomerPONumber >

    < > 4.56 CubicFeet < / CubicFeet >

    < ListPrice > 677 < / ListPrice >

    < SpecialMQSCode >

    < ProductType > AAZG < / ProductType >

    < UnitType > ABEG < / UnitType >

    < / SpecialMQSCode >

    MOUNTING INSERT < ShortDescription > < / ShortDescription >

    < OpeningCount > 5 < / OpeningCount >

    < TrackingLines >

    < TrackingNo > 0YD 749 < / TrackingNo >

    Shipped from < TrackingStatus > < / TrackingStatus >

    < ScanData >

    < ScanDate > 11 June 2013 07:05 < / ScanDate >

    brand of < signature > < / Signature >

    SCANNED < ScanStatus > < / ScanStatus >

    < / ScanData >

    < TrackingNo > 0YD 750 < / TrackingNo >

    Shipped from < TrackingStatus > < / TrackingStatus >

    < ScanData >

    < ScanDate > 11 June 2013 07:05 < / ScanDate >

    brand of < signature > < / Signature >

    SCANNED < ScanStatus > < / ScanStatus >

    < / ScanData >

    < TrackingNo > 0YD 751 < / TrackingNo >

    Shipped from < TrackingStatus > < / TrackingStatus >

    < ScanData >

    < ScanDate > 11 June 2013 06:46 < / ScanDate >

    brand of < signature > < / Signature >

    SCANNED < ScanStatus > < / ScanStatus >

    < / ScanData >

    < / TrackingLines >

    < / DETAILS >

    < DETAIL >

    SBC00999 < OrderNumber > < / OrderNumber >

    < LineNumber > 5 < / LineNumber >

    ORDER CUSTOMER < OrderType > STANDARD < / OrderType >

    < OrderStatus > SHIPPED COMPLETE < / OrderStatus >

    < OrderDate > 23 May 2013 < / OrderDate >

    Job1 < JobName > < / JobName >

    < QtyOrdered > 2 < / QtyOrdered >

    < QtyShipped > 2 < / QtyShipped >

    < WeekofDelivery > 10 June 2013 < / WeekofDelivery >

    < status > CE TRUCK < / status >

    < Numeroclient > 5000 - 000 < / Numeroclient >

    CUSTNAME1 < CustomerName > < / CustomerName >

    W163409 < CustomerPONumber > < / CustomerPONumber >

    < > 4.56 CubicFeet < / CubicFeet >

    < ListPrice > 677 < / ListPrice >

    < SpecialMQSCode >

    < ProductType > AAZG < / ProductType >

    < UnitType > ABEG < / UnitType >

    < / SpecialMQSCode >

    MOUNTING INSERT < ShortDescription > < / ShortDescription >

    < OpeningCount > 5 < / OpeningCount >

    < TrackingLines >

    < TrackingNo > 0YD 752 < / TrackingNo >

    Shipped from < TrackingStatus > < / TrackingStatus >

    < ScanData >

    < ScanDate > 11 June 2013 07:05 < / ScanDate >

    brand of < signature > < / Signature >

    SCANNED < ScanStatus > < / ScanStatus >

    < / ScanData >

    < TrackingNo > 0YD 753 < / TrackingNo >

    Shipped from < TrackingStatus > < / TrackingStatus >

    < ScanData >

    < ScanDate > 11 June 2013 07:42 < / ScanDate >

    brand of < signature > < / Signature >

    SCANNED < ScanStatus > < / ScanStatus >

    < / ScanData >

    < / TrackingLines >

    < / DETAILS >

    < DETAIL >

    SBC01011 < OrderNumber > < / OrderNumber >

    < LineNumber > 1 < / LineNumber >

    ORDER CUSTOMER < OrderType > STANDARD < / OrderType >

    < OrderStatus > SHIPPED COMPLETE < / OrderStatus >

    < OrderDate > 28 may 2013 < / OrderDate >

    Job2 < JobName > < / JobName >

    < QtyOrdered > 4 < / QtyOrdered >

    < QtyShipped > 4 < / QtyShipped >

    < WeekofDelivery > 10 June 2013 < / WeekofDelivery >

    < status > CE TRUCK < / status >

    < Numeroclient > 5000 - 000 < / Numeroclient >

    CUSTNAME1 < CustomerName > < / CustomerName >

    W163766 < CustomerPONumber > < / CustomerPONumber >

    < > 4.6 CubicFeet < / CubicFeet >

    < ListPrice > 823 < / ListPrice >

    < SpecialMQSCode >

    < ProductType > AAZG < / ProductType >

    < UnitType > ABEG < / UnitType >

    < / SpecialMQSCode >

    MOUNTING INSERT < ShortDescription > < / ShortDescription >

    < OpeningCount > 5 < / OpeningCount >

    < TrackingLines >

    < TrackingNo > 0YV016 < / TrackingNo >

    Shipped from < TrackingStatus > < / TrackingStatus >

    < ScanData >

    < ScanDate > 11 June 2013 07:46 < / ScanDate >

    brand of < signature > < / Signature >

    SCANNED < ScanStatus > < / ScanStatus >

    < / ScanData >

    < TrackingNo > 0YV017 < / TrackingNo >

    Shipped from < TrackingStatus > < / TrackingStatus >

    < ScanData >

    < ScanDate > 11 June 2013 07:25 < / ScanDate >

    brand of < signature > < / Signature >

    SCANNED < ScanStatus > < / ScanStatus >

    < / ScanData >

    < TrackingNo > 0YV018 < / TrackingNo >

    Shipped from < TrackingStatus > < / TrackingStatus >

    < ScanData >

    < ScanDate > 11 June 2013 06:51 < / ScanDate >

    brand of < signature > < / Signature >

    SCANNED < ScanStatus > < / ScanStatus >

    < / ScanData >

    < TrackingNo > 0YV019 < / TrackingNo >

    Shipped from < TrackingStatus > < / TrackingStatus >

    < ScanData >

    < ScanDate > 11 June 2013 07:22 < / ScanDate >

    brand of < signature > < / Signature >

    SCANNED < ScanStatus > < / ScanStatus >

    < / ScanData >

    < / TrackingLines >

    < / DETAILS >

    < / DETAILS >

    < / C52R09 >

    I would appreciate any help and/or an overview from others more experienced in what I have.

    Thanks in advance,

    Paul

    Paul,

    If I just replace the element root of your original sample with that described by a space, then the following works as expected:

    SQL > select tlid

    2, XMLSerialize (document

    (3) XMLQuery

    4 ' declare ns0 namespace = "http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd"; (::)

    5. let $dtls: = /ns0:C52R09 / ns0:DETAILS / ns0:DETAIL [ns0:OrderNumber = $order_no]

    6 if return ($dtls) then

    7

    8              {

    9 {/ ns0:C52R09 / ns0:HEADER1, /ns0:C52R09 / ns0:HEADER2}

    10              ,

    { $dtls }

    11              }

    12

    13 (else)"

    14 PASSING xml_doc

    15, 'SBC00999' as 'order_no '.

    16 RETURN CONTENT

    17           )

    18 as clob dash

    (19) details

    20 of xml_truck_info

    where the 21 tlid = '424500'

    22 and xmlexists)

    23 ' declare default element namespace "http://abhist.acme.com:8080/acme/schema/C52R09_v2.xsd"; (::)

    24/C52R09/HEADER1 [TruckNumber = $truck_no].

    25 PASSING xml_doc

    26, '424500' as 'truck_no '.

    27        )

    28;

    TLID DETAIL

    ---------- --------------------------------------------------------------------------------

    424500

    http://abhist.acme.com:8080/Acme/schema/C52R09_v2.xsd">

    424500

    16

    CITYNAME

    JUNE 10, 2013

    JUNE 10, 2013 05:00

    JUNE 11, 2013

    SW 29

    16-FREEPORT,

    There is another thing that has changed in the XML content, such as namespace redeclaration?

  • Replace the elements of vertex

    Dear,

    We are in the process of implementation Oracle EBS R12 - INCE for user US, as you know that Vertex calculates the tax as a third party for Oracle, our requirement is to override some taxes (Ex. FUTA, SS, ETC.) for some payroll run periods.

    Please indicate how to achieve this requirement

    Thank you

    Hi Arif,

    I fixed this problem by implementing the procedure below, note: (FUTA) element for example.

    1. from the employee tax information, check the waiver for the FUTA element. then

    2 Add the element (FUTA) manually on the inputs of the alternate value to pay the employee element. then

    3-pay delivery / Quick Pay.

    4. then you will got the replacement value of the item (FUTA) in addition, you receive the calculations of vertices for the other elements.

    Any comment for this solution?

    Best regards

    Anas

  • Calling a function multiple return values...

    Hello

    I wrote a simple function 2 return values. It comes to my own understanding.

    create or replace function func1 (empid number)

    Return number

    is

    number of SAL;

    number of deptID;

    Start

    Select the wage in sal of employees where employee_id = empid;

    Select department_id from deptid from employees where employee_id = empid;

    return of sal;

    deptid return;

    end;

    I tried to call the function like below: -.

    declare

    number of performance(1);

    Result2 number;

    Start

    performance(1): = func1 (101);

    Result2: = func2 (101);

    dbms_output.put_line(result ||) '' || Result2);

    end;

    output:-1700 1700

    the salary was posted twice.

    I understand that the second query has not been taken into account.

    Please let me know how this can be achieved.

    Thanks and greetings

    Here is an example of functions Oracle return multiple values - dBforums:

    CREATE or REPLACE TYPE pmc_tab AS TABLE OF NUMBER;

    CREATE TABLE v_stats_daily (start_date date, number of Field1, Field2 number, field3 number);

    INSERT INTO v_stats_daily VALUES('08-OCT-2003',10,20,30);

    INSERT INTO v_stats_daily VALUES('08-OCT-2003',40,50,60);

    INSERT INTO v_stats_daily VALUES('08-OCT-2003',70,80,90);

    CREATE OR REPLACE FUNCTION PMC_STATS

    (pStatDate Date) IS BACK pmc_tab

    MyArray pmc_tab;

    NUMBER of vstat1;

    NUMBER of vstat2;

    NUMBER of vstat3;

    BEGIN

    MyArray: = pmc_tab();

    SELECT sum (Field1), sum (field2), sum (field3)

    IN vstat1, vstat2, vstat3

    OF v_stats_daily

    WHERE the arguments start_date = pStatDate;

    MyArray.EXTEND;

    MyArray (1): = vstat1;

    MyArray.EXTEND;

    MyArray (2): = vstat2;

    MyArray.EXTEND;

    MyArray (3): = vstat3;

    RETURN MyArray;

    END;

    /

    Set serveroutput ON

    DECLARE

    MyDate DATE;

    MyArray pmc_tab;

    I have SEVERAL;

    numOut NUMBER;

    BEGIN

    MyArray: = pmc_stats('08-OCT-2003');

    dbms_output.put_line (' number of Table: ' | to_char (myArray.Count));

    FOR i IN 1.MyArray.last LOOP

    numOut: = MyArray (i);

    -If numOut is null then

    dbms_output.put_line (' value: ' | to_char (numOut));

    -end if;

    END LOOP;

    END;

    /

    /

    Table number: 3

    Value: 120

    Value: 150

    Value: 180

    PL/SQL procedure successfully completed.

    /

    Post edited by: Elya

  • Construction of the line in Oracle

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

    I have a two tables as below:
    CREATE TABLE CUST (
        custname VARCHAR2(30),
        cardtype VARCHAR2(20),
        cardvalue VARCHAR2(30));
        
    CREATE TABLE CUSTDETAILS (
        custname VARCHAR2(30),
        cardstring VARCHAR2(250));
    I have to write a procedure as below:
    CREATE OR REPLACE PROCEDURE INSERTCUST (p_custname IN VARCHAR2(30)
        ,p_cardtype IN VARCHAR2(30)
        ,p_cardvalue)
    AS
    BEGIN
        INSERT INTO CUST(custname, cardtype, cardvalue)
        VALUES (p_custname, p_cardtype, p_cardvalue);
        
        INSERT INTO CUSTDETAILS (custname, cardstring)
        VALUES (p_custname, /*construct a string from input parameters*/);
    END;
    In the foregoing, if input parameters are Tracy, MASTERCARD, 098765432123
    I need to insert into the column of the table CUSTDETAILS CARDSTRING something like this:
    MASTERCARD~098765432123|
    When I get another set of input parameters for custname even as Tracy, VISA, 123456789098
    So I have to add the above already existing like this:
    MASTERCARD~098765432123|VISA~123456789098|
    Please advice.

    Hello

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

    I have a two tables as below:

    CREATE TABLE CUST (
    custname VARCHAR2(30),
    cardtype VARCHAR2(20),
    cardvalue VARCHAR2(30));
    
    CREATE TABLE CUSTDETAILS (
    custname VARCHAR2(30),
    cardstring VARCHAR2(250));
    

    Thanks for posting this information; It is really useful.
    Be sure to post the results. If questions of DML, results will be the content of the or are changed after each DML statement tables. After a few calls procedure sample, with different arguemnts and indicate what the tables must contain after each of them.

    I have to write a procedure as below:

    CREATE OR REPLACE PROCEDURE INSERTCUST (p_custname IN VARCHAR2(30)
    ,p_cardtype IN VARCHAR2(30)
    ,p_cardvalue)
    AS
    BEGIN
    INSERT INTO CUST(custname, cardtype, cardvalue)
    VALUES (p_custname, p_cardtype, p_cardvalue);
    
    INSERT INTO CUSTDETAILS (custname, cardstring)
    VALUES (p_custname, /*construct a string from input parameters*/);
    END;
    

    In the foregoing, if input parameters are Tracy, MASTERCARD, 098765432123
    I need to insert into the column of the table CUSTDETAILS CARDSTRING something like this:

    MASTERCARD~098765432123|
    

    The operator of concatenation in Oracle is | NULL values do not hurt anything, in other words, these 3 phrases:
    (1) x | NULL VALUE
    (2) NULL | x
    (3) x
    result of the same value, if x is NULL or not.
    If is cardstring for a single INSERT is simply:

    p_cardtype || '~' || p_cardvalue || '|'
    

    I guess ' ~' and ' |' are set the delimiters, in other words, there should always be a ' ~' after each cardtype and it should alays be a ' |' after each cardvalue.

    When I get another set of input parameters for custname even as Tracy, VISA, 123456789098
    So I have to add the above already existing like this:

    MASTERCARD~098765432123|VISA~123456789098|
    

    Please advice.

    So, you want to just conctentate something at the end of cardstring. The way to do that is

    cardstring || x
    

    where x is any string expression, including another | operation. So, you could do this:

    cardstring || p_cardtype || '~' || p_cardvalue || '|'
    

    Is there only one line per customer in custdetails? If so, you will not necessarily want to INSERT new rows into custdetails whenever you INSERT a row into cust. If you insert a new card for a former client cust, I suspect you will want to UPDATE custdetails, rather than INSERT another line in it. Using MERGE to perform an UPDATE or an INSERT, depending on whether a line already exists or not. If you are not familiar with the MERGER, search for it in the Manual of the SQL language , like other DML statements, FUSION works the same in PL/SQL, as in SQL.

    In addition, each line Cust represents his own credit card? If so, is cust really the best name for this table?

    What would happen if you REMOVE a line from the cust?
    Is it possible that 2 rows in cust may have the same custname, cardtype and cardvalue? If so, what would you like in custdetails? Include an example or two when you post the sample DML statements and results.

    Published by: Frank Kulash, 13 December 2012 17:17

Maybe you are looking for

  • Qosmio G30 - keyboard shown on display

    Hi, I think funny on my G30. From the start the display have keyboard brands, also a line from the base of the keyboard. It is no longer visible... Have someone simillar experience? Hana

  • Funky producer/consumer behavior

    If it's a weird thing... I have a loop of producer/consumer taken (especially) of the labview model is based. For some reason when I click on the button stop to stop the program, instead he wants to run through the case of default (shown in picture)

  • With the help of HP Support Assistant (Windows 8)

    Hey guys,. I know that some of you are new to Windows 8. I want to remind you that windows 8 has the same function (HP Support Assistant) your laptop last was if you own one. If you don't that is fine I'll show you what I mean HP Support Assistant is

  • express mail Outlook - sending 16 copies of each email

    When I send a picture or messages, it sends copy 16? down load antiviruse scanning whole c.p found nothing [3: 00 scanner] what can I do to stop this [outlook express] to down load Paolo cleaner / you can call: say that they can help me, but I have t

  • Drive C does not appear in the computer management window.

    Hello In the window of the computer storage management > disk management, I have see my drive C. CD - DVD drive and an external DVD drive only is displayed. C drive is not there. When I look under the disk defragmentation, the C drive is. What gives?