On Wed, Jun 27, 2007 at 11:37:01AM +0200, Manera, Villiam wrote:
> To better explain my problem I attach one of my functions that is easy
> to understand.
> For each of my products I must have one main supplier and I may have
> also some secondary suppliers. 
> Therefore for each of my articles 
> I have as many records in table ANAMAT.ART_FOR as the number of my
> suppliers for that article.
> The main supplier is identified by code 1 in the column ARF_PROGR_FORN.
> Secondary suppliers are numbered as 2,3 and so on
> If, for example, I want to promote one of the secondary suppliers (let's
> say number 3) 
> to be the main one, I should issue the following update:

To be honest, it seems to me your problem is that you're trying to use
triggers for something they're not designed for. What seems to be
infinitly easier is to write a stored proc that you use like so:

SELECT promote_supplier( article, supplier );

No trigger necessary...

Have a nice day,
Martijn van Oosterhout   <[EMAIL PROTECTED]>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to 
> litigate.

Attachment: signature.asc
Description: Digital signature

Reply via email to