Subject Re: [firebird-support] Indirect value
Author Hans
Just the only thing I'm missing for a general after
insert/update/delete trigger to replicate :)

----- Original Message -----
From: "Teträm Corp" <dev@...>
To: <firebird-support@yahoogroups.com>
Sent: Saturday, February 07, 2009 11:50 AM
Subject: Re: [firebird-support] Indirect value


> Hi
>
> if you were in before update trigger, you could do this with
>
> execute statement 'select ' || colname || ' from mytable where ... '
> into :colvalue;
>
> but in after update, I guess you have to use a way to store your value
> in before update trigger and retrieve it in after update.
> e.g. context, temporary table, etc
>
> Thierry
>
> Hans a écrit :
>>
>> Hi, my question
>>
>> Is it possible, say in a after update trigger to retrieve
>> the value of a column 'Name' indirectly somewhat
>> alike
>>
>> Suppose Old.Name contains 'Hans'
>> -----
>> declare variable ColName Varchar(8);
>> declare variable ColValue Varchar(255);
>> begin
>> ColName = 'Name';
>>
>> ColValue = ['Old.' || ColName] ;
>> -----
>> The value of ColValue at this point = 'Hans'
>>
>> Best Regards
>> Hans
>>
>>
>
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>
>