Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
change output of table strings and numbers using ascii value modification
--convert any column of tables to its ascii value for some range and apply logic. --if some one has better query let me know. declare v_ascii varchar2(50); out_res varchar2(30); out_str number; output_str varchar2(30); --employee.person_name%type; cursor c1 is select person_name,deptno from employee; --select '1234'person_name from dual; begin --v_ascii varchar2(10); for rec in c1 loop out_res := null; v_ascii := rec.person_name; dbms_output.put_line('result are :'||v_ascii); for i in 1 .. length(rec.person_name) loop out_str :=ascii(substr(rec.person_name,i,1)); if out_str between 65 and 98 then --dbms_output.put_line('letters are:'||' '||substr(rec.person_name,i,1)||' ascii value is: '||out_str); output_str :=chr(out_str+7); out_res :=out_res||output_str; --dbms_output.put_line('result is :'||out_res); else out_str :=ascii(substr(rec.person_name,i,1)); if out_str between 48 and 57 then --dbms_output.put_line('letters are:'||' '||substr(rec.person_name,i,1)||' ascii value is: '||out_str); output_str :=to_number(out_str mod 10); out_res :=out_res||output_str; end if; end if; --dbms_output.put_line('result is :'||out_res); end loop; dbms_output.put_line('result is :'||out_res); end loop; end;
run
|
edit
|
history
|
help
0
fff
Patient0021
TRIGGER
PL/SQL variables and constant
First_Last_Day
DECODE() example
HELLO WORLD
BCOM
ff
scott