Re: Newbie in functions - Mailing list pgsql-novice

From denis@coralindia.com
Subject Re: Newbie in functions
Date
Msg-id 003901c1e699$ad0427c0$0232a8c0@coralindia.com
Whole thread Raw
In response to Newbie in functions  (Eduardo_Cadena@praxair.com)
List pgsql-novice
Put single quote twice ( '' ) before and after "pm"....

Denis

----- Original Message -----
From: <Eduardo_Cadena@praxair.com>
To: <pgsql-novice@postgresql.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@postgresql.org)


pgsql-novice by date:

Previous
From: denis@coralindia.com
Date:
Subject: Primary Key
Next
From: "devi"
Date:
Subject: How to check success/failure of dml statements