Re: [SQL] plpgsql grief

2001-02-12 Thread Tom Lane
Michael Ansley <[EMAIL PROTECTED]> writes: > I thought that the discussion on this topic resolved that the AS syntax > would work as I described, and the INTO syntax would be removed because of > ambiguity, to be redeveloped at a later date? INTO has indeed been removed. However, AS does not do

Re: [SQL] plpgsql grief

2001-02-12 Thread Josh Berkus
Michael, > I thought that the discussion on this topic resolved that the AS > syntax would work as I described, and the INTO syntax would be removed > because of ambiguity, to be redeveloped at a later date? * Tom (I believe) was referring to CREATE TABLE AS as a way to i

Re: [SQL] plpgsql grief

2001-02-12 Thread Josh Berkus
Tom, > > (and keep in mind > > that Postgres functions currently have trouble with NULLS as > > input parameters). > > Not in 7.1 they don't ... Really? Terrific. Sadly, I have 25+ PL/pgSQL functions not set up to accept NULLs ... Can you point me to (or tell me where to search) the developer

RE: [SQL] plpgsql grief

2001-02-12 Thread Michael Ansley
Title: RE: [SQL] plpgsql grief I thought that the discussion on this topic resolved that the AS syntax would work as I described, and the INTO syntax would be removed because of ambiguity, to be redeveloped at a later date? -Original Message- From: Tom Lane [mailto:[EMAIL PROTECTED

Re: [SQL] plpgsql grief

2001-02-12 Thread Josh Berkus
Rob, >Just need the info - i can do the rest. I also, due to my > business requirements, need to do this as quickly as possible - maybe > not the expert you perhaps are No expert at all, according to Tom Lane. > As it goes I've implemented most of what I wanted in pl/tcl (having > learned tcl

Re: [SQL] plpgsql grief

2001-02-12 Thread Tom Lane
Michael Ansley <[EMAIL PROTECTED]> writes: > create function testfunc (text) returns int4 as ' > declare > sql varchar; > begin > sql=''SELECT id AS res2 FROM ''||$1 ; > execute sql ; > return res2; > end; > ' language 'plpgsql' ; > Please note the AS syntax rather than INTO. That won't

Re: [SQL] plpgsql grief

2001-02-12 Thread Tom Lane
"Josh Berkus" <[EMAIL PROTECTED]> writes: > Thus your only way to get stuff back from EXECUTE is to save > the results you want to a temporary table (using CREATE > TABLE AS ...), and read them back using a query. Not > high-performance, but it gets the job done. That's not the only way; you c

Re: [SQL] plpgsql grief

2001-02-12 Thread Michael Fork
> Thus your only way to get stuff back from EXECUTE is to save > the results you want to a temporary table (using CREATE > TABLE AS ...), and read them back using a query. Not > high-performance, but it gets the job done. > I believe this statement is incorrect, quoting Michael Ansley <[EMAIL

Re: [SQL] plpgsql grief

2001-02-12 Thread Josh Berkus
Rob, > I figured moving some 'simple' db code from my > application to it's more > natural home in the db would work out. Bummer. Not only > do i have to run > 7.1 (beta 4) to be able to dynamically generate queries, > I'm finding it > *extrememly* difficult to get to get my simple functions > to

RE: [SQL] plpgsql grief

2001-02-12 Thread Michael Ansley
Title: RE: [SQL] plpgsql grief Hi, Rob, From the conversation taht Tom Lane got involved with earlier after my last posting on this toping I think that you need to change your first function to this: create function testfunc (text) returns int4 as ' declare   sql varchar; begin

[SQL] plpgsql grief

2001-02-12 Thread rob
Hi, I'm having some real headache problems here. Apologies for the length, i just want to get it all out now :) I figured moving some 'simple' db code from my application to it's more natural home in the db would work out. Bummer. Not only do i have to run 7.1 (beta 4) to be able to dynamically g