xml file

Dúvidas, dicas e truques de PL/SQL. Aqui também vão assuntos relacionados a pacotes, triggers, funções, Java-Stored Procedures, etc
Post Reply
leandromiranda87
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 43
Joined: Tue, 20 Mar 2012 11:37 am
Location: Campinas
Leandro L. Miranda

Hello everyone,

I am doing the import and treatment of XML files in the Oracle Base. The entire process of identifying XML files in the directory, importing files at the base is OK. I can not read the data from TABLE SYS.XMLTYPE.

I have tried to read in various forms, but none of them successfully.

- Reading step of XML files and import to BD

Select all

---CRIA DIRETÓRIOS PARA LEITURA E GRAVAÇÃO DOS ARQUIVOS 
 
CREATE OR REPLACE DIRECTORY d_received_files AS 'D:\Receive'; 
CREATE OR REPLACE DIRECTORY d_bkp_received_files AS 'D:\Bkp_Receive'; 
CREATE OR REPLACE DIRECTORY d_sended_files AS 'D:\Send'; 
CREATE OR REPLACE DIRECTORY d_bkp_sended_files AS 'D:\Bkp_Send'; 
 
 
---GRANT LEITURA E GRAVAÇÃO NOS DIRETÓRIOS (USUÁRIO SYS) 
 
GRANT READ, WRITE ON DIRECTORY d_received_files TO mlxlevesul; 
GRANT READ, WRITE ON DIRECTORY d_bkp_received_files TO mlxlevesul; 
GRANT READ, WRITE ON DIRECTORY d_sended_files TO mlxlevesul; 
GRANT READ, WRITE ON DIRECTORY d_bkp_sended_files TO mlxlevesul; 
 
 
---CRIA TABELA QUE RECEBERÁ O CONTEÚDO DOS ARQUIVOS XML 
CREATE TABLE custom_xml_received( 
       nome_arquivo         VARCHAR2(200), 
       caminho_arquivo      VARCHAR2(4000), 
       conteudo_arquivo     SYS.XMLTYPE, 
       data_recepcao        DATE DEFAULT SYSDATE); 
        
        
---GRANT GRAVAÇÃO A TABELA AOS USUÁRIOS (USUÁRIO SYS) 
GRANT ALL ON custom_xml_received TO mlxlevesul; 
 
 
---GRANT ACESSO A PACK DBMS_BACKUP_RESTORE (USUÁRIO SYS) 
GRANT ALL ON DBMS_BACKUP_RESTORE TO mlxlevesul; 
 
 
---GRANT LEITURA A VIEW XKRBMSFT 
GRANT SELECT ON XKRBMSFT TO mlxlevesul; 
 
 
 
---CRIA PROCEDURE PARA SELECIONAR TODOS OS ARQUIVOS DO DIRETÓRIO RECEIVE 
 
CREATE OR REPLACE PROCEDURE custom_list_received_archives 
 (directory IN VARCHAR2, 
  v_error_code_arm OUT NUMBER) 
 IS 
 
     PROCNAME CONSTANT VARCHAR2(100) := 'custom_list_received_archives'; 
 
     ns          VARCHAR2(1024); 
     v_directory VARCHAR2(1024); 
 
     v_error_code NUMBER; 
     v_error_text VARCHAR2(300); 
 
     CURSOR c_archive_names IS 
     SELECT fname_archive, fname_krbmsft 
     FROM sys.xkrbmsft; 
 
     r_archive_names c_archive_names%ROWTYPE; 
 
 BEGIN 
      OPEN c_archive_names; 
 
      v_directory := directory; 
      sys.dbms_backup_restore.searchfiles(v_directory, ns); 
 
      v_error_code := 0; 
      v_error_text := ''; 
 
 FOR each_file IN (SELECT fname_krbmsft AS name FROM sys.xkrbmsft) LOOP 
 
      EXIT WHEN c_archive_names%NOTFOUND; 
 
      FETCH c_archive_names INTO r_archive_names; 
 
     custom_armazenar_xml(v_file    => r_archive_names.fname_archive, 
                          v_caminho => r_archive_names.fname_krbmsft, 
                          v_error_code_out => v_error_code_arm); 
 
     IF v_error_code_arm = 0 /*AND r_archive_names.fname_archive IN (SELECT nome_arquivo FROM custom_xml_received)*/ THEN 
 
        UTL_FILE.FCOPY(SRC_LOCATION  => 'D_RECEIVED_FILES', 
                       SRC_FILENAME  => R_ARCHIVE_NAMES.FNAME_ARCHIVE, 
                       DEST_LOCATION => 'D_BKP_RECEIVED_FILES', 
                       DEST_FILENAME => R_ARCHIVE_NAMES.FNAME_ARCHIVE); 
 
        UTL_FILE.FREMOVE(LOCATION => 'D_RECEIVED_FILES', 
                         FILENAME => R_ARCHIVE_NAMES.FNAME_ARCHIVE); 
 
     END IF; 
 
 END LOOP; 
 CLOSE c_archive_names; 
 
 EXCEPTION 
    WHEN OTHERS THEN 
      v_error_code := SQLCODE; 
      v_error_text := SUBSTR(SQLERRM, 1, 300); 
 
 END; 
 
 
 
 
