[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

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 work

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 work :-(

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 grin 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 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 notes