XML QUERY returning no values

I have the following. I can not all the values of the meldeblatt node.

DECLARE

CLOB donnees_xml

: = ' < ? XML version = "1.0" encoding = "UTF-8"? >

< oestat gemeinde = "612" version = "1" >

< betriebnr betrieb "4" = >

< meldeblatt mblattnr = bearbeiter '51356' = 'ATLAS' ankunft = abreise '2015-04-21' = '2015-04-22' abgeplant = '2015-04-22' reisegruppe = "0" >

< landschl lschlnr = "0" anzpers = "4" / >

< gastart gastart = "N" anzpers = "1" / >

< gastart gastart = 'F' anzpers = '3' / >

< gast gastlfdnr = '1' gasttyp = vorname "HG" = "Jim" name = "Smith" gebdatum = "1974-06-03" sex = '2' herkunftsland = '0' strasse = 'Dorfstrasse 3' strasse2 = "' nation = tro"UEA"="Fluehli"= please"6173"staatsang ="UEA"/ >"

< gast gastlfdnr = '2' gasttyp = vorname 'KI' = 'John' name = "Smith" gebdatum = '2007-03-30' sex = '0' herkunftsland = '0' strasse = 'Dorfstrasse 3' strasse2 = "' nation = tro"UEA"="Fluehli"= please"6173"staatsang ="UEA"/ >"

< gast gastlfdnr = '3' gasttyp = «KI» vorname = 'Jane' name = "Smith" gebdatum = '2011-09-19' sex = '0' herkunftsland = '0' strasse = 'Dorfstrasse 3' strasse2 = "' nation = tro"UEA"="Fluehli"= please"6173"staatsang ="UEA"/ >"

< gast gastlfdnr = "4" gasttyp = vorname 'KI' = 'Henry' name = "Smith" gebdatum = '2009-12-11' sex = '0' herkunftsland = '0' strasse = 'Dorfstrasse 3' strasse2 = "' nation = tro"UEA"="Fluehli"= please"6173"staatsang ="UEA"/ >"

< / meldeblatt >

< / betrieb >

< / gemeinde > ';

BEGIN

I'm

IN (SELECT lschlnr

ankunft

abreise

abgeplant

bearbeiter

landschl

x2.gastlfdnr

x2.strasse

FROM XMLTABLE ("gemeinde/betrieb"

PASSAGE xmltype (donnees_xml)

Lschlnr of VARCHAR COLUMNS (2000) PATH 'andschl/@lschlnr '.

, ankunft VARCHAR2 (200) PATH 'meldeblatt/@ankunft '.

, abreise VARCHAR2 (200) PATH 'meldeblatt/@abreise '.

, abgeplant VARCHAR2 (200) PATH 'meldeblatt/@abgeplant '.

, bearbeiter VARCHAR2 (200) PATH 'meldeblatt/@bearbeiter '.

, landschl VARCHAR2 (200) PATH 'meldeblatt/landschl/@lschlnr '.

XMLTYPE PATH "meldeblatt" gastinfo) xm

XMLTABLE)

'meldeblatt '.

PASSAGE gastinfo

COLUMNS strasse2 VARCHAR2 (2000) PATH ' / gast/@strasse2'

, gastlfdnr VARCHAR2 (2000) PATH ' / gast/@gastlfdnr'

, strasse VARCHAR2 (2000) PATH ' / gast/@strasse'

(x 2))

LOOP

Dbms_output.put_line ('lschlnr->'

|| i.lschlnr

|| "ankunft->.

|| i.Ankunft

|| "abreise->.

|| i.Abreise

|| "gastlfdnr->".

|| i.gastlfdnr

|| "Straße->.

|| i.Strasse

);

END LOOP;

END;

The problem is this part:

strasse2 VARCHAR2 (2000) PATH ' / gast/@strasse2'

From the PATH expression a slash device 'find the gast node at the root of the context item', but here the context item is the 'meldeblatt' node, so the path expression target no node.

The other problem is that step 'gast' should be in the main XQuery expression, if you want to iterate through the sequence of nodes 'gast '.

This should be what you want:

...

XMLTABLE)

' / meldeblatt/gast.

PASSAGE gastinfo

PATH of COLUMNS strasse2 VARCHAR2 (2000) '@strasse2 '.

, gastlfdnr PATH VARCHAR2 (2000) '@gastlfdnr '.

, strasse PATH VARCHAR2 (2000) '@strasse '.

) x 2

Tags: Oracle Development

Similar Questions

  • reload the page when SQL query returns a value

    Hello world

    the title of this discussion may seem strange, but I'll try to explain why I need this:

    A user has the ability to connect on my APEX application. There are several tabs in my application that are visible only if a certain SQL statement returns a value which is not the case by default. The user has also the ability to download a file that is transferred to an external system that analyzes the file and writes the data in the database. During this writing process - which may take several minutes - conditions for some of the tabs to show the will becomes real (-> the query will return a value). When the user refreshes the page manually, the tabs will be displayed. However, I want the tabs will appear automatically when the condition is met.

    Is it possible to refresh the page as soon as the query returns a value? It is perhaps possible to check it on the client side and trigger a refresh of the page when the condition is met. It would be even better if only the tabset has been updated, but refreshing the full page is fine as well.

    Thank you!

    Here is an overview of how it can be done

    This is possible thanks to a dynamic action being performed on a timer.

    View default tabs and dynamic action hide them on loading the page if they are not to be considered

    Create a dynamic action that will execute your query every 5 seconds or more

    If the query returns data, you can use the dynamic action to show your tabs using javascript

  • XML Query, returning null - matter of possible namespaces

    I have the following XML
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <s:Body>
          <CodesByTypeResponse xmlns="urn: WA.Ecy.ADS.CombinedCode.Services">
             <CodeList xmlns:a="http://schemas.datacontract.org/2004/07/WA.Ecy.ADS.CombinedCode.Service.DataAccess" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>116</a:CombinedCodeId>
                   <a:CombinedCodeValue>01</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>ADAMS</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>117</a:CombinedCodeId>
                   <a:CombinedCodeValue>02</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>ASOTIN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>118</a:CombinedCodeId>
                   <a:CombinedCodeValue>03</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>BENTON</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>119</a:CombinedCodeId>
                   <a:CombinedCodeValue>04</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>CHELAN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>120</a:CombinedCodeId>
                   <a:CombinedCodeValue>05</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>CLALLAM</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>121</a:CombinedCodeId>
                   <a:CombinedCodeValue>06</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>CLARK</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>122</a:CombinedCodeId>
                   <a:CombinedCodeValue>07</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>COLUMBIA</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>123</a:CombinedCodeId>
                   <a:CombinedCodeValue>08</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>COWLITZ</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>124</a:CombinedCodeId>
                   <a:CombinedCodeValue>09</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>DOUGLAS</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>125</a:CombinedCodeId>
                   <a:CombinedCodeValue>10</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>FERRY</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>126</a:CombinedCodeId>
                   <a:CombinedCodeValue>11</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>FRANKLIN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>127</a:CombinedCodeId>
                   <a:CombinedCodeValue>12</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>GARFIELD</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>128</a:CombinedCodeId>
                   <a:CombinedCodeValue>13</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>GRANT</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>129</a:CombinedCodeId>
                   <a:CombinedCodeValue>14</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>GRAYS HARBOR</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>130</a:CombinedCodeId>
                   <a:CombinedCodeValue>15</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>ISLAND</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>131</a:CombinedCodeId>
                   <a:CombinedCodeValue>16</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>JEFFERSON</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>132</a:CombinedCodeId>
                   <a:CombinedCodeValue>17</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>KING</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>133</a:CombinedCodeId>
                   <a:CombinedCodeValue>18</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>KITSAP</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>134</a:CombinedCodeId>
                   <a:CombinedCodeValue>19</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>KITTITAS</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>135</a:CombinedCodeId>
                   <a:CombinedCodeValue>20</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>KLICKITAT</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>136</a:CombinedCodeId>
                   <a:CombinedCodeValue>21</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>LEWIS</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>137</a:CombinedCodeId>
                   <a:CombinedCodeValue>22</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>LINCOLN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>138</a:CombinedCodeId>
                   <a:CombinedCodeValue>23</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>MASON</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>139</a:CombinedCodeId>
                   <a:CombinedCodeValue>24</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>OKANOGAN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>140</a:CombinedCodeId>
                   <a:CombinedCodeValue>25</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>PACIFIC</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>141</a:CombinedCodeId>
                   <a:CombinedCodeValue>26</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>PEND OREILLE</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>142</a:CombinedCodeId>
                   <a:CombinedCodeValue>27</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>PIERCE</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>143</a:CombinedCodeId>
                   <a:CombinedCodeValue>28</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>SAN JUAN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>144</a:CombinedCodeId>
                   <a:CombinedCodeValue>29</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>SKAGIT</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>145</a:CombinedCodeId>
                   <a:CombinedCodeValue>30</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>SKAMANIA</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>146</a:CombinedCodeId>
                   <a:CombinedCodeValue>31</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>SNOHOMISH</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>147</a:CombinedCodeId>
                   <a:CombinedCodeValue>32</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>SPOKANE</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>148</a:CombinedCodeId>
                   <a:CombinedCodeValue>33</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>STEVENS</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>149</a:CombinedCodeId>
                   <a:CombinedCodeValue>34</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>THURSTON</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>150</a:CombinedCodeId>
                   <a:CombinedCodeValue>35</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>WAHKIAKUM</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>151</a:CombinedCodeId>
                   <a:CombinedCodeValue>36</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>WALLA WALLA</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>152</a:CombinedCodeId>
                   <a:CombinedCodeValue>37</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>WHATCOM</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>153</a:CombinedCodeId>
                   <a:CombinedCodeValue>38</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>WHITMAN</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
                <a:CombinedCodeEntity>
                   <a:CombinedCodeId>154</a:CombinedCodeId>
                   <a:CombinedCodeValue>39</a:CombinedCodeValue>
                   <a:CombinedCodeDescription>YAKIMA</a:CombinedCodeDescription>
                   <a:CombinedTypeCodeId>7</a:CombinedTypeCodeId>
                   <a:IsActiveFlag>true</a:IsActiveFlag>
                   <a:CreatedDate>2009-03-04T17:55:13.943</a:CreatedDate>
                   <a:ModifiedByName>CombinedCodeSSIS</a:ModifiedByName>
                   <a:ModifiedDate>2009-03-04T17:55:13.943</a:ModifiedDate>
                   <a:CreatedByName>CombinedCodeSSIS</a:CreatedByName>
                </a:CombinedCodeEntity>
             </CodeList>
          </CodesByTypeResponse>
       </s:Body>
    </s:Envelope>
    I'm recovering the value of Code and Description.

    I am using the following query - where the get_combined_Code function returns the above XML code
    select x.*
    from (
    select facsite_pkg.get_combined_code('county') xml from dual) t, 
    xmltable(xmlnamespaces('a' as "a"),
    '//a:CombinedCodeEntity' passing t.xml.extract('//a:CombinedCodeEntity',
      'xmlns:a="http://schemas.datacontract.org/2004/07/WA.Ecy.ADS.CombinedCode.Service.DataAccess" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"')
    columns code_id varchar2(10) path 'a:CombinedCodeValue',
    code_description varchar2(100) path 'a:CombinedCodeDescription') x
    This query returns no records.

    I first tried this without the namespace clause, but this failed with the error: ORA-19228: XPST0008 - undeclared identifier: 'a' local-name of the prefix ' a: CombinedCodeEntity'

    I also tried to make the namespace clause
     xmlnamespaces('urn:WA.Ecy.ADS.CombinedCode.Services' as "a") 
    but the end result is the same.

    Any thoughts on where things have gone wrong?

    Thank you, Tony

    use:

    xmlnamespaces('http://schemas.xmlsoap.org/soap/envelope' as "s",
                           'http://schemas.datacontract.org/2004/07/WA.Ecy.ADS.CombinedCode.Service.DataAccess' as "a")
    

    Amiel

  • XML query returns empty when tags no data

    Hi all

    I have a problem that I can't solve.

    I have the following query:
     select
                xmlelement
                (
                   "users",
                   xmlagg
                   (
                      xmlelement
                      (
                         "user",
                         xmlelement
                         (
                            "username",
                            e.pin
                         ),
                         xmlagg
                         (
                            xmlelement
                            (
                               "details",
                               xmlforest
                               (
                                  e.password as "password"
                                 ,e.first_name as "forename"
                                 ,e.surname as "surname"
                                 ,'0' as "retired"
                                 ,e.email_address as "email"
                                 ,e.telephone_number as "phone"
                                 ,'No External Ref' as "externalRef"
                                 ,add_months(sysdate,+60) as "expiryDate"
                               )
                            )
                         )
                      )
                   )
                ) xml_out
             from   aqaost_examiners e
             group by e.pin;
    The query returns the XML code in the desired structure.

    But the problem I have is that when there is no data found by the query, I always get a single row returned by the following: < user > < / users >

    I tried so many things to try to have the query return nothing if there is no data available, but I can't do without something else goes wrong (to mess up the XML structure, etc.).

    Please is - can anyone help or point me in the right direction?

    I thank very you much in advance!

    Robin

    Hello

    Peter,

    This is the GROUP that does this.

    Actually no, the GROUP BY refers to the deepest XMLAgg and is required if e.pin is not unique.

    Let it out, and you also seem to have of many XMLAGG (?)

    That's assuming that e.pin is unique within the table (which is probably a fair assumption in this case).

    In fact, the behavior comes from the XMLAgg in the foreground:

    SQL> select xmlelement("users",
      2           xmlagg(
      3             xmlelement("user",
      4               xmlelement("username", e.empno)
      5             , xmlelement("details",
      6                 xmlforest(
      7                   e.ename as "name"
      8                 , e.job as "job"
      9                 )
     10               )
     11             )
     12           )
     13         ) xml_out
     14  from scott.emp e
     15  where 1 = 0
     16  ;
    
    XML_OUT
    -------------------------------------
    
     
    

    As with other global functions (such as SUM or AVG) adding a GROUP OF 'something' solves the problem:

    SQL> select xmlelement("users",
      2           xmlagg(
      3             xmlelement("user",
      4               xmlelement("username", e.empno)
      5             , xmlelement("details",
      6                 xmlforest(
      7                   e.ename as "name"
      8                 , e.job as "job"
      9                 )
     10               )
     11             )
     12           )
     13         ) xml_out
     14  from scott.emp e
     15  where 1 = 0
     16  group by null
     17  ;
    
    no rows selected
    

    Robin,
    So the more intimate XMLAgg is really necessary, you can use a subquery:

    select xmlelement("users", v.users)
    from (
      select xmlagg(
               xmlelement("user",
                 xmlelement("username", e.empno)
               , xmlagg(
                   xmlelement("details",
                     xmlforest(
                       e.ename as "name"
                     , e.job as "job"
                     )
                   )
                 )
               )
             ) as users
      from scott.emp e
      group by e.empno
    ) v
    where v.users is not null
    ;
    
  • query return different values

    Hi all


    We have EBS 11.5.10.2 installed on solaris

    The Apps schema owns all objects and public synonyms created for all objects in the apps schema.

    now when I run the query of applications such as:

    Select * from PA_REP_UTIL_ORG_GE_V;

    get the error:

    ERROR on line 1:
    ORA-00600: internal error code, arguments: [kksfbc-analysis-infinite-loop],.
    [[0xFFFFFFFF7C7432B8], [] [] [], [], [],]



    Whereas, where sys is the same mark. She gives the value...

    also raised a SR with oracle and they said to apply a patch... but the question remains...


    Please notify

    Kai

    The request that we have in the crontab is given below. We reel to a sql and run the sql.

    Select 'Edit'. object_type | » '|| owner: '. ' || object_name |' compile;' of
    DBA_OBJECTS where object_name in (d_name select do.name)
    of sys.obj$, sys.dependency$, sys.obj$ po
    where P_OBJ #= po.obj #(+)
    and D_OBJ #= do.obj #.
    and do.status = 1
    and po.status = 1
    (and po.stime! = p_timestamp);

    HTH,
    http://borndba.com

  • sys_refcursor do not fetch any data, even if the query returns the value

    I use sys_refcursor to return the columns and aid below the procedure to do. Although the data are there in table_1 and table_2.

    PROCEDURE test_pro (abc_date N, DATE,
    cur_get_data ON sys_refcursor
    )

    OPEN cur_get_data
    for
    Select A.col1, B.col2
    from table_1 A
    where A.dis_date = abc_date
    left outer join
    table_2 B
    on
    A.dis_date = B.dis_date;

    IF cur_get_data % rowcount = 0
    then
    raise e_error;
    END if;

    EXCEPTION
    When e_error
    then
    -no_data_found;
    while others
    then
    -(giving an error with the SQL error code);

    END test_pro;


    When running under sql in the sql pl/sql developer window pick
    data
    Select A.col1, B.col2
    from table_1 A
    where A.dis_date = abc_date
    left outer join
    table_2 B
    on
    A.dis_date = B.dis_date;

    But while testing the test_pro in the test of the pl/sql Developer window, it is
    do not fetch all data and raise e_error every time

    is there a problem arising from the use IF cur_get_data % rowcount = 0 whenever that happens in the exception block.

    so can someone please put a few ideas what cud be the reason for this?
    PROCEDURE test_pro(abc_date IN DATE,
                       cur_get_data OUT sys_refcursor
                      ) is
    BEGIN
    
      OPEN cur_get_data for select A.col1,B.col2
                              from table_1 A
                             where A.dis_date = abc_date
                                   left outer join
                                   table_2 B
                                on A.dis_date = B.dis_date;
    
    /* while testing let exceptions just pop out
    EXCEPTION
    
      when no_data_found
      then
    ------no_data_found;
      when others
      then
    --------(giving SQL error with error code);
    */
    END test_pro;
    

    then you test as something like

    declare
    
      my_date   date := to_date('20120621','yyyymmdd');
      my_cursor sys_refcursor;
      col1      ... ;
      col2      ... ;
    
    begin
    
      test_pro(my_date,my_cursor);
    
      loop
    
        fetch my_cursor into col1,col2;
        exit when my_cursor%notfound;
        dbms_output.put_line(col1 || ' ~ ' || col2);
    
      end loop;
    
    end;
    

    Concerning

    Etbin

  • XML - ORA-19025: EXTRACTVALUE returns the value of a single node

    Hello

    I'm new to XML DB. Can someone help me with the below XML

    I use the following XML... (I pasted a part only of it coz I need data only up to this article)

    XML
    --------------------

    <? XML version = "1.0" encoding = "UTF-8"? > < SOAP - ENV:Envelope xmlns:SOAP - ENV = "http://schemas.xmlsoap.org/soap/envelope/" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-."
    example"container ="http://www.w3.org/2001/XMLSchema"> < SOAP - ENV:Body >
    < ns:PicklistWS_GetPicklistValues_Output xmlns:ns = "urn: crmondemand/ws/list dropdown /" >
    < ListOfParentPicklistValue xmlns = "urn: / xml/crmondemand/list of choices" >
    < ParentPicklistValue >
    < language > ENU < / language >
    < ParentFieldName > plProduct_Team < / ParentFieldName >
    < ParentDisplayValue > Marketing On Demand < / ParentDisplayValue >
    < ParentCode > Marketing On Demand < / ParentCode >
    < Disabled > N < / disabled >
    < ListOfPicklistValue >
    < PicklistValue >
    Escalation of OCP/SME < code > < code >
    Escalation of OCP/SME < DisplayValue > < / DisplayValue >
    < Disabled > N < / disabled >
    < / PicklistValue >
    < PicklistValue >
    Ask fusion < code > < code >
    Merge request < DisplayValue > < / DisplayValue >
    < Disabled > N < / disabled >
    < / PicklistValue >



    Code
    ---------




    SELECT distinct
    EXTRACTVALUE (value (SR), ' / ParentPicklistValue/ListOfPicklistValue/PicklistValue/Code ','xmlns = "urn: / crmondemand/xml/list of choices"') AS display.
    Return EXTRACTVALUE (value (SR),'/ ParentPicklistValue/ListOfPicklistValue/PicklistValue/DisplayValue ',' xmlns = "urn: / crmondemand/XML/picklist"'),.
    EXTRACTVALUE (value (SR), '/ ParentPicklistValue/ParentDisplayValue','xmlns = "urn: / crmondemand/XML/picklist"') AS parent_display,
    EXTRACTVALUE (value (SR), '/ ParentPicklistValue/ParentCode','xmlns = "urn: / crmondemand/XML/picklist"') AS parent_return
    TABLE (XMLSEQUENCE ((EXCERPT)
    WEB_SERVICE (' <? xml version = "1.0" encoding = "UTF - 8" standalone = "no"? > < envelope soap: xmlns:soap = "http://schemas.xmlsoap.org/soap/envelope/")
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" container = "http://www.w3.org/2001/XMLSchema" >
    < soap: Body >
    < PicklistWS_GetPicklistValues_Input xmlns = "urn: crmondemand/ws/list dropdown /" >
    Type < FieldName > < / FieldName >
    Service request < RecordType > < / RecordType >
    < / PicklistWS_GetPicklistValues_Input >
    < / soap: Body >
    "< / envelope soap: >.
    (' document / urn: crmondemand/ws/list dropdown /: ' GetPicklistValues, Id_de_la_session).
    "/: soap envelope / soap: Body / * / * / * ',' xmlns:soap ="(http://schemas.xmlsoap.org/soap/envelope/'))) SR "


    ERROR
    ---------

    ORA-19025: EXTRACTVALUE returns the value of a single node


    UNDERSTANDING
    ---------------------------

    As my Xpath only points until the node - ParentPicklistValue and not the child nodes under it. That's why, when I try to interview the child nodes - / ParentPicklistValue/ListOfPicklistValue/PicklistValue/Code, I get the error mentioned above.

    REQUIREMENT
    -----------------------

    Can someone help me to receive the values of the mother and child values based on xml and query above.

    Hello

    It's a classic ;)

    You need a second XMLSequence who shreds the collection of PicklistValue in relational lines:

    select extractvalue(value(sr2), '/PicklistValue/Code', 'xmlns="urn:/crmondemand/xml/picklist"') AS Display
         , extractvalue(value(sr2), '/PicklistValue/DisplayValue', 'xmlns="urn:/crmondemand/xml/picklist"') AS Return
         , extractvalue(value(sr1), '/ParentPicklistValue/ParentDisplayValue', 'xmlns="urn:/crmondemand/xml/picklist"') AS parent_display
         , extractvalue(value(sr1), '/ParentPicklistValue/ParentCode', 'xmlns="urn:/crmondemand/xml/picklist"') AS parent_return
    from table(
           xmlsequence(
             extract( WEB_SERVICE( ... )
                    , '/soap:Envelope/soap:Body/ns:PicklistWS_GetPicklistValues_Output/ListOfParentPicklistValue/ParentPicklistValue'
                    , 'xmlns="urn:/crmondemand/xml/picklist"
                       xmlns:ns="urn:crmondemand/ws/picklist/"
                       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' )
           )
         ) sr1
       , table(
           xmlsequence(
             extract( value(sr1)
                    , '/ParentPicklistValue/ListOfPicklistValue/PicklistValue'
                    , 'xmlns="urn:/crmondemand/xml/picklist"' )
           )
         ) sr2
    ;
    

    What is your version of the database BTW?
    10.2 and upward, you can use the XMLTable.

  • Query must return the values null

    Hi once again, everything

    The query below should return zero values for the date, but instead it brings back each transaction in the table, any ideas why?
    SELECT
    
    CID.transaction_id,
    MMT.ITEM_ORD PART_NUMBER,
    CID.DESCRIPTION,
    CID.TRANSACTION_TYPE_NAME,
    CID.LINE_TYPE_NAME,
    CID.SUBINVENTORY_CODE,
    MMT.TRANSACTION_QUANTITY,
    CID.BASE_TRANSACTION_VALUE TRANSACTION_VALUE,
    GLC.SEGMENT1,
    GLC.SEGMENT2,
    GLC.SEGMENT3,
    GLC.SEGMENT4,
    GLC.SEGMENT6,
    TO_CHAR (MMT.TRANSACTION_DATE, 'DD-MON-YY HH24:MI') transaction_date_and_time,
    TRUNC (MMT.TRANSACTION_DATE) transaction_date
    
    
    
    
    FROM
    
    CST_INV_DISTRIBUTION_DAV_V CID,
    MTL_MATERIAL_TXNS_VAL_V MMT,
    GL_CODE_COMBINATIONS GLC
    
    
    
    
    WHERE
    
    CID.TRANSACTION_ID = MMT.TRANSACTION_ID
    AND CID.REFERENCE_ACCOUNT = GLC .CODE_COMBINATION_ID;
    AND MMT.TRANSACTION_DATE = '26-AUG-11 22:00'

    Yes. It's true. You must use TO_DATE to convert a string to a date and you must use TO_CHAR to convert a date into a string.

  • DICOM metadata - extractvalue returns the value of a single node

    Hello

    I have difficulties in getting the value of the objects with repeated elements. Specifically, I need to get the value of spacing of pixels in the following excerpt from xml.
    <DICOM_OBJECT>
    ..
         <DECIMAL_STRING tag="00181063" definer="DICOM" name="Frame Time" offset="900" length="2">0.0</DECIMAL_STRING>
         <CODE_STRING tag="0018106A" definer="DICOM" name="Synchronization Trigger" offset="910" length="10">NO TRIGGER</CODE_STRING>
    ..
         <DECIMAL_STRING tag="00280030" definer="DICOM" name="Pixel Spacing" offset="1660" length="22">0.003562</DECIMAL_STRING>
         <DECIMAL_STRING tag="00280030" definer="DICOM" name="Pixel Spacing" offset="1660" length="22">0.003562</DECIMAL_STRING>
         <UNSIGNED_SHORT tag="00280100" definer="DICOM" name="Bits Allocated" offset="1690" length="2">8</UNSIGNED_SHORT>
        <UNSIGNED_SHORT tag="00280101" definer="DICOM" name="Bits Stored" offset="1700" length="2">8</UNSIGNED_SHORT>
    ..
    </DICOM_OBJECT>
    Normally, I use the following query to get the value of spacing of pixels:
     select EXTRACTVALUE(t.dicom.metadata
                          ,'/DICOM_OBJECT/*[@name="Pixel Spacing"]'
                         ,'xmlns=http://xmlns.oracle.com/ord/dicom/metadata_1_0')  scale_factor
       from my_dicom_object t
    It works, but not when there are two elements. Then I get the error: "ORA-19025: EXTRACTVALUE returns the value of a single node.


    All I really need is to get the value of the first node with the name of "spacing of pixels. Despite the many examples available to do with traditional xml paths, I was unable to find an example that makes using XPATH search strings rather than direct tag structure.

    Can someone give an example?

    Thank you!

    Published by: rcdev on August 10, 2009 15:20

    All I really need is to get the value of the first node with the name of "spacing of pixels.

    This? :

    select EXTRACTVALUE(t.dicom.metadata
                          ,'/DICOM_OBJECT/*[@name="Pixel Spacing"][1]'
                         ,'xmlns=http://xmlns.oracle.com/ord/dicom/metadata_1_0')  scale_factor
       from my_dicom_object t
    
  • Function return undefined values

    My function returns undefined values. It seems that the return of the function statement is executed before the database is queried and values are assigned to variables. If I do an alert within the loop for () I get the correct values from the database, but these values are not affected before excecuting the return statement function. How can I do this differently?

    function getColumnNames(table){
        var rs1, rs2, rs3, rs4, rs5;
        db.transaction(function (tx) {
            tx.executeSql("SELECT * FROM schema WHERE table_name=?",[table], function(ax, results){
                var size = results.rows.length, i;
                var item;
                for (i = 0; i < size; i++){
                    item = results.rows.item(i);
                    rs1 = item.col1;
                    rs2 = item.col2;
                    rs3 = item.col3;
                    rs4 = item.col4;
                    rs5 = item.col5;
                                    alert(rs1); //correct value is returned here
                }
            });
        });
        return [rs1, rs2, rs3, rs4, rs5];
    }
    

    Hey Fabian,.

    You are quite correct that the return statement is executed before the database returns the results. There are ongoing asynchronous calls. You can set breakpoints in JavaScript code to see what is happening. You can correct the problem by using function callbacks. I edited your code below to use the callback functions - there might be a few typos, but the general approach should be wooded.

    function getColumnNames(table, callback){
        var rs1, rs2, rs3, rs4, rs5;
        db.transaction(function (tx) {
            tx.executeSql("SELECT * FROM schema WHERE table_name=?",[table], function(ax, results){
                var size = results.rows.length, i;
                var item;
                for (i = 0; i < size; i++){
                    item = results.rows.item(i);
                    rs1 = item.col1;
                    rs2 = item.col2;
                    rs3 = item.col3;
                    rs4 = item.col4;
                    rs5 = item.col5;
                        alert(rs5); //correct values are being returned
                    callback([rs1, rs2, rs3, rs4, rs5]);
                }
            });
        });
    }
    
    // example of how to call getColumnNames with callback
    getColumnNames('importantTable', function (result)
    {
        console.log(result);
    });
    
    // alternative version
    function onCallback(result)
    {
        console.log(result);
    }
    
    getColumnNames('importantTable', onCallback);
    

    I hope this helps.

    See you soon,.

    James

  • Add a string when the query returns all records

    DB version: 11.2

    create table t (empname varchar2 (25), salary number, varchar2 (20) months, number of over_time);

    insert into values t ('JOHN', 2000, "NOVEMBER2014", 0);

    insert into values t ('KATE', 2000, "NOVEMBER2014", 300);

    insert into values t ('HANS', 5000, "NOVEMBER2014", 100);

    insert into values t ("KRISHNA", 2500, "NOVEMBER2014", 0);

    insert into values t ("SIEW", 3000, "NOVEMBER2014", 0);

    commit;

    SQL > select * from t;

    EMPNAME MONTHS SALARY OVER_TIME

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

    JOHN 2000 NOVEMBER2014 0

    KATE 2000 NOVEMBER2014 300

    HANS 5000 NOVEMBER2014 100

    KRISHNA 2500 NOVEMBER2014 0

    SIEW 3000 NOVEMBER2014 0

    SQL > select * from t where MONTH = 'NOVEMBER2014' and OVER_TIME! = 0 ;

    EMPNAME MONTHS SALARY OVER_TIME

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

    KATE 2000 NOVEMBER2014 300

    HANS 5000 NOVEMBER2014 100

    What I need is:

    If the query above returns at least one record, it should display the line ' Yes. We have one or more employees who worked overtime in November2014'

    before the documents are printed

    Thus, the expected production is

    Yes. We have one or more employees who worked overtime at the November2014

    EMPNAME MONTHS SALARY OVER_TIME

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

    KATE 2000 NOVEMBER2014 300

    HANS 5000 NOVEMBER2014 100

    If the query returns no records then usual 'no rows selected' isn't enough

    Lothar G.f. says:

    In fact, sql * more is no good tool for use considered.

    Really?  It may be a good reporting tool if you learn to use it as such...

    for example

    SQL > ttitle left 'Yes. We have one or more employees who worked overtime in November2014.
    SQL > select * from emp where empno = 1234;

    no selected line

    SQL > select * from emp where empno = 7788;

    Yes. We have one or more employees who worked overtime at the November2014
    EMPNO, ENAME, JOB HIREDATE DEPTNO COMM SAL MGR
    ---------- ---------- --------- ---------- -------------------- ---------- ---------- ----------
    7788, SCOTT, ANALYST, 7566 19 APRIL 1987 00:00:00 3000 20

    This is just a basic example.  It is possible to get SQL * more to ask for the required criteria and that the title could adjust according to this criterion, as well as the query building on it also.

    However, the OP did not specify SQL * as the reporting tool, so there is little interest providing a complete solution which, until they specify what user interface that they are actually using.

  • What subprogramme should we prefer to return multiple values with OUT parameter?

    Hello

    I worked on the procedures and functions, and aware of their differences. Today I have an interview question that - suppose I don't have return multiple values through a subroutine and I want nor run any what DML within this subprogramme and I want to use this subprogramme in the SQL query. What subprogramme I would prefer - "Operating Mode" or "Function" and why?

    In my view, both can be used in this case, but want to see your views and opinions.

    Kind regards

    Sachin jerbi

    In terms of software engineering, if you claim something that you expect to "return" something (a value or values) then you use a function.  If you call something to "do" something, and then you use a procedure.

    THE settings are not good practices in many cases and should not strictly considered "return" of values.  Instead, they are assigned values in the code and generally act as pointers to the original variable/structure that was passed as a parameter (the actual internals of Oracle don't quite do it, but in principle this is what they do).

    A return value (or structure) of a function is basically push in the battery to the point that the RETURN statement is issued, and then the code calling the stack appears to assign it to a variable or placeholder, it should go in.

    If it seems a little difference between procedures and functions to some people, it is recommended to use functions for obtaining values and procedures to do things, in most cases.  It is not just "syntactic sugar", as mentioned above.

  • OAG - insert timestamps in XML query

    Hello

    I need to insert timestamps in XML query. Please suggest steps/options/filters to do?

    for example

    XML request:

    < xml >

    < timestamp > < / timestamp >

    < / xml >

    output must be

    < xml >

    < timestamp > 2006 - 05 - 04T 18: 13:51.0Z < / timestamp >

    < / xml >

    Kind regards

    Ganesh

    Hello

    You want to use the filter to add an XML node.

    Create a JavaScript filter, first to do something like this:

    function invoke (msg)

    {

    now = new Date();

    Msg.put (elements "UTCTime", now.toUTCString ());

    Returns true;

    }

    In Add an XML node to the node content add:

    ${UTCTime elements}

  • Need help: not prepared statement to return the value:

    Hi refugees,

    In LICS, prepared statement does not return any value...

    This is the code...

    String p_person_id = pageContext.getParameter ("person_id");

    Connection Conn = pageContext.getApplicationModule (webBean) .getOADBTransaction () .getJdbcConnection ();

    String payment_query = "select max (payment_date) in the xxbdf_payslip_detail_mv where assingment_id = (select assignment_id from the people_reporting_info where person_id ' + p_person_id + ') ';

    PreparedStaement stmt = stmt.executeQuery ();

    ResultSet rs = stmt.executeQuery ();

    While ((rs! = null) & & RS.) Next

    {

    java.sql.Date sql_date = rs.getDate (1);

    SOP (SQL_DATE)

    / * I tried this also * /.

    java.util.Date util_date = rs.getDate (1);

    SOP();

    String string_date = rs.getString (1);

    SOP();

    }

    and I have to format the date as "DD-MM-RRRR.

    Please give your valuable suggestions refugees...

    Thank you

    Jaya

    Jaya Hey,

    Write the code below in the PR

    Code for the prepared statement


    String PaymentData;

    String p_person_id = pageContext.getParameter ("person_id");

    System.out.println ("The person Id is" + p_person_id); check the id of the person should not be null.

    try {}

    Connection Conn = pageContext.getApplicationModule (webBean) .getOADBTransaction () .getJdbcConnection ();

    String query = "select max (payment_date) in the xxbdf_payslip_detail_mv where assingment_id = (select assignment_id from the people_reporting_info where person_id ' + p_person_id + '); '

    PreparedStatement stmt = conn.prepareStatement (Query);

    ResultSet = stmt. ExecuteQuery();

    While (resultset.next ())

    {

    PaymentData = (String) resultset.getString("payment_date").toString ();

    }

    Conn.Commit ();

    }

    catch (System.Exception e)

    {

    e.printStackTrace ();

    }

    See below the Code for the Date Format Conversion


    cabu.ui.validate.Formatter formatter = new OADateValidater (PaymentData, "dd-MMM-YY" "");

    Thank you

    Dilip

  • A row of Sub query returns more than 1 row!

    I'm trying to update the values in one table from another table and get the error: void line query returns More Than 1 row.

    I want to PRV_NAME B chart updated in the table A PRV_NAME where A.PRVID = B.PRVID where B.PRV_TYPE = M"

    The two paintings were all unique PRVID, however, table B has PRVID that have the same name. So the data in table B can look like this:

    PRVID PRV_NAME
    1234 PHOENIX MED
    1235 MED BAG
    1236 MED BAG
    1237 OVERLAND
    etc...

    So, as you can see are the unique PRVID, but not the PRV_NAME. Is this the reason why I get this error?

    I do not build the tables and have no control over what is put in them. If this is the reason for the error, is there a way to fix this?

    For reference, here's the request. Maybe there's something wrong with that?


    Update msb_prv_source ps
    Set ps.prv_name =

    (select prv00.prv00_prv_name
    of prv00_prv prv00
    Join msb_prv_source ps
    On prv00.prv00_prv_id = ps.prvid
    where prv00.prv00_prv_type = am')

    Published by: user12296489 on April 19, 2013 10:46
    /* Formatted on 4/19/2013 2:00:43 PM (QP5 v5.185.11230.41888) */
    MERGE INTO msb_prv_source a
         USING (SELECT *
                  FROM prv00_prv
                 WHERE prv00_prv_type = 'M') b
            ON (a.prv00_prv_id = b.prvi)
    WHEN MATCHED
    THEN
       UPDATE SET a.prv_name = prv00_prv_name
    

Maybe you are looking for

  • 3D games on Portege 7010CT

    Hi I have a toshiba portege 7010CT with a neomagic magicmedia 256 BC I bought a 3d game Fa 18 Hornet (1997 game). When I start a mission I see compressed game window. I mean the width of the window of the game after the start of game is about 1/5 of

  • Why the heart activity is not followed?

    The heart activity is says that I have not been active enough today. Problem is, I rode a bike uphill today... at least 30 minutes. Same thing happened when I went for a ride for an hour yesterday. I felt active... why he did not follow my heart rate

  • Why can't I burn pictures to a Flash Drive in Vista?

    Right now, I have Vista 32, but waiting for delivery of a new laptop Dell Inspiron 5720 with Windows 7 in a few days.  I want to burn my photos on a Flash drive, so I can save it in my new computer, but when I click on in the Photo Gallery it can bur

  • WRT160N v2 no wireless connection

    Hello I wired two PCs to the router working very well (even if the performance has been hectic lately).  The last 4 days, however, when I try to connect wirelessly I get connections that are interrupted several times.  I'm in the settings section of

  • Software provided with Windows7homepremium

    I recently bought a new desktop computer with windows7homepremium. I was told it has not come with any software but windows. No Works Suite, Media Player no, no burning software, anything extra that was taken for granted for years. If I buy a compute