| Knowledge Base Article #154 - Error : Cannot Insert NULL into ("PB"."USERS"."USER_ID") |
|---|
| Date | Aug 6, 2007 |
| By | Ross P |
| Filed Under | PowerBase |
| Class | General |
| |
| Issue Addressed |
|---|
| When trying to add new users to PowerBase, the error message "Cannot Insert NULL int ("PB"."USERS"."USER_ID")" is displayed and the new user will not save. |
| |
| Causes of Issue |
|---|
| This issue may appear for PowerBase customers using the Oracle platform. This is due to a missing trigger in certian versions of the PowerBase database structure. |
| |
| Solution to this Issue |
|---|
The following script needs to be run on the database as user PB.
CREATE OR REPLACE TRIGGER SET_USER_ID BEFORE INSERT ON PB.USERS FOR EACH ROW BEGIN SELECT PB.USER_ID_GEN.NEXTVAL INTO :new.USER_ID
FROM dual;
End SET_USER_ID;
The sequence USER_ID_GEN should already be in the database, but if it is not�
CREATE SEQUENCE PB.USER_ID_GEN
START WITH 450
MAXVALUE 1999999999
MINVALUE 1
NOCYCLE
CACHE 20
NOORDER;
|
| |
| Other Comments |
|---|
| Users that are missing this trigger may be missing another. Please refer to this article. |