Oracle, BusinessObjects & PrimaryKeyIsAutoIncremented on Update


Author
Message
Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)
Group: Forum Members
Posts: 153, Visits: 462
Here is some information that may help:

The Auto Incrementing Primary Key in SQL called BAREGECLASS_PKCODEID, which works, is INT and in the SF Mapper is set to not allow Null values and no default value is set. This work for SQL perfectly.

In Oracle the Primary Key called BAREGECLASS_PKCODEID, does not have an INT type but is a type of "Numeric". The SF Business Mapper converts the Numeric to a type of "Decimal" for the BO that it generates. Since there is no such setting as auto increment of a column in an Oracle table, there is an event (TBL_BARGECLASS_1_BARGECLASS__1 sequence) in the Oracle table that increments the Primary Key when a new row is added.

The setting in the Mapper for the BAREGECLASS_PKCODEID is to not allow null values and nothing defaults on a new row. The never works regardless of the setting of PrimaryKeyIsAutoIncremented property on the BO.

If I set the property to True, when I click SAVE the error in my earlier Post occurs. If I set the value to False, then another error occurs as a result on the Primary Key being a NULL value.

To make it work without an error, I need to set the PrimaryKeyIsAutoIncremented property on the BO to "False", and then on the BO, set the Primary Key config to RETURN ALTERNATE VALUE ON NULL, and specify a value of "0". Then when I added a new row to the table no error occurs, and in the backend Oracle table the Primary Key seems to be updated, but on the screen after the update is complete, the textbox showing the Primary Key shows the default of "0". The only way to compensate with these settings seems to be to include some code in an "AfterSave" event of the BO if running Oracle to refresh the BO from the database. If this is what is needed, would you let me know what code would be needed.

Also you may want to fix this behavior. It seems like it is a bug in SF.

Ross L. Rooker, Sr.
Ross L. Rooker, Sr.
StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)StrataFrame User (195 reputation)
Group: Forum Members
Posts: 153, Visits: 462
For me it seems inserting the following code in the BO "AfterSave" event worked:

this.tbl_BargeClass_1.FillDataTable("Select * from TBL_BARGECLASS_1 WHERE BARGECLASS_PKCODEID = ( SELECT MAX(BARGECLASS_PKCODEID) FROM TBL_BARGECLASS_1 )");

this.tbl_BargeClass_1.Navigate(MicroFour.StrataFrame.Business.BusinessNavigationDirection.Last);

I would still like to know if there is a bug in the SF framework or if there may be a better approach.

 


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search