Generation of automatic unique identifier such as CUSTOMER_ID

From: Tim Corke <timbono1_at_hotmail.com>
Date: 16 Mar 2003 06:03:03 -0800
Message-ID: <679f10e2.0303160603.7ec204af_at_posting.google.com>



Hi,

[Quoted] I cannot seem to get this function to work on my database. Once alert button1 is selected I want to get a unique indentifier to appear in my forms.

This PL/SQL runs from a WHEN-BUTTON-PRESSED trigger from my MENU block to P_CUST block.

declare         

	alert_button NUMBER;
	X NUMBER;
BEGIN
	alert_button := Show_Alert('CHOOSE_CUSTOMER');
	


	
	 IF alert_button = ALERT_BUTTON1 THEN	
	
	SELECT COUNT(*)
	INTO X
	FROM P_CUST;
	
	 		IF X = 0 THEN 
			:P_CUST.PC_ID := 1;
			
	END IF;
	 	GO_ITEM('P_CUST.PC_FNAME');
	 	

	 	
	 		ELSE IF alert_button = ALERT_BUTTON2 THEN
	 		GO_ITEM('C_CUST.CC_NAME');
	 	
	 END IF;
	 END IF;
	 

END; I am running a PRE-BLOCK trigger that is SELECT MAX('PC_ID')+1

		INTO :P_CUST.PC_ID
		FROM P_CUST;

This will be repeated for C_CUST also.

Any ideas???

Many Thanks
Tim Received on Sun Mar 16 2003 - 15:03:03 CET

Original text of this message