-
PaulD
Posting Freak
-
Posts: 1,061
Threads: 42
Joined: Mar 2015
Reputation:
73
I thought about trying that, but here is the problem:
An example of the SQL file being read in line by line:
Code: INSERT INTO `planner` VALUES
(1, 3, 2, 'Case #0003', '2016-01-12', NULL, '2016-01-14', NULL, NULL, 3, 0, 0, 0, 'case'),
(2, 3, 2, 'Final Confirmation', '2015-12-17', NULL, NULL, NULL, NULL, 3, 0, 0, 0, NULL),
(3, 3, 2, 'Meeting with agencies', '2015-11-11', NULL, NULL, NULL, NULL, 6, 0, 0, 0, NULL),
(4, 3, 2, 'Deadline for applicants', '2016-01-06', NULL, NULL, NULL, NULL, 0, 0, 3, 0, NULL),
(5, 3, 2, 'Deadline for Interviews', '2016-02-09', NULL, NULL, NULL, NULL, 0, 0, 3, 0, NULL),
(6, 3, 2, 'Office Party', '2015-10-14', NULL, NULL, NULL, NULL, 0, 1, 0, 0, 'standalone'),
(7, 3, 2, 'Away Day', '2015-11-19', NULL, NULL, NULL, NULL, 0, 1, 0, 0, 'standalone'),
(8, 3, 2, 'Exec Visits', '2015-12-08', NULL, NULL, NULL, NULL, 0, 1, 0, 0, 'standalone'),
(9, 3, 2, 'Accounts Due', '2016-03-08', NULL, NULL, NULL, NULL, 0, 1, 0, 0, 'standalone');
So on this table, the date is the fifth entry, and is of date format.
On this table
Code: INSERT INTO `last_viewed` VALUES
(3, 0, 19, '2015-10-16 15:03:10'),
(3, 47, 0, '2015-10-16 23:45:11'),
(3, 0, 56, '2015-10-16 23:48:47'),
(3, 66, 0, '2015-10-16 23:48:48'),
(3, 0, 45, '2015-10-17 01:05:29'),
(3, 116, 0, '2015-10-17 01:10:14'),
(3, 29, 0, '2015-10-17 01:10:43');
On this table it is the fourth, and a timestamp format.
So if I tried to get the line, and do a find and replace, how would I do that? How would I pick out the dates to be replaced from the string, and replace each one with a date that equaled that time period.
What I am trying to avoid doing is having to manually create all the data on the system (which took about 2 days to do) in order to have current dates, in order to export is as an sql file, for the refresh data procedure to read.
Hmmm. I am really stuck on this. I just had not considered the dates going out of date (so to speak) when I planned how to do this. I wonder what other demo systems do when it comes to dates?
Thanks for taking the time to read my lengthy post though, much appreciated.
Paul.
|