create or replace PROCEDURE LIBHOME(ldt zen.logdatetime%TYPE) IS
lv_count NUMBER;
BEGIN
SELECT COUNT(*)
INTO lv_count
FROM zen
WHERE TRUNC(logdatetime) = TRUNC(sysdate);
IF lv_count > 0 THEN
UPDATE zen
SET counter = counter + 1
WHERE TRUNC(logdatetime) = TRUNC(sysdate);
ELSE
INSERT
INTO zen(logdatetime, counter)
VALUES(sysdate, 1);
DBMS_OUTPUT.PUT_LINE('ONE RECORD IS ADDED......!');
END IF;
COMMIT;
END;
lResult of Above Procedure
=========================================
LOGDATETIME
10-JUL-07
I have a stored procedure (top) which will stored the date and counter.
When I run the procedure, It will produce the current date and counter will increment by 1.
Is it possible that the LOGDATETIME can display DD-MON-YYYY HH24 like the result (bottom).
Can you advice me on the coding that I should change so that the result can be like below.
Desire Result
=========================================
LOGDATETIME
10-JUL-07 15
10-JUL-07 16
10-JUL-07 17
10-JUL-07 18
10-JUL-07 19
10-JUL-07 20
Thank You very much