Here's the thesis:We want to be able to construct an extensible database structure such that we are able to add fields(content) on the fly using data deploy. There should not be the need to alter the table schemas.USUALLets take scenario A. We have a DCR with 10 fields. We create a database table with fields corresponding to the record items. Limitations - were we to add new fields to the templates, we would be stumped. THESISUse a Hashmap structure in the database to store all database items as key value pairs. Actually it would consist of more than 'keys' and 'values'. At this time, I feel it should be field name, field value, record name, environment(multiple servers sharing the same schema).Thoughts? Inputs? Suggestions?We plan on using SQL Server 2000. On OD 6.1.1. TS 6.7.1
The first question is whether the DB supports modification to the schema without requiring that the entire table be dropped and re-created.Assuming that is possible - I'd probably opt for using Perl DBI (or the Java equivalent if you're so inclined) rather than DD - since DD doesn't have the flexibility you're looking for and my guess is that it would be a non-trivial change to the code so you'd be lucky to see it changed before next year (if that).
But is it necessary for a solution to have to re-create the tables? The thinking behind the thesis is to utilize a HASH MAP/MATRIX structure to store all relevant data.Have a table IWOV_REOCRDS with the fields:1. ItemName (nchar)/varchar2. ItemValue (nchar)/varchar3. DCRName4. DCRType5. PATH (DD Variable) for deletionsAll DCR values are inserted into such a structure using DD scripts. That way we do not customize DD per se.Will a 'select' statement from a JSP/Java program incur a huge CPU Cycle? The number of records will be in millions, but isn't that what happens in Insurance/Banking sectors anyway? We could index the records and have keys in place to improve performance.This sort of structure gives me the flexibility to add/delete/modify fields at will, without having to re-create the schemas/tables.
Again - what does the DB actually support?DD used to support a "narrow-tuple" format table that was extensible because it had (if I recall) only 4 columns: path, status, key, valueThe main problem with this is the potential for reaching some limitation on the number of rows you can insert into the table.
For a "wide-tuple" format table - you have separate columns for each key (into which the value is stored).To repeat myself: if you're using a particular DB - you have to find out if the DB supports modification of the schema (for a wide-tuple format) without requiring the dropping and re-creation of the table. If it does, you will probably be able to utilize it via your own code more easily and quickly than you will through DD.
...you have to find out if the DB supports modification of the schema (for a wide-tuple format) without requiring the dropping and re-creation of the table....
If you're looking to design and develop your own DB - that's a whole other ball game - but it didn't sound like that was what you wanted to do.
Rajat,Just a suggestion,I think you have a set of fields that will be more or less constant. Keep them on one table and add any new fields (on the fly) on a second table that will be connected to the first table through a foreign key.Now,In the second table, keep the columns something like thisForeign Key --- Prop-ID Field-Name(on the dcr) valueI think this will allow a simpler approach to the design Regards,Amlan
I am attaching herein a structure similar to what I am trying to achieve. This is the manner in which the table would keep on progressing. Once the fields are finalized, I don't see us adding any more columns, only rows of data.