Re: How to process inverted comma in "EXECUTE 'insert into xxx values(...)

From: Rodrigo De León <rdeleonp(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Cc: "Nemo Terry" <ntuser155(at)hotmail(dot)com>
Subject: Re: How to process inverted comma in "EXECUTE 'insert into xxx values(...)
Date: 2007-05-15 07:14:57
Message-ID: a55915760705150014y538341dj2fc5aef0500fd689@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 5/15/07, Nemo Terry <ntuser155(at)hotmail(dot)com> wrote:
> But I must use it in function,so...
> Do you have another solution?

So?

----------------------------------------

t=# CREATE TABLE d(i INT);
CREATE TABLE
t=# CREATE OR REPLACE FUNCTION add1(x INT) RETURNS INT AS
t-# $$
t$# BEGIN
t$# INSERT INTO d VALUES(x);
t$# RETURN x;
t$# END;
t$# $$ LANGUAGE plpgsql;
CREATE FUNCTION
t=# SELECT add1(1);
1

t=# SELECT add1(2);
2

t=# SELECT add1(3);
3

t=# SELECT * FROM d;
1
2
3

----------------------------------------

Do you need something else?

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Nemo Terry 2007-05-15 07:42:47 Re: How to process inverted comma in "EXECUTE 'insert into xxx values(...)
Previous Message Richard Huxton 2007-05-15 07:12:55 Re: How to process inverted comma in "EXECUTE 'insert into xxx values(...)