archiving table records to another table by trigger(move daialy table records to weekly table, evry day)



Category : Databases

I have written this trigger in mysql 5:


create trigger changeToWeeklly after insert on tbl_daily for each row
begin
insert into tbl_weeklly SELECT * FROM vehicleslocation v
where v.recivedate < curdate();
delete FROM tbl_daily where recivedate < curdate();
end;


i want to archive records by date, move yesterday inserted record from dailly to weekly table and last weekly table to mounthly table and deletes this records from previous table
this trigger has following error when insert in daily tabled occurred :
"Can't update table 'tbl_daily' in stored func


View Replies

Related to : archiving table records to another table by trigger(move daialy table records to weekly table, evry day)


How to use triggers to move records from main table to history table
Category : ASP & ASP.net

Dear Members,

Can anybody tell me how can i move records from main table to history table using triggers. I have used magic tables with triggers to do so with help of one friendSandeep

create table t1(id


View Replies


Move million records from MEMORY table to MYISAM table
Category : Programming Languages

I am looking for a fast way to move records from a MEMORY table to MYISAM table. MEMORY table has around 0.5 million records. Both tables have exactly the same structure (same number of columns, data types etc.). But the MYISAM table is indexed (B-TREE) on a few columns. There are around 25 colum


View Replies


Combine multiple records in a table into one field in another table based on fields in a third table
Category : Databases

I have three tables:


Table 1:
pid, name, address
1 Dale BLANK
Table 2:
pid, moid
1 12
Table 3:
moid, address
12 123 Main
12 12 South
12 99 North

For output I need:



View Replies


mysql join show all records in left table with a flag for matching records in right table
Category : Databases

I need a help from mySQL Join tables which should list all users in 'Table A' and also should show flag by matching records in 'Table B'


Table A (users)
=====================
id | name
=====================
1 | aaa
2 | bbb
3 | ccc
4 | ddd

View Replies


Postgresql code to copy one table records to another table by comparing each table
Category : Development
Have any one knows how to copy one table records to another table by comparing each tables postgresql code.
Here is the best explanation : Ive got 2 tables Table_A and Table_B. Both tables are same. That means Table_B is clone of Table_A and i want to use Table_B as a backup table. Now i want t

View Replies


Having problem copy all records from 1 table to another with same structure and Delete All Records In one table in ASP.NET C# codes
Category : ASP & ASP.net
Having problem copy all records from 1 table to another with same structure and Delete All Records In one table in ASP.NET C# codes

hi all, what i do is i save records&nbsp;into 3&nbsp;temporary table which is Temp1F ,Temp2F, and Temp3F, after i press confirm button, all records of temp1f,


View Replies


How to automatically create new records in a foreign table when inserting records in a primary table.
Category : ASP & ASP.net

Ok, I'm really new at this, but I am looking for a way to automatically insert new records into tables.&nbsp; I have one primary table with a primary key id that is automatically generated on insert&nbsp;and 3 other tables that have foreign keys pointing to the primary key.&nbsp; Is t


View Replies


Select records from mysql table one by one - dynamic table with more records continuously being written
Category : Programming Languages

I want to select one record at a time from a MySQL table. I found a similar post on SO here -


How to select records one by one without repeating


However, in my case, the table size is not fixed, The data is continuously been added to the table and I want to select one rec


View Replies


How best to update client table records with a dozen or so changed records from another table?
Category : Development
We have a table (tblClients) with several thousand records.
Because of organizational structure, changes to those records
are maintained in a separate database. Weekly, about a dozen
or so clients change phone numbers, addresses or something.
The table housing changed client data

View Replies


Help with MySQL query, insert records in table based on records in another table
Category : Databases
Help with MySQL query, insert records in table based on records in another table
 
Hi,
I need some help with a MySQL (5.6.14) query.
I have a table "blades". This table contains blade server records, including the following columns:
-enclosure_name

View Replies


2012 / 2017 Copyrights BigHow , All Rights Reserved .