Board index » delphi » Trigger string concatenating

Trigger string concatenating

Has anyone ever encountered a problem with concatenating more than one
string into a variable in a trigger?  It seems to work ok with two strings,
but even if I try:
ParentText = 'Enc: '||ENCOUNTR.ENC_TYPE;

ParentText = :ParentText||' at ';

                            ParentText = :ParentText||ENCOUNTR.SITE_CD;

and try to insert that :ParentText variable into a database field, it's
empty.

Any thoughts?
TIA,
Kathy

 

Re:Trigger string concatenating


Kathy,

probably one of your fields is NULL?

Btw, if your trigger is for the table ENCOUNTR, then you should
use the context variables OLD. or NEW. (depends on your type
of trigger, BEFORE/UPDATE).

HTH,
Thomas Steinmaurer
IB LogManager 2.0 - The Logging/Auditing Tool for Interbase and Firebird
http://www.iblogmanager.com

"k.reczkiewicz" <k.reczkiew...@attbi.com> schrieb im Newsbeitrag
news:3cfe4268$1_2@dnews...

Quote
> Has anyone ever encountered a problem with concatenating more than one
> string into a variable in a trigger?  It seems to work ok with two
strings,
> but even if I try:
> ParentText = 'Enc: '||ENCOUNTR.ENC_TYPE;

> ParentText = :ParentText||' at ';

>                             ParentText = :ParentText||ENCOUNTR.SITE_CD;

> and try to insert that :ParentText variable into a database field, it's
> empty.

> Any thoughts?
> TIA,
> Kathy

Re:Trigger string concatenating


Hi K.

Quote
> ParentText = :ParentText||' at ';

This ":" confuses me a bit.
Have you tried

ParentText = ParentText||' at ';

??

Regards,

Other Threads