Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is it not a good practice to display primary key on UI?

Badam123Mar 13 2018 — edited Mar 15 2018

Hi All

Presently we get device details though a feed where multiple devices can be mapped to single CustomerId. The device details are loaded in table : TBL_DEVICES . The devices presently do not have any natural primary key so we have created a sequence as primary key . We had a new request to assign a unique key for each device so that they can be searched from the UI using the unique key (Presently they can search using CustomerId) . The team has asked me to create a new column and increment using a sequence .

TBL_DEVICES  ( Existing structure)

-----------------

DEVICE_ID         NUMBER  PRIMARY KEY using Sequence

CUSTOMER_ID  NUMBER  FOREIGN KEY

DEVICE_DESC  VARCHAR2(100) 

CAPACITY         NUMBER

Can't we use the existing primary key as a unique key? . When I asked the same they said that showing primary key on UI is not a good practice . I was not convinced as it doesn't make sense to add a column and sequence which adds no value.

Please suggest.

Thanks

Comments

Timo Hahn

User, tell us your exact JDev version, please!
You normally get this message if the VO or collection behind the LOV has duplicate entries. If you now select one of the duplicate values you get this error as the e.g. selectOneChoice can only select one.
If you use a VO behind the LOV check if you have selected a primary key in the VO and rewrite your query that it returns unique values.

Timo

User508065-Oracle

JDev version is 11.1.1.9.0
Also, the VO behind the LOV has a primary key defined.

Timo Hahn

And the query for the LOV returns unique values?
If yes, do you have a reproducible test case?
Timo

User508065-Oracle

Yes, the issue can be reproduced on one of our Fusion env. I think it will be easier to show you via a zoom if possible.

Timo Hahn

Sorry, this is a public forum and we should keep it this way. Zoom is not an option here as it would not address everybody.
I'm not the only member that might be able to help you solve the problem.
Timo

1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 12 2018
Added on Mar 13 2018
29 comments
2,489 views