view with multiple tables and triggers
Date: November 03, 2009 06:47AM
Hi Friends,
I need to create a view using the following tables:
1.profile_visits_log - Fields:
id
user_id
profile_id
date
2.contacts_visits_log - Fields:
id
user_id
profile_id
date
3.express_interests - Fields:
id
form_id
to_id
msg_id
status
date
4.book_marks - Fields:
id
mark_id
our_id
Fields in the view are :
id
insert_rec_id
table_flag
date
Whenever a new record get inserted in to any one of the above
four tables, one row should be inserted in to the view,
where, insert_rec_id - last_insert_id of the table
table_flag - to identify the table.
So, this will help me to sort the records from various table
based on date/time.
I have tried to do this with triggers, but I failed to deal with
table_flag field.And I got the last_insert_id as '0'.
How can I pass the table_flag to the view?
Is there any way to do this?
Regards
Aswathy.
|
view with multiple tables and triggers |
236 | Aswathy V |
11/03/2009 06:47AM |
Sorry, only registered users may post in this forum.
© 1995-2008 MySQL AB, 2008- Sun Microsystems, Inc.