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

Re: Newbie in functions

From: denis(at)coralindia(dot)com
To: <pgsql-novice(at)postgresql(dot)org>, <Eduardo_Cadena(at)praxair(dot)com>
Subject: Re: Newbie in functions
Date: 2002-04-18 05:27:03
Message-ID: 003901c1e699$ad0427c0$0232a8c0@coralindia.com (view raw or flat)
Thread:
Lists: pgsql-novice
Put single quote twice ( '' ) before and after "pm"....

Denis

----- Original Message -----
From: <Eduardo_Cadena(at)praxair(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Sent: Wednesday, April 17, 2002 8:22 PM
Subject: [NOVICE] Newbie in functions


> I´m trying to create a function to obtain the possition of a substring,
but
> i don't kown if is correct
> can anyone can  help me to do this?
>
> test=# CREATE FUNCTION pos1 (int4) RETURNS int4 AS '
> test'# UPDATE tabla1
> test'#   SET posicion1 = position('pm' in SELECT string1 FROM tabla1 WHERE
> id = $1)
> test'#   WHERE id = $1;
> test'# SELECT posicion1 FROM tabla1 WHERE id = $1;
> test'# 'LANGUAGE sql;
> ERROR:  parser: parse error at or near "pm"
> test=#
>
>
> thanks for your help
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)


In response to

pgsql-novice by date

Next:From: denisDate: 2002-04-18 05:31:35
Subject: Primary Key
Previous:From: Joshua b. JoreDate: 2002-04-18 03:34:11
Subject: Re: writing to file

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