2010/10/12 Andreas :
> Hi,
> Is there a conditional string-concatenation ?
>
> I'd like to have an elegant way to connect 2 strings with some 3rd element
> between only if there really are 2 strings to connect.
>
> e.g.
> MyCat ( 'John', '_', 'Doe' ) --> 'John_Doe'
> while
> MyCat ( 'John', '_', '
On Tue, Oct 12, 2010 at 06:09:07AM +0200, Andreas wrote:
> Hi,
> Is there a conditional string-concatenation ?
Perhaps this:
CREATE OR REPLACE FUNCTION mycat(text, text, text) RETURNS TEXT LANGUAGE sql
IMMUTABLE AS $$
SELECT CASE
WHEN $1 IS NULL OR $1 = '' THEN trim($3)
WHEN $3 IS NULL O
Hi,
Is there a conditional string-concatenation ?
I'd like to have an elegant way to connect 2 strings with some 3rd
element between only if there really are 2 strings to connect.
e.g.
MyCat ( 'John', '_', 'Doe' ) --> 'John_Doe'
while
MyCat ( 'John', '_', '' ) --> 'John'
MyCat ( '', '_', 'Doe
Dear Viktor,
'modified' is an attribute node, so you need to use the @ sign to
acquire its value:
mschatte=# select xpath( '//entry/@modified', '' );
xpath
--
{2009-07-07}
(1 row)
HTH
M.S.
On Tue, Oct 12, 2010 at 1:03 AM, Viktor Bojović
wrote:
> Hi,
> while parsing this type
Hi,
while parsing this type of XML:
Q91G55
i tried this query to get the modified attribute
select xpath('//entry/modified/text()',xml) from xml_sprot limit 10;
but it doesn't work.
So im asking if anyone can help me with that.
Thanx in advance
--
---
Viktor