473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

i need to know how to update time of a table in mysql db

Hi everybody
I'm a new user for mysql,i'v an application running mysql db on a linux server ,
now i need to check the modification time of a table and compare with a previous
stored one and if it's newer it will run a script to delete some rows from it .
I wrote it with the help of a friend but i can't reach him now.
I tried the " show table status update_time " but i could not use it well
So can any one help me in this.
This is the written script:


#!/user/bin/bash
TMP_SQL_FILE=/tmp/removeData-$$.sql
/opt/ne/mysql/bin/mysql -uroot -pmysql -e"select id from NE_DSL where NAME like '%LAN'"| while read DSL_ID
do
echo "delete from NE_DSL_ATTRIBUTES where DSL_ID=$DSL_ID;" > $TMP_SQL_FILE
echo "delete from NE_DSL where ID=$DSL_ID;" >> $TMP_SQL_FILE
/opt/ni/mysql/bin/mysql -uroot -pmysql NE < $TMP_SQL_FILE
/opt/ni/mysql/bin/mysql -uroot -pmysql NE < $TMP_SQL_FILE > /dev/null 2> /dev/null
if [ $? -ne 0 ]; then
echo "Unable to remove DSL with id $DSL_ID!"
fi
done
rm $TMP_SQL_FILE



Thanks alot
Mohammed
Jan 7 '08 #1
1 1612
ronverdonk
4,258 Expert 4TB
You can only get that information when the MySQL storage engine supports the UPDATE_TIME writing. Most engines do not.

Ronald
Feb 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: a-ok | last post by:
Hi, My client has a product database od around 20000 items. And it is updated every few days when he gets a catalog from the supplier. It's supposed to work like this: if there already is a...
0
by: Michael Widenius | last post by:
Hi! >>>>> "Bennett" == Bennett Haselton <bennett@peacefire.org> writes: Bennett> Is there any way to do a long update/delete on a table such that you can Bennett> view the progress as the...
0
by: Fraser Hanson | last post by:
Hello, I have a table which has a foreign key relationship with itself. I want and expect my updates to cascade (deletes definitely cascade as expected) but instead I just get error 1217:...
0
by: Steven Hilton | last post by:
I am experiencing odd behavior, and I'm hoping someone can explain why it is behaving this way, and how to get around it... When I update a row in a table with a field's data set to NULL, but...
4
by: Ike | last post by:
Is there a way in mysql to discern when the last date/time a field, row, or table was been updated or inserted? Thanks, ike
4
by: johnny | last post by:
hi all, I hope it is easier for you to answer than for me trying to explain it... In a database I have some tables , each one has some mandatory fields at the beginning and a couple at the...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
1
by: acornejo | last post by:
Hi All I've the following code I need to optimize. Currently tblOutgoing is about 250K registers and growing at a rate of about 20k records per day. This code takes me over 5 secs to run on each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.