Re: quotes in pl/pgsql

From: Justin Clift <aa2(at)bigpond(dot)net(dot)au>
To: Najm Hashmi <najm(at)mondo-live(dot)com>
Cc: pgsql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: quotes in pl/pgsql
Date: 2001-03-08 00:37:54
Message-ID: 3AA6D462.BE90DA40@bigpond.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi Najm,

Is this what you mean?

CREATE FUNCTION foobar(int4) returns int4
as 'DECLARE

textbuf varchar(120);

BEGIN

textbuf := ''Example Text '';

insert into sometable (something) values (textbuf);

RETURN 0;
END;'
LANGUAGE 'plpgsql';

Najm Hashmi wrote:
>
> Hi all, I just want to know how to put quotes around a string. Is there a
> function to do so?
> If not how can I escape a single quote.
> Thank you in advance.
>
> ------------------------------------------------------------------------
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Roberto Mello 2001-03-08 01:03:54 Re: quotes in pl/pgsql
Previous Message Tom Lane 2001-03-08 00:08:13 Re: A query that doesn't work on 7.1