PgSqlLoader Insert, SetValue, AutoIncrement PK field
Posted: Thu 11 Aug 2011 14:41
Hi
I am using PgSqlLoader to Insert records into a table on a remote server.
The table we are writing to has an AutoIncrement field as its PK. We are using pgLoader.SetValue("FieldName", value) on all other fields to set its value and expecting the auto increment field to increment and update automatically. We can manually set the auto increment field in the code as above but this defeats the object.
On calling pgLoader.NextRow(); and then pgLoader.Close(); raises an exception null value in column "OIDIdcCount" violates not-null constraint
The table field in the schema is setup as "OIDIdcCount" serial NOT NULL
with the default value/sequence set to
nextval('"TblIdcCount_OIDIdcCount_seq"'::regclass)
Any ideas?
Many thanks in advance for your help
Stephen
I am using PgSqlLoader to Insert records into a table on a remote server.
The table we are writing to has an AutoIncrement field as its PK. We are using pgLoader.SetValue("FieldName", value) on all other fields to set its value and expecting the auto increment field to increment and update automatically. We can manually set the auto increment field in the code as above but this defeats the object.
On calling pgLoader.NextRow(); and then pgLoader.Close(); raises an exception null value in column "OIDIdcCount" violates not-null constraint
The table field in the schema is setup as "OIDIdcCount" serial NOT NULL
with the default value/sequence set to
nextval('"TblIdcCount_OIDIdcCount_seq"'::regclass)
Any ideas?
Many thanks in advance for your help
Stephen