---CRIA PROCEDURE PARA INSERÇÃO DO CONTEÚDO DOS ARQUIVOS EM TABELA 
 
CREATE OR REPLACE PROCEDURE custom_armazenar_xml (v_file           IN VARCHAR2, 
                                                  v_caminho        IN VARCHAR2, 
                                                  v_error_code_out OUT NUMBER) AS 
                                                   
     v_error_code NUMBER := 0; 
     v_error_text VARCHAR2(300) := ''; 
 
BEGIN 
  v_error_code_out := 0; 
   
  INSERT INTO custom_xml_received 
    (nome_arquivo, caminho_arquivo, conteudo_arquivo) 
  VALUES 
    (v_file, v_caminho, xmltype(bfilename('D_RECEIVED_FILES', v_file),nls_charset_id('AL32UTF8'))); 
 
  COMMIT; 
 
 EXCEPTION 
    WHEN OTHERS THEN 
      v_error_code := SQLCODE; 
      v_error_text := SUBSTR(SQLERRM, 1, 300); 
       
      v_error_code_out := v_error_code; 
 
END custom_armazenar_xml;
- Step reading of tags
] I tried to do with extract () - unsuccessful

Select all

SELECT extract(xt.conteudo_arquivo, '/AGENDA/CONTATO/ID').getnumberval() ID, 
        extract(xt.conteudo_arquivo, '/AGENDA/CONTATO/NOME').getstringval() NOME, 
        extract(xt.conteudo_arquivo, '/AGENDA/CONTATO/SOBRENOME').getstringval() SOBRENOME, 
        extract(xt.conteudo_arquivo, '/AGENDA/CONTATO/EMAIL').getstringval() EMAIL, 
        extract(xt.conteudo_arquivo, '/AGENDA/CONTATO/TELEFONE').getstringval() TELEFONE 
  FROM custom_xml_received XT/*, 
       TABLE(XMLSequence(Extract(XT.conteudo_arquivo , '/AGENDA'))) AGENDA,              -- Master 
       TABLE(XMLSequence(Extract(VALUE(AGENDA) , '/AGENDA/CONTATO'))) CONTATO */           -- Detalhes 
WHERE XT.nome_arquivo = 'contato001.XML'

extractValue () - without success

Select all

SELECT extractvalue(VALUE(AGENDA), '/AGENDA/ID') ID, 
        extractvalue(VALUE(AGENDA), '/AGENDA/NOME') NOME, 
        extractvalue(VALUE(AGENDA), '/AGENDA/SOBRENOME') SOBRENOME 
  FROM custom_xml_received XT, 
       TABLE(XMLSequence(Extract(XT.conteudo_arquivo , '/AGENDA'))) AGENDA           -- Detalhes 
WHERE XT.nome_arquivo = 'contato001.XML'
]
The closest I have reached so far:
The result comes empty (NULL)

Select all

SELECT extractvalue(xt.conteudo_arquivo, '/AGENDA/CONTATO/ID') ID, 
        extractvalue(xt.conteudo_arquivo, '/AGENDA/CONTATO/NOME') NOME, 
        extractvalue(xt.conteudo_arquivo, '/AGENDA/CONTATO/SOBRENOME') SOBRENOME, 
        extractvalue(xt.conteudo_arquivo, '/AGENDA/CONTATO/EMAIL') EMAIL, 
        extractvalue(xt.conteudo_arquivo, '/AGENDA/CONTATO/TELEFONE') TELEFONE 
  FROM custom_xml_received XT/*, 
       TABLE(XMLSequence(Extract(XT.conteudo_arquivo , '/AGENDA'))) AGENDA,              -- Master 
       TABLE(XMLSequence(Extract(VALUE(AGENDA) , '/AGENDA/CONTATO'))) CONTATO */           -- Detalhes 
