Hey guys,

cause i am a really newbie on creating functions in database
especially h2 i need your help.

Here is an function that i have to reproduce:

create or replace function unpack_trackinginfo (p_trackchar
all_rsc_data.ordchar%type)
return varchar2 is
  l_res varchar2(8);
begin
  select decode(bitand(to_number(ascii(p_trackchar)),1),1,'1','0') ||
       decode(bitand(to_number(ascii(p_trackchar)),2),2,'1','0') ||
       decode(bitand(to_number(ascii(p_trackchar)),4),4,'1','0') ||
       decode(bitand(to_number(ascii(p_trackchar)),8),8,'1','0') ||
       decode(bitand(to_number(ascii(p_trackchar)),16),16,'1','0') ||
       decode(bitand(to_number(ascii(p_trackchar)),32),32,'1','0') ||
       decode(bitand(to_number(ascii(p_trackchar)),64),64,'1','0')
into l_res
  from dual;
  return l_res;
end;
/

How could i do that? I have created an test alias and it works but
this is an number to big for me.:-(

Regrads,
Jochen

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to