Skip site navigation (1) Skip section navigation (2)

Stupid question: concatenating strings

From: "Justin Long" <justinlong(at)strategicnetwork(dot)org>
To: <pgsql-novice(at)hub(dot)org>
Subject: Stupid question: concatenating strings
Date: 2000-10-18 16:07:51
Message-ID: PBEMJIMKFNACLPCNPDEBGEGNDPAA.justinlong@strategicnetwork.org (view raw or flat)
Thread:
Lists: pgsql-novice
I can't figure out how to do this.

I want to do the following

UPDATE newlink SET newfrom = substr(oldfrom,0,1) + '-' + substr(oldfrom,1)

... I want to do this:

take the following variables

CAFG
CBTN
CNPL
CUSA

and transform it to this:

C-AFG
C-BTN
C-NPL
C-USA

Someone please help me! I've been through the user manual & I can't find out
how to do it. Pgsql just tells me:

Unable to identify an operator '+' for types 'text' and 'unknown'
You will have to retype this query using an explicit cast


_________________________________________________________________
Justin Long				Network for Strategic Missions
1732 South Park Court		Never retreat. Never surrender.
Chesapeake, VA 23320, USA	Never cut a deal with a dragon.
757-213-2055, ICQ 83384482	http://www.strategicnetwork.org
Monday Morning Reality Check:	reality-check-subscribe(at)egroups(dot)com


In response to

Responses

pgsql-novice by date

Next:From: bmccoyDate: 2000-10-18 17:17:48
Subject: Re: Stupid question: concatenating strings
Previous:From: Lionel BargeotDate: 2000-10-18 14:41:50
Subject: problem to compile 7.0.2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group