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

Re: Command Line Interface -- AP Transactions

On 9/22/06, Brian Kimmel <..hidden..> wrote:
Error: Error: Error: INSERT INTO acc_trans (trans_id, chart_id, amount,
transdate,  project_id, memo, fx_transaction, cleared)
 VALUES (10211, (SELECT id FROM chart WHERE accno = ''),
600 * -1, '09-22-2006',  NULL, NULL,  '0', '0')

ERROR:  null value in column "chart_id" violates not-null constraint

The problem seems to be in the "WHERE accno = ''", since that query is
returning the null value and then trying to insert that into acc_trans
as the chart_id value (which has a not null constraint).

This might give you a hint as to the problem. I'll have a look at it
and see where that SQL is being triggered and see if I can come up
with a suggestion and let you know what I find.