Re: [GENERAL] Problem running or executing a function in Postgresql

2005-09-01 Thread Venki
l Message---   From: Richard Huxton Date: 09/01/05 15:57:21 To: Venki Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Problem running or executing a function in Postgresql   Venki wrote: >  Hi, > > I have a table named mydata > CREATE TABLE public.mydata ( > id int4 DEFAU

Re: [GENERAL] Problem running or executing a function in Postgresql

2005-09-01 Thread Michael Fuhr
On Thu, Sep 01, 2005 at 11:58:27AM +0530, Venki wrote: > > new_id = EXECUTE("SELECT FROM currval("mydata_id_seq")"); The above line has quoting problems and an erroneous SELECT query, and it wouldn't work anyway because that's not the way to retrieve results from EXECUTE. Aside from that, EXECU

Re: [GENERAL] Problem running or executing a function in Postgresql

2005-09-01 Thread Richard Huxton
Venki wrote: Hi, I have a table named mydata CREATE TABLE public.mydata ( id int4 DEFAULT nextval('public.mydata_id_seq'::text) NOT NULL, name varchar(50) ) WITH OIDS; and I have a function as follows CREATE OR REPLACE FUNCTION insertmydata(varchar) RETURNS int as ' declare new_id integer; b

[GENERAL] Problem running or executing a function in Postgresql

2005-09-01 Thread Venki
 Hi,   I have a table named mydata CREATE TABLE public.mydata ( id int4 DEFAULT nextval('public.mydata_id_seq'::text) NOT NULL, name varchar(50) ) WITH OIDS;   and I have a function as follows CREATE OR REPLACE FUNCTION insertmydata(varchar) RETURNS int as ' declare new_id integer; begin IN