473,761 Members | 10,276 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
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_ATTRIBUT ES 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 1636
ronverdonk
4,258 Recognized Expert Specialist
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
2237
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 product in the database with that ID (primary key), just UPDATE the price, and if there is no product with that ID it should do an INSERT for that item. Now I've tried it in several ways and I can't seem to get it to execute
0
613
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 command runs, so that long before it's over, you Bennett> have some idea of what the total running time will be? Bennett> The way I did it was to write a perl script that takes the total range of Bennett> values for the primary key field in the...
0
5913
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: foriegn key error. I have written example code to use in reproducing the problem: # Create the table
0
2366
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 the table has a NOT NULL restriction on the field, the insert still completes successfully, but transforms the NULL value to an empty string. The preferred behavior would be for mysql to emit and error and not accept the attempt to set a NULL...
4
3265
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
1593
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 end. In the middle each table can have some additional fields from 0 to n depending on how many fields have been inserted by who created the table.
15
4639
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 communicate with a MySQL database table on a web server, from inside of my company's Access-VBA application. I know VBA pretty well but have never before needed to do this HTTP/XML/MySQL type functions.
20
4283
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 is structured as an upside-down tree, and (if I remember correctly) never more than 4 levels. The site basically grew (like the creeping black blob) ... all the pages were created in Notepad over the last
1
1772
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 iteration. How can I optimize the mysql query in order to make it faster? table tblOutgoing has an unique id slog_id. if not, how can I add indexes to this table? this table is constantly queried (selects/updates/inserts) based on several field...
0
9531
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9957
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9905
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3881
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2752
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.