pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: ddurst@larubber.com
Cc: pgsql-sql@postgresql.org
Subject: Re: LONG - Question on dealing w/ numerics
Date: Tue, 28 Jan 2003 23:08:16 -0500
Message-ID: <19082.1043813296@sss.pgh.pa.us> (raw)
In-Reply-To: <34281.216.86.192.34.1043801682.squirrel@www.la-rubber.com>
References: <34281.216.86.192.34.1043801682.squirrel@www.la-rubber.com>

"David Durst" <ddurst@larubber.com> writes:
>   insert into journal_lines (entry_id,account_id,line_type,line_amount)
> values (eid,aid,ltype,amount);
>   select into line * from journal_lines where entry_id = eid AND
> account_id = aid AND ltype = ltype;

I bet that last should be line_type = ltype?

One thing you have to watch with plpgsql's SELECT INTO is that it
doesn't complain if the WHERE would match multiple rows.  You get
one of the rows, and no indication that others would have matched.

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <19082.1043813296@sss.pgh.pa.us>
Permalink:  ../19082.1043813296@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19082.1043813296@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, ddurst@larubber.com
  Subject: Re: LONG - Question on dealing w/ numerics
  In-Reply-To: <19082.1043813296@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox