General information
Category:
Coding, syntax & commands
Thank you Gregory,
but it's in vfp6, so I can't use strconv() function.
I found on web, maybe useful for somebody else, who uses oracle:
create or replace function to_dec ( p_str in varchar2, p_from_base in number default 16 ) return number
is
l_num number default 0;
l_hex varchar2(16) default '0123456789ABCDEF';
begin
if ( p_str is null or p_from_base is null )
then
return null;
end if;
for i in 1 .. length(p_str) loop
l_num := l_num * p_from_base + instr(l_hex,upper(substr(p_str,i,1)))-1;
end loop;
return l_num;
end
sqlexec(h,"select to_char(to_dec('84028A8918BE04')) from dual")
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only