Forum Replies Created
-
AuthorPosts
-
kmoonMemberpeterlaursen wrote on Nov 1 2005, 12:38 PM:And …
If the Primary Key is an autoincremented integer it is very simple
Code:delete from `dbname`.`tablename` where `id` < 1234[post=”7771″]<{POST_SNAPBACK}>[/post]Yes, I got that, but how do I tell yog which row ID to delete up to. (in a batch job)
(once again thank you for your help )
kmoonMemberI already have a DATETIME field but I guess I would need the TIMESTAMP as well.
Unfortunately me webhost is running MySQL 4.0 which apparently does not support this function.
Is is possible to truncate only up to a specific row ID instead?
Meaning:
I do a sync rows 0 to n.
I delete or truncate rows from 0 to n.
Rows added in the meantime will have values n + *
kmoonMemberpeterlaursen wrote on Nov 1 2005, 10:28 AM:After that you truncate the database/tables at the webhost.If you want it all done in one operation you create a
for the sync and a for truncation of the database/tables. You can then create a .bat file like Code:sja syncjob.xml
sja notifyjob.xmlHow to use the TIMESTAMP depends on the MySQL version. With a more recent version you can define it as
Code:default NOT NULL on UPDATE CURRENT_TIMESTAMPNow the server will automatically update the timestamp whenever there is any change. Check the MySQL docs for your MySQL version for more detailed description (look in … column types .. data and time variables)
And I repeat: don't forget to set 'NEVER DELETE' option! 😀
[post=”7762″]<{POST_SNAPBACK}>[/post]Mange tak.
But since I am a complete novice in these things I am afraid I will need even more help.
How do I create the batchfiles?
I a command prompt?
What is “truncate” and how do I use it?
How do I insert my own SQL statements like the TIMESTAMP thing…?
Anyway, I am very happy to hear that it IS possible. That is a really great help to me.
kmoonMemberpeterlaursen wrote on Oct 28 2005, 11:23 PM:hmmmm …I understand you like this:
You have a webhost with limited space and a localhohost with more space. Data added at the webhost should be transferred to the local host.
If that is it you can run a one-way sync webhost >> localhost an use the NEVER DELETE option.
Was that it? If not you must explain somewhat better!
[post=”7721″]<{POST_SNAPBACK}>[/post]I have a webhost with very limited space for MySQL database.
I need to transfer all data from one table at the webhost to a local host once pr day.
AND I need to delete all data from same table in order to free up the space again.
Data should of course be APPENDED to the localhost database.
I don't think I can explain it any better.
Thanks for replying.
-
AuthorPosts