WHERE XT.nome_arquivo = 'contato001.XML'
follows an example of the XML file

Select all

<?xml version="1.0"?> 
<agenda> 
	<contato id="1"> 
		<nome>Rodrigo</nome> 
		<sobrenome>Almeida</sobrenome> 
		<email>contato@rodrigoalmeida.net</email> 
		<telefone tipo="res">11 9999 9999</telefone> 
		<telefone tipo="com">11 8888 8888</telefone> 
	</contato> 
</agenda>
Can you help me with this problem?

Att,
leandromiranda87
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 43
Joined: Tue, 20 Mar 2012 11:37 am
Location: Campinas
Leandro L. Miranda

Although I continue the research, so far I could not solve this problem.

Does anyone know how this can be done? Or do you know another way?

Thanks
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Brother, good morning ... beleza?

I'll take a look at your XML and see if I can set up the extractValue (I did it a while ago rs ...).
Now a question:
  • Your directories are working cool? [/ list]

    Do you get to access XML?
leandromiranda87
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 43
Joined: Tue, 20 Mar 2012 11:37 am
Location: Campinas
Leandro L. Miranda

Speak brother,

Thanks for the attention.

is working yes man, I can do the entire process of identifying the files inserted in the directory, the import to the XMLType table and the transfer of the files to another directory when they are inserted at the base.

If I make a basic selection in the table I can open the field with the XML content without problems também.

Is there any other problem I may be missing ??

I took an example ready on the net that of the right, but in this other pattern I could not do it. I do not know if it's the XML pattern or if it's some mistake I'm committing.

Example with income

Select all

SELECT extractvalue(VALUE(FAQ), '/FAQ-LIST/FAQ-ID') "FAQ-ID", 
        extractvalue(VALUE(QUE), '/QUESTION/QUERY') "QUERY", 
        extractvalue(VALUE(QUE), '/QUESTION/RESPONSE') "RESPONSE" 
  FROM custom_xml_received XT, 
       TABLE(XMLSequence(Extract(XT.conteudo_arquivo , '/FAQ-LIST'))) "FAQ",            -- Master 
       TABLE(XMLSequence(Extract(VALUE(FAQ) , '/FAQ-LIST/QUESTION'))) "QUE"            -- Detalhes 
WHERE XT.nome_arquivo = 'contato005.XML'

Select all

  <?xml version="1.0" ?>  
- <FAQ-LIST> 
  <FAQ-ID>01</FAQ-ID>  
- <QUESTION> 
  <QUERY>Question 1</QUERY>  
  <RESPONSE>Answer goes here.</RESPONSE>  
  </QUESTION> 
- <QUESTION> 
  <QUERY>Question 2</QUERY>  
  <RESPONSE>Answer goes here.</RESPONSE>  
  </QUESTION> 
- <QUESTION> 
  <QUERY>Question 3</QUERY>  
  <RESPONSE>Answer goes here.</RESPONSE>  
  </QUESTION> 
  </FAQ-LIST>
Trevisolli
Moderador
Moderador
Posts: 2016
Joined: Wed, 12 Jan 2005 3:25 pm
Location: Araraquara - SP
Abraço,

Trevisolli
OCA Oracle PL/SQL Developer Certified Associate
OCP Oracle Forms Developer Certified Professional
Araraquara-SP

Brother, I took a test here and worked:

Select all

 
declare  
 -- 
 vxml xmltype := xmltype('<?xml version="1.0"?> 
                          <agenda> 
                             <contato id="1"> 
                                <nome>Rodrigo</nome> 
                                <sobrenome>Almeida</sobrenome> 
                                <email>contato@rodrigoalmeida.net</email> 
                                <telefone tipo="res">11 9999 9999</telefone> 
                                <telefone tipo="com">11 8888 8888</telefone> 
                             </contato> 
                          </agenda>'); 
  vret varchar2(1000); 
  vret1 varchar2(1000); 
   
  --  
begin 
 
  SELECT extractvalue(value(AGENDA), '/contato/nome') nome 
       , extractvalue(value(AGENDA), '/contato/email') email 
    INTO vret  
       , vret1 
    FROM TABLE(XMLSequence(Extract(vxml , '/agenda/contato'))) AGENDA; 
     
  dbms_output.put_line('Retorno: '||nvl(vret,'-x-')||' ret1: '||vret1); 
 
end; 
 
tests this one I posted, if possible, and tries to make the adaptation there.
Anything, send us to us.
leandromiranda87
Rank: Programador Pleno
Rank: Programador Pleno
Posts: 43
Joined: Tue, 20 Mar 2012 11:37 am
Location: Campinas
Leandro L. Miranda

Wonder brother,

Unfortunately I still did not have time to finish this, but I did some basic tests and gave right.

Thank you,

Hug.
marlonpasquali
Rank: DBA Pleno
Rank: DBA Pleno
Posts: 248
Joined: Fri, 06 Feb 2009 3:02 pm
Location: ERECHIM - RS

Hello,
I use the routine below to read the NFE:

Select all

 
for c in (SELECT tabela_xml_extract.* 
    FROM PCN_XML tabela, 
         XMLTable( 
            XMLNAMESPACES(DEFAULT 'http://www.portalfiscal.inf.br/nfe') 
           ,'/nfeProc/NFe/infNFe' 
           PASSING tabela.nota/*campo XML*/ 
           COLUMNS Nota      varchar2(15)    PATH '/infNFe/ide/nNF/text()', 
                   modelo    varchar2(2)     PATH '/infNFe/ide/mod/text()', 
                   serie     varchar2(2)     PATH '/infNFe/ide/serie/text()', 
                   Emissao   varchar2(15)    PATH '/infNFe/ide/dEmi/text()', 
                   Fornecedor  varchar2(18)  PATH '/infNFe/emit/CNPJ/text()', 
                   BCNota      varchar2(15)  PATH '/infNFe/total/ICMSTot/vBC/text()', 
                   IcmsNota    varchar2(15)  PATH '/infNFe/total/ICMSTot/vICMS/text()', 
                   VlrProdutos varchar2(15)  PATH '/infNFe/total/ICMSTot/vProd/text()', 
                   VlrFrete    varchar2(15)  PATH '/infNFe/total/ICMSTot/vFrete/text()', 
                   ValorIPI    varchar2(15)  PATH '/infNFe/total/ICMSTot/vIPI/text()', 
                   ValorPIS    varchar2(15)  PATH '/infNFe/total/ICMSTot/vPIS/text()', 
                   ValorCOFINS varchar2(15)  PATH '/infNFe/total/ICMSTot/vCOFINS/text()', 
                   ValorNota   varchar2(15)  PATH '/infNFe/total/ICMSTot/vNF/text()', 
                   Adicionais  varchar2(2000) PATH '/infNFe/infAdic/infCpl/text()', 
                   TipoFrete   varchar2(2)   PATH '/infNFe/transp/modFrete/text()',                    
                   Peso        varchar2(15)  PATH '/infNFe/transp/vol/pesoB/text()' 
    ) tabela_xml_extract 
where registro = ViRegistro) loop 
 
  ----------*****----- 
 
end loop; 
Att,
Marlon
shinobyghost
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Posts: 5
Joined: Thu, 18 Jun 2015 10:10 am
Location: Bauru/SP

Good afternoon, I'm new to plsql and XML, I would like everyone's help to solve my problem.
I have Oracle 11GR2 installed on a Windows Server 2008.

I need to configure the server and create a procedure that reads the contents of the XML and enter the information in the corresponding tables.

The tables are as follows:

Select all

CREATE TABLE ALUNO( 
	ALUNO_ID NUMBER(6,0) PRIMARY KEY, 
	FIRST_NAME VARCHAR2(150), 
	LAST_NAME VARCHAR2(150), 
	EMAIL VARCHAR2(150), 
	PHONE_NUMBER VARCHAR2(150), 
	CPF NUMBER(11,0) 
); 
 
--------------------------------------------------- 
 
CREATE TABLE CURSO( 
	CURSO_ID NUMBER(6,0) PRIMARY KEY, 
	ALUNO_ID NUMBER(6,0), 
	MATERIA_ID NUMBER(6,0), 
	NOTA NUMBER(4,2), 
	DATAHORA DATE 
); 
 
I have an XML like this:

Select all

 
<?xml version="1.0" encoding="windows 1252" ?>  
  <listaalunos> 
  <aluno> 
  <id>1001</id>  
  <firstname>HUGO</firstname>  
  <lastname>GELADEIRA</lastname>  
  <email>hugo@hotmail.com</email> 
  <phone>988665522</phone> 
  <cpf>22722722764</cpf>  
  <curso_id>101</curso_id>  
  <idmateria>13</idmateria>  
  <nota>8,75</nota> 
  <data>14/07/2015</data> 
  </aluno> 
  <aluno> 
  <firstname>RODRIGO</firstname>  
  <lastname>TESTE</lastname>  
  <email>rodrigo@hotmail.com</email> 
  <phone>988772211</phone> 
  <cpf>25825825897</cpf>  
  <curso_id>102</curso_id>  
  <idmateria>12</idmateria>  
  <nota>9,75</nota> 
  <data>14/07/2015</data> 
  </aluno> 
  </listaalunos> 
I have to insert this XML into the two tables above.
How could I do this using UTL_File, ExtractValue ...?
I have tested according to some answers from this post, but they gave error ...
Thank you for the attention of all ...
Preazito
Rank: Estagiário Júnior
Rank: Estagiário Júnior
Posts: 1
Joined: Mon, 02 May 2016 2:36 pm

Good afternoon to all,

I have a question in creating a consultation in the Oracle database.
In the table (t_parameters) in the bank has a field (table_value) that contains information in xml, and would like to bring the most current value of the link according to speed.
P.s.: The field with the date of creation of the XML is "create_date".
below how XML information is saved in the table field.

Select all

<Table> 
	<TableStructure> 
		<Col Name="Largura_Banda_Kbps" Index="Y" Mandatory="N" Type="Text" DefaultValue="" /> 
	<Col Name="Terrestre_Valor_Mensal" Index="N" Mandatory="N" Type="Number" DefaultValue="" /> 
	<Col Name="Terrestre_Valor_Instalacao" Index="N" Mandatory="N" Type="Number" DefaultValue="" /> 
	<Col Name="Satélite_Valor_Mensal" Index="N" Mandatory="N" Type="Number" DefaultValue="" /> 
	<Col Name="Satélite_Valor_Instalacao" Index="N" Mandatory="N" Type="Number" DefaultValue="" /> 
	</TableStructure> 
	<TableElements> 
		<Elem> 
			<Largura_Banda_Kbps>500000 Kbps</Largura_Banda_Kbps> 
			<Terrestre_Valor_Mensal>114908.1</Terrestre_Valor_Mensal> 
			<Terrestre_Valor_Instalacao>8448.15</Terrestre_Valor_Instalacao> 
			<Satélite_Valor_Mensal>0</Satélite_Valor_Mensal> 
			<Satélite_Valor_Instalacao>0</Satélite_Valor_Instalacao> 
		</Elem> 
		<Elem> 
			<Largura_Banda_Kbps>250000 Kbps</Largura_Banda_Kbps> 
			<Terrestre_Valor_Mensal>70495.29</Terrestre_Valor_Mensal> 
			<Terrestre_Valor_Instalacao>8448.15</Terrestre_Valor_Instalacao> 
			<Satélite_Valor_Mensal>0</Satélite_Valor_Mensal> 
			<Satélite_Valor_Instalacao>0</Satélite_Valor_Instalacao> 
		</Elem> 
		<Elem> 
			<Largura_Banda_Kbps>100000 Kbps</Largura_Banda_Kbps> 
			<Terrestre_Valor_Mensal>20395.4</Terrestre_Valor_Mensal> 
			<Terrestre_Valor_Instalacao>1570.55</Terrestre_Valor_Instalacao> 
			<Satélite_Valor_Mensal>0</Satélite_Valor_Mensal> 
			<Satélite_Valor_Instalacao>0</Satélite_Valor_Instalacao> 
		</Elem> 
		<Elem> 
			<Largura_Banda_Kbps>68000 Kbps</Largura_Banda_Kbps> 
			<Terrestre_Valor_Mensal>14512.71</Terrestre_Valor_Mensal> 
			<Terrestre_Valor_Instalacao>1570.55</Terrestre_Valor_Instalacao> 
			<Satélite_Valor_Mensal>0</Satélite_Valor_Mensal> 
			<Satélite_Valor_Instalacao>0</Satélite_Valor_Instalacao> 
		</Elem> 
		<Elem> 
			<Largura_Banda_Kbps>32000 Kbps</Largura_Banda_Kbps> 
			<Terrestre_Valor_Mensal>12113.11</Terrestre_Valor_Mensal> 
			<Terrestre_Valor_Instalacao>1570.55</Terrestre_Valor_Instalacao> 
			<Satélite_Valor_Mensal>0</Satélite_Valor_Mensal> 
			<Satélite_Valor_Instalacao>0</Satélite_Valor_Instalacao> 
		</Elem> 
		<Elem> 
			<Largura_Banda_Kbps>16384 Kbps</Largura_Banda_Kbps> 
			<Terrestre_Valor_Mensal>6759.65</Terrestre_Valor_Mensal> 
			<Terrestre_Valor_Instalacao>1570.55</Terrestre_Valor_Instalacao> 
			<Satélite_Valor_Mensal>0</Satélite_Valor_Mensal> 
			<Satélite_Valor_Instalacao>0</Satélite_Valor_Instalacao> 
		</Elem> 
		<Elem> 
			<Largura_Banda_Kbps>8192 Kbps</Largura_Banda_Kbps> 
			<Terrestre_Valor_Mensal>4783.93</Terrestre_Valor_Mensal> 
			<Terrestre_Valor_Instalacao>1570.55</Terrestre_Valor_Instalacao> 
			<Satélite_Valor_Mensal>0</Satélite_Valor_Mensal> 
			<Satélite_Valor_Instalacao>0</Satélite_Valor_Instalacao> 
		</Elem> 
		<Elem> 
			<Largura_Banda_Kbps>4096 Kbps</Largura_Banda_Kbps> 
			<Terrestre_Valor_Mensal>2414.06</Terrestre_Valor_Mensal> 
			<Terrestre_Valor_Instalacao>1570.55</Terrestre_Valor_Instalacao> 
			<Satélite_Valor_Mensal>0</Satélite_Valor_Mensal> 
			<Satélite_Valor_Instalacao>0</Satélite_Valor_Instalacao> 
		</Elem> 
		<Elem> 
			<Largura_Banda_Kbps>2048 Kbps</Largura_Banda_Kbps> 
			<Terrestre_Valor_Mensal>1208.29</Terrestre_Valor_Mensal> 
			<Terrestre_Valor_Instalacao>816.68</Terrestre_Valor_Instalacao> 
			<Satélite_Valor_Mensal>13497.83</Satélite_Valor_Mensal> 
			<Satélite_Valor_Instalacao>3726.65</Satélite_Valor_Instalacao> 
		</Elem> 
		<Elem> 
			<Largura_Banda_Kbps>1024 Kbps</Largura_Banda_Kbps> 
			<Terrestre_Valor_Mensal>823.24</Terrestre_Valor_Mensal> 
			<Terrestre_Valor_Instalacao>816.68</Terrestre_Valor_Instalacao> 
			<Satélite_Valor_Mensal>9145.01</Satélite_Valor_Mensal> 
			<Satélite_Valor_Instalacao>3726.65</Satélite_Valor_Instalacao> 
		</Elem> 
		<Elem> 
			<Largura_Banda_Kbps>512 Kbps</Largura_Banda_Kbps> 
			<Terrestre_Valor_Mensal>641.77</Terrestre_Valor_Mensal> 
			<Terrestre_Valor_Instalacao>816.68</Terrestre_Valor_Instalacao> 
			<Satélite_Valor_Mensal>6909.25</Satélite_Valor_Mensal> 
			<Satélite_Valor_Instalacao>3726.65</Satélite_Valor_Instalacao> 
		</Elem> 
	</TableElements> 
</Table>
The select that I created is giving me error and would like your help from the creation of the consultation.
follows my query that is giving error:

Select all

SELECT  
  EXTRACTVALUE(VALUE(ELEM), '/Elem/Terrestre_Valor_Mensal') VALOR 
FROM 
  t_parameters param, 
  TABLE(XMLSEQUENCE(EXTRACT(param.table_value, '/Table/TableElements/Elem'))) ELEM 
WHERE 
  param.parameter_name = 'Lote 1/Item 1' 
  AND param.table_value IS NOT NULL 
  AND param.parameter_id = 1880
dcp
Rank: Programador Júnior
Rank: Programador Júnior
Posts: 17
Joined: Tue, 17 Sep 2013 11:02 am

I know the post is very old, but someone managed to solve the final doubt of our friend Nelson?
When he says that when he eluted to join NRONNF with weight (for example) the result is duplicate. ???
I have the same problem. :-O
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests