O XMLSERIALIZE deve resolver.

SELECT XMLSERIALIZE(DOCUMENT meuxml as varchar) FROM test_tablext;

On Thu, Dec 16, 2010 at 10:42 AM, <[email protected]> wrote:

> Bom Dia
>
> Criei a seguinte tabela no postgresql com um campo xml
>
> CREATE TABLE test_tablext
> (
>  code_id character(8),
>  cardid character(1),
>  descr character varying(50),
>  percent numeric(10,2) DEFAULT 0,
>  days numeric(8,0) DEFAULT 0,
>  date_lim date,
>  "enable" boolean,
>  obs text,
>  "value" numeric(18,6) DEFAULT 0,
>  meuxml xml,
>  sr_recno numeric(15,0) NOT NULL DEFAULT
> nextval('test_tablext_sq'::regclass),
>  sr_deleted character(1) NOT NULL DEFAULT ' '::bpchar,
>  CONSTRAINT test_tablext_sr_recno_key UNIQUE (sr_recno)
> )
> WITH (
>  OIDS=FALSE
> );
>
>
> e insiro dentro dele um xml com o seguinte comando
> INSERT INTO "test_tablext" ( "code_id", "cardid", "descr", "percent",
> "days", "date_lim", "enable", "obs", "value", "meuxml", "sr_deleted" )
> VALUES ( '00001', NULL, '12/16/10 - 10:37:09', NULL, 999, '20101216',
> true, 'This is a memo field. Seconds since midnight : 38229.77', NULL,
> '<?xml version="1.0" encoding="utf-8"?><Array FatherId="-1" Id="0" Len="4"
> Type="A"><Data Id="0" Pos="1" Type="N" Value="1"/><Data Id="0" Pos="2"
> Type="N" Value="2"/><Data Id="0" Pos="3" Type="N" Value="3"/><Data Id="0"
> Pos="4" Type="N" Value="4"/></Array>', ' ' )
>
> quando verifico no banco, o campo comeca apenas no primeiro <Array
> como faco para ele retornar o cabecalho <?xml version="1.0"
> encoding="utf-8"?> junto com o xml?
>
> []s
> Luiz
>
>
>
> _______________________________________________
> pgbr-geral mailing list
> [email protected]
> https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
>
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral

Responder a