Re: Trying to append text to the end of a text string

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Adam Lawrence <adam(at)mediasculpt(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trying to append text to the end of a text string
Date: 2005-10-05 22:51:42
Message-ID: 20051005225142.GL40138@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

decibel=# select 'moo' || 'cow';
moocow

decibel=#

What database uses &&? Access? I seem to recall seeing that somewhere
before, but don't remember where...

Note that || is ANSI SQL.

On Thu, Oct 06, 2005 at 11:30:53AM +1300, Adam Lawrence wrote:
> Hi
>
> I am trying to append text onto the end of a text variable.
>
> I have the text variable P_IDT_ID, I want to add the letter S to the end of it, so I tried the following line in my code:
>
> P_IDT_ID := P_IDT_ID && cast(''S'' as text);
>
> However, I got the following error message:
>
> ERROR: operator does not exist: text && text
> HINT: No operator matches the given name and argument type(s). You may need to add explicit type casts.
> CONTEXT: SQL statement "SELECT $1 && cast('S' as text)"
> PL/pgSQL function "f_create_index_currency_inversion" line 28 at assignment
>
> Note I am using PL/pgSQL.
>
>
> Can you help?
>
> Thanks
> Adam
>
> Adam Lawrence
> Mediasculpt
>
> Direct Line: +64 6 3546038
> Email: adam(at)mediasculpt(dot)com

--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-10-05 23:00:21 Re: Trying to append text to the end of a text string
Previous Message Scott Marlowe 2005-10-05 22:50:03 Re: Trying to append text to the end of a text string