I'm using dotConnect's LINQ. Our postgres db uses sequences to generate unique primary integer keys. How do I get the nextval from a sequence? I cannot use ExecuteCommand since it doesn't return the new value. Please provide an example.
Thanks for your help.
How to use Sequence to generate primary key
Anyway without trigger?
Thanks for the response, AndreyR.
We have other code that uses ODBC to work with the database. It would all need to be changed to use the trigger. Is there a way to use sequences without changing the database?
We have other code that uses ODBC to work with the database. It would all need to be changed to use the trigger. Is there a way to use sequences without changing the database?
Try defining the column in the following way:
Set the properties like I have described in the previous post, this should help.
Please let me know if anything goes wrong.
Code: Select all
id integer DEFAULT nextval('autoinc_seq'::regclass)
Please let me know if anything goes wrong.