My 2nd question really was 'How far into the future do you want the dates in the mysql table to go '.

It could get more complicated if you want to detect changes to the 2 oracle tables. Assuming the record count is in the hundreds, it might be simpler just to delete all future records and regenerate the table each night.

As a starter idea, here is a test script that generates the records you would need to insert.

#!perl use strict; use DBI; use Time::Piece; use Time::Seconds; my %regular = ( Mon => ['08:00','17:00'], Tue => ['08:00','17:00'], Wed => ['08:00','17:00'], Thu => ['08:00','17:00'], Fri => ['08:00','17:00'], Sat => ['08:00','12:00'], Sun => ['00:00','00:00'], ); my %except = ( '2016-05-30' => ['00:00','00:00'], '2016-07-04' => ['00:00','00:00'], '2016-09-05' => ['00:00','00:00'], '2016-10-10' => ['00:00','00:00'], '2016-11-08' => ['00:00','00:00'], '2016-11-11' => ['00:00','00:00'], '2016-11-24' => ['00:00','00:00'], '2016-12-26' => ['00:00','00:00'], ); my $t = localtime; my $end_date = '2016-12-31'; open OUT,'>','all_dates.csv' or die "$!"; my $id = 1; while ($t->ymd le $end_date){ my $ymd = $t->ymd; my $w = $t->wdayname; my $open = $except{$ymd}[0] || $regular{$w}[0]; my $close = $except{$ymd}[1] || $regular{$w}[1]; my $is_closed = ($open eq '00:00') ? 1 : 0; print OUT "$id,$ymd,$w,$open,$close,$is_closed\n"; $t += ONE_DAY; ++$id; } close OUT;
poj

In reply to Re^3: Pull data from two tables, insert into new table? by poj
in thread Pull data from two tables, insert into new table? by Hans Castorp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.