Re: Using Cobol - Inserting same data into a DB2 table every every week/until a condition is met




"yukongal" <yukongal@xxxxxxxxxxxxx> wrote in message
news:8gESh.2097$Q23.997@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I have a requirement as follows:

I have a COBOL+DB2 program that inserts data into a DB2 table when >an
order is placed. Now, The same data should be inserted into the same
table after every 7 days until a condition is met. This means I need
to insert same data after every 7 days until the order is approved/
denied.

Any help would be highly appreciated.

I see this and my mind is saying 'DUPLICATES!'.

Eileen, I think the OP wasn't clear about the key structure. It would be
fair to assume (although dangerous, as assumptions usually are...) that as
the periodicity of this data is important, the key probably contains a date
and/or time. Given a seven day separation, duplicates will not occur.

Why in the world would they want the same data inserted everyday unless
there is some sort of purging done each night.

They don't. Have another look at the statement of the problem... :-)

From a business standpoint I don't see the value of this - but for
homework I suppose it's possible :)


I don't think it's homework (it is too stupid to be contrived.... :-) much
more likely to be real world... ); even if it is, it won't do any harm for
someone to have a look at how DB2 deals with triggers and stored
procedures...

So - look up INSERT, PRIMARY KEYS, CURRENT TIMESTAMP and DUPLICATES -
happy -806 (if memory serves).

Good advice... and probably helpful :-)

Pete.


.