Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL question
PL/SQL question [message #225787] Wed, 21 March 2007 08:57 Go to next message
leahchow
Messages: 11
Registered: June 2005
Junior Member
Hello,

I have a question about my pl/sql.

The database is poorly designed since the beginning, none of the tables have primary key and foreign key relationship. So we wrote a pl/sql code to eliminate the duplicate label serial number. The problem is when the different model of the boards run at the exactly same time at different machines to check the label serial number, they got the exactly same label serial number from the main table.

How can i add the code to solve this problem to let the label_serial_number be updated if it has more than

here is the example:

Label_serial_number, PCB_number, Prod_date_time
126980 622163 3/16/2007 4:18:05 PM
126980 622216 3/16/2007 4:18:05 PM

the attachment is the original code

Please give me advise

Thanks
Re: PL/SQL question [message #225788 is a reply to message #225787] Wed, 21 March 2007 09:02 Go to previous messageGo to next message
michael_bialik
Messages: 611
Registered: July 2006
Senior Member
What about using SEQUENCE?
Re: PL/SQL question [message #225801 is a reply to message #225788] Wed, 21 March 2007 09:43 Go to previous message
leahchow
Messages: 11
Registered: June 2005
Junior Member
Well,it cannot be sequence. when they updated the main table's (ecu_model_definition) last_label_serial_number, the number sometimes will change from 12456 to 35768, it is not always the same range.
Previous Topic: problem with evaluation of function
Next Topic: dbms_lock.sleep(15) won't stop for 15 seconds
Goto Forum:
  


Current Time: Sun Dec 04 00:33:56 CST 2016

Total time taken to generate the page: 0.15636 seconds