Home > Archive > Cobol > April 2007 > Re: Using Cobol - Inserting same data into a DB2 table every every week/until a condi
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: Using Cobol - Inserting same data into a DB2 table every every week/until a condi
|
|
| yukongal 2007-04-10, 7:55 am |
| >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!'. Why in the world would they
want the same data inserted everyday unless there is some sort of purging
done each night. From a business standpoint I don't see the value of
this - but for homework I suppose it's possible :)
So - look up INSERT, PRIMARY KEYS, CURRENT TIMESTAMP and DUPLICATES -
happy -806 (if memory serves).
| |
| Pete Dashwood 2007-04-10, 6:55 pm |
|
"yukongal" <yukongal@sbcglobal.net> wrote in message
news:8gESh.2097$Q23.997@newssvr17.news.prodigy.net...
>
>
>
> 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.
|
|
|
|
|