Hello i created a procedure that takes a string and sum all characters in ascii code in this string and gives the output here’s my procedure
CREATE OR REPLACE function ASCII_SUM (RECID IN VARCHAR2)
return number
IS
SUMM NUMBER:=0;
ASCI VARCHAR2(100);
begin
FOR J IN 1 .. LENGTH(RECID)
LOOP
ASCI:=TO_NUMBER(ASCII(SUBSTR(RECID,J,1)));
SUMM:=SUMM+ASCI;
END LOOP;
return SUMM;
end;/
so i have a table called t1
col1 col2
EGP12863 a
EGP12864 b
EGP12865 c
EGP12866 d
EGP12867 e
what i want is to filter on this select statement by their ascii code LETS SAY the ascii sum of EGP12863 is 480 i want to do something like that
select * from t1 where ASCII_SUM(col1)=480