I have to generate incremental data records in PL SQL.
My logic is, store for each row the ASCII value of concatenated columns in that row.
So if in the future, for generating incremental data (generate data only in case if there is any modification), if any change in the record, the ASCII value will be different and on comparing the ASCII values of new and old records, I can generate only the incremental data.
But the issue I am facing is that the ASCII value being generated is similar for two totally different records.
How can I make this ASCII value unique or is there any other way?
My function for generating the ASCII value is:
create or replace
FUNCTION STRINGTOASCII
(
VALTEXT IN VARCHAR2
) return number as
ASCII_VAL number;
BEGIN
select SUM(ASCII(SUBSTR(VALTEXT,level,1)))
INTO ascii_val
from DUAL
connect by level <= length(VALTEXT)
;
return ASCII_VAL;
END STRINGTOASCII;