Please, help me!
I am a student in Technical University in Plovdiv, Bulgaria. I must finish my graduation work very soon. For the purpose I must create trigger(actually a few triggers) at run time. For my graduation work I use Borland C++ Builder 6. I use BDE palette. I try to create trigger with Query component and her property SQL.
Here is my code:
CreateTrigger->Close(); CreateTrigger->SQL->Clear(); CreateTrigger->SQL->Add("CREATE TRIGGER test_trg BEFORE INSERT ON test"); CreateTrigger->SQL->Add("FOR EACH ROW BEGIN SELECT test_seq.NEXTVAL"); CreateTrigger->SQL->Add("INTO :NEW.id FROM dual;"); CreateTrigger->SQL->Add("dbms_output.put_line(:NEW.id); END test_trg;"); CreateTrigger->ExecSQL();
This is my test. In my graduation work the name of the trigger and the name of the sequence will be fetch from Edit Boxes. That is the reason to use Add instead of put a static SQL code in SQL property.
The error that I reseve is:
Project TriggerBeforInsert.exe raised exception class EDatabaseError with message 'Create Trigger: Field 'NEW.id' is of an unknown type'. Process stopped. Use Step or Run to continue.
I think that Borland think that :New.id is a Parameter and expects to have value.
I search in internet a lot but i can't find a decision.
Please help me!
Thanks in advanced.