Data missing after generating existing table

sreenu

Member
Hi

I need to create a index for a fetch.single operation for a report.I created the index for the table and generated the table and index .After performing Fetch.single operation ,report was not displaying any data.
I browsed the table through UTB and was surprised to see 0 records.
Well if an existing table is generated ,will the data be deleted.Can anyone assist on this.

Thanks in advance
srinivas
 
Hi,

Generating a table will normally only be done when you first define the table or when you change the structure (add/remove fields). When you generate a table the existing table will first be removed from the database and hence you'll loose all your data (possible career limiting move if you start trying this over production tables!!!)

If you only want to generate the index then you need to click on the cunningly named "Generate Indexes". This will remove any existing indexes and recreate them. Your actual data won't be affected.

Regards

Neil.
 
Yes generating the table will clear the table of all the data.

sreenu <[email protected]> wrote: Hi

I need to create a index for a fetch.single operation for a report.I created the index for the table and generated the table and index .After performing Fetch.single operation ,report was not displaying any data.
I browsed the table through UTB and was surprised to see 0 records.
Well if an existing table is generated ,will the data be deleted.Can anyone assist on this.

Thanks in advance
srinivas
 
hi

Thanks men,well is there any way to get back that data for that table.

srinivas
 
Generating Table will clear data in the file.For your case generating indexes is suffice. Generating indexes will create your secondary index.
 
You're going to have to go to your backups for the data. JDE tends to drop the table at the database level as part of the generate process so it can be quite brutal. Exactly what happens depends on the database you're running.
 
Hi Srinivas,

Unfortunatelly, if you haven't any backup of your table, then there is no way to get back the data. Generate table function will execute Drop Table in the database
frown.gif


If you changed the indicies only, then you can execute Generate Indicies function Table Operation, wich will regenarate all indicies of the table and will leave your existing data untouched - as Listers previously mentioned.

If you change the table structure, then you should Generate Table, so previously you have to make a bckup of your data and later restore.
A simple way to solve it, that I used many times, is the following:

1.) Copy the original TBLE object to a temporary TBLE object.
2.) Generte the temp TBLE.
3.) Create a simple temporary Table Conversion using Map The Same option and copy your data to the temp table with the TC UBE.
4.) Generate your new table structure.
5.) Modify your TC to copy the data from the temp TBLE to the newly generated TBLE.
6.) At this point, you can add special logic too, e.g. populating new fields based on already existing data or with constant values.
7.) You have tod done it in all environment.
8.) After everything had been done, you can remove the temp TBLE from the database and delete the temporary objects as temp TBLE, TC and its version(s).

Regards,

Zoltán
 
Back
Top