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

Re: Command Line Interface -- AP Transactions

On Fri, 2006-09-22 at 12:11 -0500, Brian Kimmel 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

"(SELECT id FROM chart WHERE accno = '')" returns NULL. Therefore you
are attempting to insert rows with NULL in the chart_id column. The
chart_id column is defined as NOT NULL, so the insert is correctly
disallowed by the database and an error returned.