Re: select into

From: Richard Broersma Jr <rabroersma(at)yahoo(dot)com>
To: Mulham freshcode <mulhamcode(at)yahoo(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: select into
Date: 2006-11-22 15:55:29
Message-ID: 430473.67117.qm@web31802.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Hi guys,
>
> Am new to sql scripting so this might be a stupid question. Am getting an error while trying
> to do the following
>
> SELECT INTO svc_data_rec * from svc_tbl_name where 'uid' = sub_id;
>
> where svc_data_rec is defined as record and svc_tbl_name is a varchar that holds the name of a
> table and sub_id is another varchar. the error message is
>
> ERROR: syntax error at or near "$1" at character 17
> QUERY: SELECT * from $1 where 'uid' = $2
> CONTEXT: PL/pgSQL function "foo" line 132 at select into variables
> LINE 1: SELECT * from $1 where 'uid' = $2
>
> where am i going wrong? it seems that the variables are not being substituted with their
> values correctly.

Notice:
http://www.postgresql.org/docs/8.2/interactive/sql-selectinto.html
and particularly this example:
http://www.postgresql.org/docs/8.2/interactive/sql-selectinto.html#AEN54014
Regards,

Richard Broersma Jr.

In response to

  • select into at 2006-11-22 08:28:15 from Mulham freshcode

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Kretschmer 2006-11-22 16:07:33 Re: select into
Previous Message A. Kretschmer 2006-11-22 15:47:42 Re: select into