Re: Aleatory exception - found cause

From: "Sabin Coanda" <sabin(dot)coanda(at)deuromedia(dot)ro>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Aleatory exception - found cause
Date: 2007-11-23 11:42:50
Message-ID: fi6ebi$26l$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

Finally I found the cause of the problem.

I found deeper inside my calls, a function which has to return an integer
column from a RECORD rec variable. The rec is assigned with the following
statement:
EXECUTE 'SELECT pk AS "PK" FROM "my_table" WHERE my_where_clause'
INTO rec.

When my_where_clause is not fulfilled, rec is initialized somehow with null.
The exception is rised at the end where I call:
RETURN rec."PK"

Maybe someone can explain this behavior.

TIA,
Sabin

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Louis-David Mitterrand 2007-11-23 17:06:12 Re: dynmic column names inside trigger?
Previous Message Martin Marques 2007-11-23 10:37:24 Re: PL argument max size, and doubt