oracle XMLTYPE XMLTABLE에서 1 레벨 경로 디렉터리를 백업하는 방법

질문:

경로에서 1 레벨 폴더를 백업하려고 했지만 작동하지 않습니다.
나는 "./"와 "."을 써 보았지만 소용이 없었다.
Oracle에서 이 작업은 어떻게 수행됩니까?
WITH xmlPrePos as 
(
  select
    IDPraga,
    IDUsina,
    replace(valor, '<?xml version="1.0" encoding="utf-16"?>','') as XML    
  from dbo_Config
  where SiglaCategoria = 'ConfigFiltros' and Sigla='ConfigFiltros'
)
    SELECT 
        IDPraga,
        IDUsina,
        IDTpVinculo,
        Descricao,
        Reforma
    FROM xmlPrePos,
        xmltable('/ConfiguracaoFiltros/TpVinculoConfigFiltros/TpVinculoConfigFiltros'
    passing XMLTYPE(xmlPrePos.XML)
    COLUMNS 
        IDTpVinculo INT path 'IDTpVinculo',
        Descricao VARCHAR(100) path 'Descricao',
        Reforma VARCHAR(100) path '../../SituacaoAreasConfigFiltros/Reforma');
마지막 줄은 내가 문제에 부딪힌 코드다.
나의 세금 신고서는 비어 있다.
XML>
<ConfiguracaoFiltros xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <SituacaoAreasConfigFiltros>
    <Reforma>VERDADEIRO</Reforma>
    <Bloqueio>NAO_IMPORTA</Bloqueio>
  </SituacaoAreasConfigFiltros>
  <TpVinculoConfigFiltros>
    <TpVinculoConfigFiltros>
      <IDTpVinculo>11</IDTpVinculo>
      <Descricao>ARRENDAMENTO / PARCERIA</Descricao>
    </TpVinculoConfigFiltros>
    <TpVinculoConfigFiltros>
      <IDTpVinculo>12</IDTpVinculo>
      <Descricao>PROPRIA</Descricao>
    </TpVinculoConfigFiltros>
  </TpVinculoConfigFiltros>
</ConfiguracaoFiltros>
버전 >
Oracle 데이터베이스 11g Enterprise 11.1.0.6.0 Edition - 64비트 프로덕션
PL/SQL 11.1.0.6.0 버전 - 프로덕션
"핵심 11.1.0.6.0 생산"
Linux용 TNS: 11.1.0.6.0 버전 - 운영
NLSRTL 버전 11.1.0.6.0 - 운영
결과 대기 >
enter image description here

답안

다음과 같은 데이터를 사용할 수 있습니다.
<?xml version="1.0" encoding="utf-16"?>
  <ConfiguracaoFiltros>
    <TpVinculoConfigFiltros>
      <TpVinculoConfigFiltros>
        <IDTpVinculo>1</IDTpVinculo>
        <Descricao>Test1</Descricao>
      </TpVinculoConfigFiltros>
    </TpVinculoConfigFiltros>
    <SituacaoAreasConfigFiltros>
      <Reforma>Reforma Test1</Reforma>
    </SituacaoAreasConfigFiltros>
  </ConfiguracaoFiltros>
./까지 간단히 추가하면 됩니다../../:
DBFiddle
WITH 
dbo_Config as (
select
  'ConfigFiltros' SiglaCategoria,
  'ConfigFiltros' Sigla,
  'IDPraga' IDPraga,
  'IDUsina' IDUsina,
  q'[<?xml version="1.0" encoding="utf-16"?>
  <ConfiguracaoFiltros>
    <TpVinculoConfigFiltros>
      <TpVinculoConfigFiltros>
        <IDTpVinculo>1</IDTpVinculo>
        <Descricao>Test1</Descricao>
      </TpVinculoConfigFiltros>
    </TpVinculoConfigFiltros>
    <SituacaoAreasConfigFiltros>
      <Reforma>Reforma Test1</Reforma>
    </SituacaoAreasConfigFiltros>
  </ConfiguracaoFiltros>
  ]' as valor
from dual
)
,xmlPrePos as 
(
  select
    IDPraga,
    IDUsina,
    replace(valor, '<?xml version="1.0" encoding="utf-16"?>','') as XML    
  from dbo_Config
  where SiglaCategoria = 'ConfigFiltros' and Sigla='ConfigFiltros'
)
    SELECT 
        IDPraga,
        IDUsina,
        IDTpVinculo,
        Descricao,
        Reforma
    FROM xmlPrePos,
        xmltable('/ConfiguracaoFiltros/TpVinculoConfigFiltros/TpVinculoConfigFiltros'
    passing XMLTYPE(xmlPrePos.XML)
    COLUMNS 
        IDTpVinculo INT path 'IDTpVinculo',
        Descricao VARCHAR(100) path 'Descricao',
        Reforma VARCHAR(100) path './../../SituacaoAreasConfigFiltros/Reforma');
하지만 제목<?xml ...?>은 삭제하지 않습니다.
DBFiddle2
WITH 
dbo_Config as (
select
  'ConfigFiltros' SiglaCategoria,
  'ConfigFiltros' Sigla,
  'IDPraga' IDPraga,
  'IDUsina' IDUsina,
  q'[<?xml version="1.0" encoding="utf-16"?>
  <ConfiguracaoFiltros>
    <TpVinculoConfigFiltros>
      <TpVinculoConfigFiltros>
        <IDTpVinculo>1</IDTpVinculo>
        <Descricao>Test1</Descricao>
      </TpVinculoConfigFiltros>
    </TpVinculoConfigFiltros>
    <SituacaoAreasConfigFiltros>
      <Reforma>Reforma Test1</Reforma>
    </SituacaoAreasConfigFiltros>
  </ConfiguracaoFiltros>
  ]' as valor
from dual
)
,xmlPrePos as 
(
  select
    IDPraga,
    IDUsina,
    valor as XML    
  from dbo_Config
  where SiglaCategoria = 'ConfigFiltros' and Sigla='ConfigFiltros'
)
    SELECT 
        IDPraga,
        IDUsina,
        IDTpVinculo,
        Descricao,
        Reforma
    FROM xmlPrePos,
        xmltable('/ConfiguracaoFiltros/TpVinculoConfigFiltros/TpVinculoConfigFiltros'
    passing XMLTYPE(xmlPrePos.XML)
    COLUMNS 
        IDTpVinculo INT path 'IDTpVinculo',
        Descricao VARCHAR(100) path 'Descricao',
        Reforma VARCHAR(100) path './../../SituacaoAreasConfigFiltros/Reforma');
같은 예이지만 DBFiffle에서 업데이트된 데이터를 사용합니다.
https://dbfiddle.uk/?rdbms=oracle_11.2&fiddle=23c0d9d500d0b87f1bc3469efd4960b9