Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Counters in tables

MaheshGxMar 15 2012 — edited Mar 15 2012
Hi,

I have onerequirement.

I have a table having structure as

CREATE TABLE "OMPODI"."BAR_SAP"
(
"FILENAME" CHAR(31 BYTE),
"FILEDATE" DATE,
"COUNTER" NUMBER(3,0)
)

At first it will have data as 'File', sysdate, 001.

But while inserting next time i want check if data inserted last time was on same date, if its on same date then counter should be counter + 1 else counter will be reset to 1.

How can i achieve this?

any suggestive insert statements or some way of achieveing it.

Thanks and Regarsds,

Mahesh
This post has been answered by Nicosa-Oracle on Mar 15 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 12 2012
Added on Mar 15 2012
19 comments
1,875 views