Problem with curval - Mailing list pgsql-odbc

From Mike Fahey
Subject Problem with curval
Date
Msg-id 419386D5.9060502@enter.net
Whole thread Raw
Responses Re: Problem with curval
List pgsql-odbc
This wont work because myvalue must be a record or row variable.

I'm guessing its nearly impossible to get the last inserted id from
access 2003 using
postgres odbc.

select @@IDENTITY always returns "2".

Thoughts?




create function last_insert_id(varchar,varchar ) returns integer
 as '
declare
intable alias for $1;
incolumn alias for $2;
myvalue integer;

BEGIN

for myvalue in execute  '' select  currval('''' ''
 || intable || ''_'' || incolumn
 || ''_seq'''')
'' Loop
    return myvalue;


END loop;
END;

'
 language plpgsql;



--
With best regards,

Mike Fahey - Systems Administration
********************************************************************
      ENTER.NET - "The Road to the Internet Starts Here!" (tm)
  (610) 437-2221 * http://www.enter.net/ * email:support@enter.net
********************************************************************


pgsql-odbc by date:

Previous
From:
Date:
Subject: Re: ODBC Driver stability
Next
From: Johann Zuschlag
Date:
Subject: Re: 08.00.0002 useless :-)