Subject | Re: [firebird-support] bde error caused by trigger |
---|---|
Author | Lucas Franzen |
Post date | 2003-11-18T12:10:48Z |
> In the table it's a varchar(20) field, but it contains only integers.declare variable tmpnr VARCHAR(20);
> That's why I pad it with zeros. (btw is there a nicer way to do this?)
tmpnr = CAST ( NEW.PERS_NUMBER AS VARCHAR(20) );
WHILE ( TMPNR NOT LIKE ( '____________________' ) DO
BEGIN
/* the compariosn consists of 20 * '_' */
/* --> if you always want to pad it to the length of 20 */
tmpnr = '0' || tmpnr;
END
NEW.PERS_NUMBER = tmpnr;
Luc.