Re: select Xpath is returning values with {}

From: dinesh kumar <dineshkumar02(at)gmail(dot)com>
To: gajendra s v <svgajendra(at)gmail(dot)com>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: select Xpath is returning values with {}
Date: 2013-11-12 16:18:51
Message-ID: CALnrH7p4y3BJxYcFzhZ4PSGAafxh8x5HFuWPg06OvpdRaoZKVg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Nov 12, 2013 at 8:46 PM, gajendra s v <svgajendra(at)gmail(dot)com> wrote:

> Hi All,
>
> How to remove {} from output
>
> I am using below query
>
> select (xpath('//Grading_Automated',(select xmlgrading from km_course_mast
> where id='100000'))) from km_course_mast where id='100000'
>
> The out is below
>
> "{"<Grading_Automated>
>
> </Grading_Automated>"}"
>
>
The xpath return type is of type array. PG returns the array data, enclosed
in "{}". If you want to remove these "{}" braces, then use either
array_to_string(xpath(.......)) or trim the braces from the xpath output.

Regards,
Dinesh
manojadinesh.blogspot.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brian Crowell 2013-11-12 16:19:52 Re: GSSAPI server side on Linux, SSPI client side on Windows
Previous Message Christian Ullrich 2013-11-12 16:03:45 Re: GSSAPI server side on Linux, SSPI client side on Windows