XMLFOREST: Generate Grand Parent using XMLFOREST nested tag

Need to generate a fragment of my XML file in the following XML format:


- <CurrentAddress>

< Unformated >

< Address > 67, FARRELL ST, OUYEN, VIC, 3490 < /adresse>

<DPID>14602550</DPID>

< / Unformated >

< /CurrentAddress >

But my requirements are If < address > and < DPID > have the value NULL, the code should return nothing at all.

Tried several combinations using XMLFOREST but couldn't get pat ERRORS like "is missing a left parenthesis" or "parameter 1 of"XMLFOREST function must be an alias '


Tried:


SELECT XMLFOREST

(XMLFOREST

(XMLFOREST (mailing_addr AS 'Address' ))

                                          ,dp_id        AS  "DPID")

) AS "not formatted".

)AS "CurrentAddress"

Address

Any help would be appreciated.

(Sorry for the use of "BOLD", just to make it more readable).

See you soon!

Rahul

You do not have to use XMLForest.

This requirement could be easily resolved with a simple CASE expression and XMLElement.

Anyway, you were close, the alias for the 2nd XMLForest is missing (or there is a misplaced bracket, depending on your point of view):

SQL > set long 5000

SQL > set lines 200

SQL >

SQL > with address (mailing_addr, dp_id))

2 Select ' 67, FARRELL ST, OUYEN, VIC, 3490', '14602550' from dual union all

3. Select "," dual Union all

4. Select '67, FARRELL ST, OUYEN, VIC, 3490', "the double

5)

6. Select xmlforest)

7 xmlforest)

XMLFOREST 8)

9 mailing_addr as "address".

10, dp_id as "DPID".

11             )

12 as "not formatted".

13           )

14 as 'CurrentAddress '.

(15) as xml_fragment

16 address;

XML_FRAGMENT

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

67,FARRELL ST,OUYEN,VIC,3490
14602550

67,FARRELL ST,OUYEN,VIC,3490

Or, as said, using an expression BOX:

Select case when mailing_addr is not null

or dp_id is not null

then xmlelement ("CurrentAddress"

xmlelement "(not formatted

xmlforest)

mailing_addr as "address".

, dp_id as "DPID".

)

)

)

end

address;

Tags: Database

Similar Questions

  • Anyone use the &lt; cfdocument &gt; tag with a &lt; cfloop &gt;

    Anyone use the < cfdocument > tag with a < cfloop >

    I'm generating more documents like this.

    < cfloop query = "myquery" >

    < cfdocument type = pdf >

    < html >... .HTML code here... < html >

    < / cfdocument >

    < / cfloop >

    But only the first document is generated in the browser?



    My requirement that I want to create multiple PDF and publish to folder and zip folder so that the user can able to download the ZIP file


    Thanks in advance

    My requirement that I want to create multiple PDF and publish to folder and zip folder so that the user can able to download the ZIP file

    (1) create a folder named, say, docsDir, in the current directory.

    (2) create PDF files, using suggestion of Eddie Lotter, name each file dynamically and store them in the folder docsDir.

    Insert here the code to generate the content of #filename # .

    (3) zip file, docsDir, store the resulting file, docsDir.zip, in the current directory.

  • Streaming mp3 using the Audio tag does not work in the app, while working in the browser

    Hello

    I fight with this problem on the second day and still can not get it to work.

    I'm on Soundcloud mp3 streaming and all works in Wellington and the browser on the device, he refuses to work in the application.

    -Do you have someone at - it had the similar problem?

    -Have you had a chance to make the streaming solution work in app?

    -It could be cause by the fact that Soundcloud uses a 302 redirect to a temporary URL?

    Thanks in advance

    I think that the redirect can be a problem. It works if you choose a url that links directly to a stream for example

    http://AUDIO1.ideastream.org/wcpn64

    Have you tried? I used the audio tag to read feeds with success on OS6 and OS7. On OS6 was a problem of the CBC, but the original CBC played yet.

  • Generate class files using the WSDL url and wsimport

    I am trying to create a java application that hits the service exposed by hub.

    To create the application in java, I'm generating class files using the WSDL that is created and exposed by the hub.

    Executed steps:

    1 created an application in OPA.

    2. deployed on the hub (usinf deploy option of snapshot on Policy Modeling)

    3. in the deployment tab, I see the request and get the url of the wsdl by clicking on it.

    I try on this wsdl wsimport command. But it gives me following error messages.

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

    C:\***\AllFiles > wsimport http://localhost:7001/hub/determinations-Server/assess/SOAP/generic/12.2/AttemptOne?WSDL

    the analysis of WSDL...

    [ERROR] invalid WSDL http://localhost:7001/hub/determinations-Server/assess/SOAP/generic/12.2/AttemptOne?WSDL , expected {http://schemas.xmlsoap.org/wsdl/} html (line 2) data definitions

    Cannot read the WSDL document: ( http://localhost:7001/Hub/determinations-Server/assess/SOAP/Generic/12.2/AttemptOne?WSDL , because 1) did not find the document. (/ 2) the document could not be read. (3) the element the document root is not < wsdl:definitions >.

    [ERROR] WSDL:service is not found in the WSDL (s) provided:

    At least a WSDL with definition of at least one service must be provided.

    Unable to parse the WSDL file.

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

    If I store the wsdl file in a file on my local computer, and then run wsimport, it generates the classes very well.

    Can someone provide me with a way that I can generate the classes using the wsdl url and not the local file?

    Also, do I need to create a connection in the Connections tab on the hub?

    Thanks in advance.

    -Alain

    Looks like you could run in the user authentication when wsimport runs against the WSDL. Instead of the WSDL, its reception, the login page.

    The best way to work around this problem is perhaps what you do already - to obtain the wsdl and save them in a file.

    Another solution is to disable the restriction of connection to the Web Service API. You can do this in the menu on the users page (admin role can turn on and off.

    You can switch between a user and a password with the call of the WSDL file, but I don't know if its possible to do with wsimport

    See you soon

    Frank

  • Why I can't use the nested aggregate function?

    Hello Experts,

    Why I can't use the nested aggregate function? There is not an ora-00979 group by error of expression.

    Oracle Database 11 g Release 11.2.0.4.0 - 64 bit Production

    Select

       SUM (BOX WHEN (KSD_CREATEDATE BETWEEN TRUNC((KSD_CREATEDATE)) AND TRUNC(MIN(KSD_CREATEDATE)) +60) THEN 1  ELSE 0 END) AS col

    DE TABLE_3_4

    GROUP BY STC_FIRMANO

    Thank you

    GROUP BY will manage the SUM function, but the MIN is used incorrectly - use another SELECTION to get it, or work with only with a single line. Otherwise, you could do WITH... get the SUM of SELECT MIN...

  • How to split a string into several substrings parent using a delimiter

    Hello

    I am forced to split a string into several substrings parent using a delimiter.

    And insert these substrings in variuou of the columns of a table in a row.

    For example. The sting is: ABC * DEF * GHI * JKH *.

    where ' *' is the separator.

    Desired output:

    Col1 Col2 Col3 Col4 Col5

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

    JKH GHI ABC DEF (null)

    Could you please guide me how can I achieve this.

    Thank you

    Bogoss

    Hello Salim,

    Leave the thread for reference... got this excerpt:

    with t as

    (

    Select "c: its: hgfd:1:23" Str

    )

    Select

    REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 1, null, 1) col1

    , REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 2, null, 1) col2

    , REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 3, null, 1) col3

    , REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 4, null, 1) col4

    , REGEXP_SUBSTR (str, ' ([^:] *)(:|$)', 1, 5, null, 1) col5

    t;

    This code snippet works well, but for the fixed columns. Here are 5 predefined columns.

    But I need to have a logic that I can browse the string any No.. sometimes.

    For example. If I get 3 secondary channels of the parent chain... I need to insert into 3 columns.

    And if I get 6 strings under... I need to insert into 6 columns.

    Could you please help me develop a logic like that.

    I use Oracle database 10g.

    And the data are currently being collected on external table... but I can store in a variable or a column of a database table.

    Thank you

    Bogoss

  • Created screen scene generator can be used on a JSP web page?

    Hi all, friends, my question is simple: a created screen scene generator can be used on a JSP web page?

    tiny tutorial?

    Thank you

    jamiguel77 wrote:

    Hi all, friends, my question is simple: a created screen scene generator can be used on a JSP web page?

    tiny tutorial?

    Thank you

    It is a forum for General database. Not sure that many of those who work here would know JSP. Do a google search if you please.

    Aman...

  • Generator is not using the algorithms of "save for Web"?

    I use the generator for a while, but I noticed that the files are different in size and quality, so if I just saved for the web.

    It seems more like the generator uses "save under" two save files and not the "save for web" which is the standard for preparing files for the web and devices

    If anyone else has noticed that? can confirm?

    OK - generator does not use SaveForWeb, but uses instead a stand-alone library to save its image files.

  • Using jstl if tag inside the tag column ADF?

    Hi all

    I was wondering if its possible to use jstl if tag within a column of table ADF to determine what values to display? Basically, I want to display different output depending on whether there is a value of row.binding.
     <af:column headerText="Some Command" id="c14">
                  <c:if test="${row.bindings.settingValue.inputValue}">
                        <af:outputText value="#{row.bindings.settingValue.inputValue}"id="ot7"/>
                  </c:if>
                  <c:if test="${row.bindings.pbSettingValue.inputValue}">
                         <af:outputText value="#{row.bindings.pbSettingValue.inputValue}" id="ot8"/>
                  </c:if>
    </af:column>
    JDev: 11.1.1.62

    Thank you
    -Wraith

    Published by: wraith101 on November 13, 2012 10:36

    You can use an af:switcher for this. Check out http://m.youtube.com/#/watch?v=tMuZJvU5eTk&desktop_uri=%2Fwatch%3Fv%3DtMuZJvU5eTk&gl=DE

    Timo

  • How to add the fragment in jsf using page add tag to jdeveloper

    Hi all
    Can you tell me wat is use the syntax: tag .or how to add the fragment in the jsf page...

    Published by: 947228 on July 18, 2012 05:01

    Hello

    Why do you do this?

    Check [url https://blogs.oracle.com/jheadstart/entry/avoid_use_of_jspinclude_where] this out before continuing.

    BTW, always mention your version JDev, varnish usecase for assistance.

    Arun-

  • I want to use a div tag or another to hide a video flash on my web site

    Hi, I have same video flash for many of my web pages. I'm trying to use the div tag to hide the header when it is not necessary. but it works only broser Firefox not IE. Here's what I did

    Is the above correct? What is the best way to do it?

    < div class = "wrapper" > < div class = "overlay" > african < / div > < span class = "blok_header" >

    < object classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase ="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8, 0,0,0" width = "94%" height = "97%" id = "main" align = "middle" >

    < param name = "allowScriptAccess" value = "sameDomain" / >

    < param name = "movie" value = "main.swf" / > "

    < param name = "quality" value = "high" / >

    < param name = "scale" value = "noborder" / >

    < param name = "salign" value = "t" / >

    < param name = "bgcolor" value = "#ffffff" / >

    < embed src = "main.swf" quality = "high" scale = "noborder" salign = "t" bgcolor = "#ffffff" width = "900" height = "600" name = align 'main' = 'left' allowscriptaccess = "sameDomain" type = "application/x-shockwave-flash" pluginspage ="http://www.macromedia.com/go/getflashplayer" / >

    < / embed >

    < / object >

    </span >

    < / div >

    Thank you

    What I'm saying is, the flash video has a header with a button. I want to permanently hide the part containing the header. The user will never see it. I use the div I want to replace my menu in the header bar. Diving ovelay will contain my Web site menu. When I do, it works great on firefox, but on Internet Explorer, my menu is behinf and usercan see the flash header.

    The parameters of Divs are:

    Wrapper {}

    position: relative;

    height: 600px;

    Width: 900px;

    Top: 0px;

    padding: 0px;

    margin: 0px;

    }

    . Overlay {}

    background-color: #CCC;

    position: absolute;

    height: 98px;

    Width: 900px;

    Top: 0px;

    margin: 0px;

    padding: 0px;

    border-bottom-width: medium;

    border-bottom-style: solid;

    border-bottom-color: #999;

    border-right-color: #999;

    border-bottom-color: #999;

    border-left-color: #999;

    }

    Flash video setting. It is imbaded in the Wrapper Div

    http://fpdownload.Macromedia.com/pub/Shockwave/cabs/Flash/Swflash.cab#version=8, 0,0,0 "width ="94% "height ="110% "id ="main"align ="middle">

    http://www.Macromedia.com/go/getflashplayer"/ >

  • the use of div tags more than necessary?

    Is there a downside to the use of div tags more than necessary?
    The size of the file is probably negligible. Are there problems with accessibility?

    .oO (jameswoody)

    > Is there a downside to the use of div tags more than necessary?

    This is an inefficient and bloated code.

    > The size of the file is probably negligible. Are there problems with accessibility?

    N °

    Micha

  • By using a nested as a data source in a cursor query table?

    Hi all

    Can you please let me know if we can use a nested table created locally as a source of data in a query of cursor?

    I'm doing using the following logic, but on compliation failure with the error: "PL/SQL: ORA-00942: table or view does not exist.

    =================================================================================================

    DECLARE

    N_table_outage_dates TYPE IS an ARRAY OF DATE;
    nt_out n_table_outage_dates: = n_table_outage_dates();

    l_outage_date DATE;

    cursor l_temp_cursor is
    SELECT DISTINCT APS. VENDOR_ID
    OF AP_SUPPLIERS APS
    WHERE
    (
    Trunc (APS. BUS_CLASS_LAST_CERTIFIED_DATE) + To_Number (FND_PROFILE. Value('POS_BUS_CLASS_RECERT_PERIOD'))
    = Trunc (l_outage_date) + To_Number (FND_PROFILE. Value('POS_BUS_CLASS_RECERT_REMIND_DAYS'))
    AND l_outage_date IN (SELECT * FROM nt_out );

    BEGIN

    l_outage_date: = SYSDATE;

    FOR I IN 1.7 LOOP

    nt_out. EXTEND;
    nt_out (i): = l_outage_date;
    l_outage_date: = l_outage_date + 1;

    END LOOP;

    Open l_temp_cursor

    -other logic

    close l_temp_cursor;

    END

    =================================================================================================

    The other will be passing the value of 'l_outage_date' to a cursor in a loop and then storing the multiple outputs of the query in a separate table / v-table but it will lead to duplicated being filled, elements that will need some work to do.

    Please let me how can know I use the nested table created by user in the query cursor running regarding the above code? Is the statement to go wrong anywhere nested table?

    Thank you
    Sylvain

    You currently have

    TYPE n_table_outage_dates IS TABLE OF DATE;
    nt_out n_table_outage_dates := n_table_outage_dates();
    

    He declares nt_out as a type of PL/SQL... the engine SQL (the place that runs queries) can not understand / interpret what it is, because it is declared in a PL/SQL it is not inherited in any way in SQL.

    So you must either create the type in SQL as I showed earlier OR (now that we know your version) get grants on the object laid down by Solomon.

    AND THEN, you need to change

    (SELECT * FROM nt_out );
    

    TO

    (SELECT * FROM TABLE(CAST(nt_out as DEPENDS_ON_WHICH_OBJECT_YOU_CHOOSE_TO_USE) );
    

    As I mentioned earlier in my example.

    Published by: Tubby on December 23, 2009 11:23

  • Next in a table using the nested

    Hi all

    I have a dilemma, and I don't know how to solve. I use a nested table. I loaded the data from a table in the current collection. Now, I want to go to each line of the collection and some operations.
    I used the following statement:

    because me in 1... Tab.Count loop
    / * operations * /.
    end loop;

    The operations section contains a test, some time... loop condition and I need to be able to move to the next line of the collection while staying in this condition as:
    all in tab (i) .field1 = v_var loop
    ...
    Tab.Next;
    end of loop

    I tried to use then, but it doesn't work like that. Any ideas how do I do this?

    Thank you
      idx := tab.next (idx);
    
  • DRM formula to generate a Parent; Need 2 round help

    Hello world

    TFDC and Denzz have been kind enough to help me solve one of my problems with the other day.  Here is some information.

    Hi people,

    I need business which is quite complex.  I'll try to explain it the best I can to please reach out if you need more details.

    Here is my mock up, I did:

    "

    The structure on the left is my current hierarchy.  The structure on the right, this is what I want the new Parent/child relationship to look like.  Now, you may ask why I don't make this new structure? The reason is the company is unwilling to add any additional hierarchies, so I have to use attributes to generate this outcome (export), which will be transferred to a target system.

    Things to consider:

    IND-members will NOT be included in this new structure

    All PFI-members shall a PFC-parent, as shown in the right structure. The parent of PFC is created prefixing 'PFC -' the first set of 5 numbers after the first '-' symbol in the PFI member. The string after the second '-' symbol in the PFC parent is set back 2 levels (the PFI member) and grabbing the chain after the first "-" symbol.

    So, basically, the members of the PFC will be at the same level as the current Independent members.

    Please let me know if this is even possible? If so, what attributes do I need? Thanks to you all! Looking forward to your answers! Evil begins to take a crack at it on my end.

    SOLUTION! :


    TFDC suggested the following syntax for a formula (Custom.TA) and it worked perfectly!


    If (Equals (String, SUBSTRING (ABBREV (), 1, 3), PFI), Concat (PFC, SUBSTRING (ABBREV (), 4, 7), SUBSTRING (ParentPropValue (Core.parent), 4, 100)), if (Equals (String, SUBSTRING (ABBREV (), 1, 3), IND), PropValue (Core.parent)))


    QUESTION:


    So it works perfectly, and I replaced this derived formula in for the "Parent Node" attribute in my export.


    Everything works, except for PFC was now generated in the above formula and then put under the Parent node, I'm unable to add an alias, as it does not lie in the name column:


    REQUIREMENT:

    Now I think I need to create a new derived 'name' property to take care of this, but I don't know where to start. Ideas or workarounds?  Thank you, everyone!

    The formula TA_Name is incorrect-

    Current

    If (and (Equals (String, SUBSTRING (ABBREV (), 1, 4), IND-), GreaterThan (PropValue (Core.Children), 0, Integer)), ListNodePropValues (ListChildren (), [comma],Custom.ParentTest), Abbrev())

    Should be

    If (and (Equals (String, SUBSTRING (ABBREV (), 1, 4), IND-), GreaterThan (PropValue (Core.Children), 0, Integer)), ListNodePropValues (ListChildren (), [comma],Custom.TA_Parent), Abbrev())

    Parent_Test was my property, you should have your property parent instead.

    Thank you

    Denzz

Maybe you are looking for

  • email confusion

    I'm confused by email on my Ipad Air... some of the numbers of phone come to gray instead of blue and I can't send a message. This only happens on my Ipad... Although on my Iphone they all come in blue. Why would he be thgis? Also what is the differe

  • Leave phone when inserting the SD card?

    Hello - someone ' one might say pleading that you leave the phone on when you add a card micro sd, or do you turn it off? Also, you get a signal that it is work/installed/added? Thank you very much!

  • Writing table to the selected line in the table table

    Hello im stuck on trying to display a line of data that I took from an excel file. display just the data on an array of table has no problem, BUT when I use the Index table and Replace the function subset of table, no data out. so, Table3 has the dat

  • Data NOR 6561: 36 MHz clocked

    Hello I need to send/receive the LVDS data from/to a product. Data must be clocked at 36 MHz and the clock will have in the product. Can you confirm that if I use a PCI-6561: -J' I need a 36 MHz external clock, connected to the jack IN CLK (clock edg

  • Control Panel more HP Officejet Pro 8600 not lit and will not work

    Control Panel more HP Officejet Pro 8600 not lit and will not work. It worked except the last 4 days. I can use certain features of the computer as a scan but can not manually use Control Panel. Nothing DOES not illuminate. The power button is on but