Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
dbschema.cfg - additional column
Wiesel
Hi,
I have a dbschema.cfg which adds all the dcr-data to the table as it should.
But I have a problem to add one column to the table which does not take any data from the dcr. This is necessary because I need this column to set and increment a counter from my java application and so the value should not be overwritten when the dcr is saved again.
Any ideas?
Thanks,
Wiesel
Find more posts tagged with
Comments
Migrateduser
why not manually alter the table with a database script after the IW setup is complete?
Wiesel
That may be a solution but I have to do that for about 60 branches which represent different branches of a bank. It is overhead enough to create all the different tables (of course, this is not the only table I need) for every branch so I am looking for a solution to avoid adding the column manually.
Migrateduser
have you tried manually modifying the dbschema.cfg files? you might try to add a column node for your counter
<column name="counter" data-type="NUMBER" value-from-field="not-used" allows-null="no" replicant-order-column="no"/>
Wiesel
Yes, I have tried it with INTEGER instead of NUMBER because I have DB2 database.
But after the setup has completed, the table (with the column counter) was empty and there was this line for every replicant, that should be a row in the table, in the log-file:
Column COUNTER not found in array
Here is a snippet of my dbschema.cfg
<column name="kategorie" data-type="VARCHAR(64)" value-from-field="kategorie" allows-null="no" is-url="no" />
<column name="loc_download" data-type="VARCHAR(128)" value-from-field="download/[0-50]/download/0/eigener/0/file/0/lokale_datei" is-replicant="yes" allows-null="yes" is-url="no" />
<column name="zib_download" data-type="VARCHAR(128)" value-from-field="download/[0-50]/download/0/eigener/0/file/0/zib_datei" is-replicant="yes" allows-null="yes" is-url="no" />
<column name="incl_download" data-type="VARCHAR(128)" value-from-field="download/[0-50]/download/0/zib/0/zib_datei" is-replicant="yes" allows-null="yes" is-url="no" />
<column name="rep_order" data-type="INTEGER" value-from-field="not-used" allows-null="no" replicant-order-column="yes" />
<column name="counter" data-type="INTEGER" value-from-field="not-used" allows-null="no" replicant-order-column="no"/>
and without the last line it works.
Migrateduser
well you could try manually haxxoring the _dd files, just make sure to put the column in the correct place.
you could also add the item to the DCT, create the tables successfully, than remove the refrence from the datacapture.cfg, dbschema.cfg, and _dd file.
just suggestions as im not sure these will work.
is there any reason why you arent using a database counter?
we have a hidden item which calls an inline database callout, which in turn gives us a counter in the dcr.
Wiesel
In the _dd file the column is correct so I do not see any reason to modify this file.
It is also too much overhead to add the item to these files, create the table and then edit all the files again to remove the item. Then it would be more efficient to make an ALTER TABLE after setup.
I am not sure what you mean with the database counter. In my case I need this column to increase the value every time, a download is clicked on the site (by calling a servlet) because I have to know, what the top 5 downloads are.
Perhaps my way is the wrong one and this problem should be solved in a completely other way.