Link to home
Start Free TrialLog in
Avatar of yahoo80
yahoo80Flag for United Kingdom of Great Britain and Northern Ireland

asked on

forms:Trigger bad bind variable

oracle 10g
Im trying to run a trigger in insert button in oracle forms. It did work in sql developer, but doesnt compile in forms builder

I get the message:
error 49 at line 4, column 6
bad bind variable 'customer.text_buyerid'

I compared names of customers tried to run it as :buyerid as well. Similar code works for other block so cant understand whats wrong...
Ive also tried to put the trigger in customer block in buyerid item, but no luck again...

I thought it might be different data format as in sql dev ive got customer as varchar2(6) and in forms char(7), but cant be bothered to upload 23k lines of data to change varchar to char
trigger from forms button:
CLEAR_FORM; 
:GLOBAL.mode := 'INSERT'; variable
SELECT chr(66)|| custseq.nextval
INTO :customer.text_Buyerid
FROM DUAL;

thats the same trigger but in customer block in buyerid item:
IF :SYSTEM.RECORD_STATUS = 'NEW' AND :buyerid IS Null THEN  
SELECT chr(66)||custseq.NEXTVAL INTO :buyerid FROM DUAL;
   END IF; 

trigger from sql dev:
create or replace TRIGGER NEWCUSTOMER
BEFORE INSERT ON CUSTOMER
FOR EACH ROW 
WHEN (new.BUYERID IS NULL) 
BEGIN
 SELECT chr(66)|| CUSTSEQ.NEXTVAL   
 INTO   :new.buyerid   
 FROM   dual; 
END;

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of flow01
flow01
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial