MySQL Forums
Forum List  »  Triggers

Re: trigger
Posted by: aleksandar cuturilo
Date: January 28, 2014 03:49AM

this is my database, it is in Croatian because it is difficult to translate the names of tables
1. TABLICE
customers
id : number ( 10 )
code : varchar2 ( 10 )
name : varchar2 ( 30 )
Address : varchar2 ( 50 )
user_added : varchar2 ( 30 )
date_added : date
user_changes : varchar2 ( 30 )
date_changes : date


cost Centers
id : number ( 10 )
code : varchar2 ( 10 )
name : varchar2 ( 30 )
user_added : varchar2 ( 30 )
date_added : date
user_changes : varchar2 ( 30 )
date_changes : date


goods
id : number ( 10 )
code : varchar2 ( 10 )
name : varchar2 ( 30 )
selling_price : number (8.2 )
tags_confirmation : varchar2 ( 1 ) ( N or D )
user_added : varchar2 ( 30 )
date_added : date
user_changes : varchar2 ( 30 )
date_changes : date


groceries
id : number ( 10 )
code : varchar2 ( 10 )
name : varchar2 ( 30 )
user_added : varchar2 ( 30 )
date_added : date
user_changes : varchar2 ( 30 )
date_changes : date


composition
id : number ( 10 )
id_product : number ( 10 )
id_groceries : number ( 10 )
Quantity : number ( 6.3 )
user_added : varchar2 ( 30 )
date_added : date
user_changes : varchar2 ( 30 )
date_changes: date


1.2 . Tables documents ( transport table )

Accounts (header )
id : number ( 10 )
id_customer : number ( 10 )
id_mt : number ( 10 )
No. varchar2 ( 10 )
date : date
Description : varchar2 ( 50 )
confirmation_mark : varchar2 ( 1 ) ( N or D )
user_added : varchar2 ( 30 )
date_added : date
user_changes: varchar2 ( 30 )
date_changes : date


Accounts ( items )
id : number ( 10 )
account_ID : number ( 10 )
id_product : number ( 10 )
Quantity : number ( 10,2 )
selling_price : number (8.2 )
user_added : varchar2 ( 30 )
date_added : date
user_changes : varchar2 ( 30 )
date_changes : date


1.3 . derived table

output_foods
id : number ( 10 )
date : date ;
id_mt : number ( 10 )
id_groceries: number ( 10 )
Quantity : number ( 10,2 )
user_added : varchar2 ( 30 )
date_added : date
user_changes : varchar2 ( 30 )
date_changes : date



I'm interested in how to do this part:
Selling price of the item is filled with accounts of fields Selling price of the product.
b)The product must have at least one food composition.
This is checked on line:
AUR trigger when the products can "see" the old value in oznaka_potvrde = N,
a new value = D calls a procedure that checks the rule.
c)Quantity field in the table output_groceries is calculated once a day.
Remembers the total amount of input supplies for the day and MT.
When processing a document heading confirmation_mark changing from N to Y.

Options: ReplyQuote


Subject
Views
Written By
Posted
2277
January 27, 2014 05:07AM
1160
January 27, 2014 10:41PM
Re: trigger
1621
January 28, 2014 03:49AM
1904
January 28, 2014 09:13AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.