Subject Re: [firebird-support] Copy Table
Author Thomas Beckmann
Hi Woody,

I think, it's neither intended to, nor necessary to alter structure of
old backup tables to meet current version. If I understood right, it's
just intended to have a snapshot of the data on regular basis for backup
purpose.

I would not call it "old school", but a design decission: I'm really
used to have my databases do their stuff on their own, without any other
piece of software...

Thomas

>
> *From:* atunccekic@... <mailto:atunccekic@...>
> *Sent:* Friday, April 04, 2014 6:12 AM
> *To:* firebird-support@yahoogroups.com
> <mailto:firebird-support@yahoogroups.com>
> *Subject:* Re: [firebird-support] Copy Table
>
>
> Thank you Thomas
> Sometimes I may add fields to the master table and if I write all the
> fields explicitely, I will need to modify the stored procedure. I want
> to ensure to make an exact copy. So what I want to is:
> 1- Get the structure of the master table
> 2- Create a table with the year-month-day postfix
> 3- Copy all data from the master to the backup table
>
> If it's possible to do this within a stored procedure, I will go that way.
> If not, I'll do it from a client program.
> Now I do these manually:
> -Copy the ddl text, change the table name to let's say TblA
> -Create table TblA_2014_04_01 (columns..)
> -Insert into TblA_2014_04_01 select * from TblA
>
>>>
>
>
> How will you handle adding the new fields to existing "backup" tables?
> How will the procedure know which is a new field and which is not
> without looking at the structure of all the past tables created?
>
> IMHO, creating new tables for each month will become more of a nightmare
> as time goes by. I would think the better solution would be to create
> one backup table with a field for the year and month to distinguish the
> records. Trying to keep up with dynamic DDL changes for an unknown
> number of tables seem to be more of a pain than it's worth. Then again,
> maybe I'm just too old school about databases and still believe the best
> way to control DDL is outside the database, not inside. :)
>
> Woody (TMW)
>

--
Mit freundlichen Grüßen,

Thomas Beckmann
Diplom-Informatiker


Wielandstraße 14c • 23558 Lübeck
Tel +49 (22 25) 91 34 - 545 • Fax +49 (22 25) 91 34 - 604
Mail thomas.beckmann@... <mailto:thomas.beckmann@...>

ASSFINET-Logo

*ASSFINET Dienstleistungs-GmbH*
Max-Planck-Straße 14 • 53501 Grafschaft bei Bonn
info@... <mailto:info@...> • www.assfinet.de
<http://www.assfinet.de/>

Geschäftsführer: Dipl. Wirtschaftsinformatiker Marc Rindermann
Registergericht Koblenz HRB 23331

Diese E-Mail enthält vertrauliche Informationen. Wenn Sie nicht der
richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben,
informieren Sie bitte sofort den Absender und vernichten Sie diese Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist
nicht gestattet.