Subject | Trigger problem |
---|---|
Author | bossman@i4free.co.nz |
Post date | 2001-10-06T23:11:39Z |
Hi folks,
Got a table with fields in it. What i'd like to do is to put a vaue
into a field via a trigger (this is fine and can do it).
what i want then to do is to do a commit retain so the value that was
just placed to appear on the screen (another words refresh the view).
also how do you use a procedure via a trigger ???
I've tried putting a procedrue in there btu no joy either.
I'm totally lost on it.
Used this one and works!
Set ^;
create TRIGGER "CUSTS" FOR "CUSTOMERS"
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
if (new.custnum is null) then
New.custnum = gen_id(custnum_id,1);
END^
set term ;^
Error message as per dailog box - IBconsole.
Dynamic SQL Error
SQL error code = -104
Token unknown - line 8, char 11
SQL
Statement: alter TRIGGER "CUSTS" FOR "CUSTOMERS"
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
if (new.custnum is null) then
begin
New.custnum = gen_id(custnum_id,1);
EXEC SQL
commit retain;
end
END^
set term ;^
I have a number of manuals (pdf, text, html and win help files) but
they don't give enough info/samples.
any help muchly appreciated.
dave.
Got a table with fields in it. What i'd like to do is to put a vaue
into a field via a trigger (this is fine and can do it).
what i want then to do is to do a commit retain so the value that was
just placed to appear on the screen (another words refresh the view).
also how do you use a procedure via a trigger ???
I've tried putting a procedrue in there btu no joy either.
I'm totally lost on it.
Used this one and works!
Set ^;
create TRIGGER "CUSTS" FOR "CUSTOMERS"
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
if (new.custnum is null) then
New.custnum = gen_id(custnum_id,1);
END^
set term ;^
Error message as per dailog box - IBconsole.
Dynamic SQL Error
SQL error code = -104
Token unknown - line 8, char 11
SQL
Statement: alter TRIGGER "CUSTS" FOR "CUSTOMERS"
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
if (new.custnum is null) then
begin
New.custnum = gen_id(custnum_id,1);
EXEC SQL
commit retain;
end
END^
set term ;^
I have a number of manuals (pdf, text, html and win help files) but
they don't give enough info/samples.
any help muchly appreciated.
dave.