[thelist] dynamic table sql question

Keith Gaughan keith at digital-crew.com
Thu Apr 28 11:57:27 CDT 2005


Brian Cummiskey wrote:
> Sarah Sweeney wrote:
> 
>> Just have a client table and a jobs table, like this:
> 
> 
> 
> Sarah,
> 
> thanks for the suggestion, but its just not possible to do such a thing. 
>  The tables are generated by our dialer software, and if they were all 
> in one table, the wrong script would pop with the wrong job.
> 
> I sorta let this thread die, as i pretty much told them, its not 
> possible (in the alloted time i have to play with it).
> 
> They aren't pleased, but oh well...

Here's an idea, but it might be a pain to set up in the beginning:

Create a trigger on each one of the jobs tables on INSERTs (and maybe
UPDATEs and DELETEs too) that grabs the inserted record and puts it in
your One-True-Jobs-Table. This way it can interoperate with your
dialler (I'm rightpondian, BTW) software, and you can write nice clean
code!

The pain isn't writing the trigger code, it's that it's subtly different
for each one. I say that you write out a template of the trigger, and
then write a small script to generate the code needed to put the
triggers on each table.

K.


More information about the thelist mailing list