| From: | Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> |
|---|---|
| To: | Peter Schonefeld <peter(dot)schonefeld(at)gmail(dot)com> |
| Cc: | pgsql-novice(at)postgresql(dot)org |
| Subject: | Re: help with dynamic table name |
| Date: | 2007-03-06 05:00:04 |
| Message-ID: | 20070305205900.W82091@megazone.bigpanda.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-novice |
On Tue, 6 Mar 2007, Peter Schonefeld wrote:
> Hi Jas, thanks for the quick reply...I had started out with the single
> quotes, but had chaged it in my many efforts to get the thing to work...with
> the single quotes i'm getting the error:
>
> "ERROR: 42883: operator does not exist: \"unknown\" + character varying"
>
> ====
>
> CREATE OR REPLACE FUNCTION sc_insert_row(char(32),text,varchar(32)) RETURNS
> text AS $$
>
> DECLARE sql text;
> BEGIN
> sql := 'INSERT INTO '+ $3 +' ("id","body") VALUES ('+ $1 +','+ $2 +')';
In addition to the conversion to single quotes, you probably mean to be
using || (string concatenation) rather than + (addition) in the above.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Schonefeld | 2007-03-06 05:12:31 | Re: help with dynamic table name |
| Previous Message | Jasbinder Singh Bali | 2007-03-06 04:49:50 | Re: help with dynamic table name |