pg.ddx.io pgsql-sql@postgresql.org mailing list archivehelp / color / mirror / Atom feed
SOME PL/PGSQL PROBLEMS 3+ messages / 3 participants [nested] [flat]
* SOME PL/PGSQL PROBLEMS @ 2001-03-23 09:10 datactrl <quals@bigfoot.com> 0 siblings, 2 replies; 3+ messages in thread From: datactrl @ 2001-03-23 09:10 UTC (permalink / raw) To: pgsql-sql I found there are some problems with PL/pgSQL. 1) 'Drop Table' doesn't work at all 2) '--' comment causes parsing error 3) Execute doesn't work at all. It always causes parsing error! Some questions 1) Can I use variable in FROM clause for a table name? 2) Can I use variable in WHERE such as xxx = variable? JACK ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: SOME PL/PGSQL PROBLEMS @ 2001-03-23 13:46 Richard H <dev@archonet.com> parent: datactrl <quals@bigfoot.com> 1 sibling, 0 replies; 3+ messages in thread From: Richard H @ 2001-03-23 13:46 UTC (permalink / raw) To: datactrl <quals@bigfoot.com>; +Cc: pgsql-sql On 3/23/01, 9:10:16 AM, datactrl <quals@bigfoot.com> wrote regarding [SQL] SOME PL/PGSQL PROBLEMS: Sorry, can't reproduce this at all Jack > I found there are some problems with PL/pgSQL. > 1) 'Drop Table' doesn't work at all No problems in 7.1, can't remember about previous versions > 2) '--' comment causes parsing error No problems ever AFAIK > 3) Execute doesn't work at all. It always causes parsing error! I know this is only in 7.1, not in earlier versions > Some questions > 1) Can I use variable in FROM clause for a table name? No - afraid not. Queries are pre-compiled as I understand it, although this is possible in pltcl (and plperl I think). > 2) Can I use variable in WHERE such as xxx = variable? Yes, exactly as you show > JACK Take a look at http://www.brasileiro.net/postgres/ for some example plpgsql functions or check http://techdocs.postgresql.org or Bruce's book at http://www.postgresql.org/docs/awbook.html If you have a specific example, please post it with the version of PG you are running. HTH - Richard Huxton ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: SOME PL/PGSQL PROBLEMS @ 2001-03-23 18:08 Jie Liang <jliang@ipinc.com> parent: datactrl <quals@bigfoot.com> 1 sibling, 0 replies; 3+ messages in thread From: Jie Liang @ 2001-03-23 18:08 UTC (permalink / raw) To: datactrl <quals@bigfoot.com>; +Cc: pgsql-sql You blame something should not be blamed. Jie LIANG St. Bernard Software 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 jliang@ipinc.com www.stbernard.com www.ipinc.com On Fri, 23 Mar 2001, datactrl wrote: > I found there are some problems with PL/pgSQL. > 1) 'Drop Table' doesn't work at all In general, PLSQL can only take DML instead of DDL. > 2) '--' comment causes parsing error Not true. > 3) Execute doesn't work at all. It always causes parsing error! I havn't tested, I cannot say. > > Some questions > 1) Can I use variable in FROM clause for a table name? No, table name cannot be a variable except in execute statement. > 2) Can I use variable in WHERE such as xxx = variable? Same as 1). > > JACK > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://www.postgresql.org/search.mpl > ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-03-23 18:08 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2001-03-23 09:10 SOME PL/PGSQL PROBLEMS datactrl <quals@bigfoot.com> 2001-03-23 13:46 ` Richard H <dev@archonet.com> 2001-03-23 18:08 ` Jie Liang <jliang@ipinc.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox