Search Postgresql Archives

Re: plpgsql function errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 04, 2005 at 11:40:50AM -0600, Juan Casero (FL FLC) wrote:
> Hi Everyone -
> 
> I am new to this list and although I have been using postgresql on and
> off for about a year now.  I am trying to develop a webapp using perl
> and cgi with postgresql 7.4.6 as a backend database.  One of the things
> I need is to create a transactions table that will record a row of data
> and then return the transaction id to the caller.  I have decided to
> implement this piece of the webapp as a stored procedure in pl/pgsql.
> The following is the source code...

Firstly, I think you should look up the documentation for nextval(),
currval(). There is no possiblity of returning the wrong value even if
another transaction is running concurrently. And you don't need to lock
the table, which is good for performance.

<snip>

> # select
> trx_id(JUANCASERO3055128218,CREDIT,02/02/05,1,1,Aventura,02/01/05,Tom);
> 
> I get the following error message
> 
> ERROR:  column "juancasero3055128218" does not exist

You need to put those values into strings. Unless you do that it thinks
you're referring to a column named that. Try:

select trx_id('JUANCASERO3055128218','CREDIT','02/02/05',1,1,'Aventura','02/01/05','Tom');

Hope this helps,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: pgp2PNGDHW35d.pgp
Description: PGP signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux