RE: assci

RE: assci

 

  

The following function will work for you ... with the limit of only being
able to run against strings that are 500 in length max.

Change the definition of the variable to increase this.

create or replace function temp (in_string varchar2) return varchar2
as
in_len number;
cur_pos number;
out_string varchar2(1000);
Begin
in_len:=length(in_string);
cur_pos:= 1;
while cur_pos <= in_len
loop
out_string := out_string||ascii(substr(in_string,cur_pos,1));
cur_pos := cur_pos + 1;
end loop;
return out_string;
end;

SQL> select temp('ABCD') from dual;

TEMP('ABCD')
----------------------------------------------------------------------------
----
65666768


-----Original Message-----
From: Info Marpol
[mailto:oracledba-ezmlmshield-x43562183.[Email address protected]
Sent: Friday, December 03, 2004 11:52 AM
To: LazyDBA Discussion
Subject: assci


I have ORACLE 9i

I would like to convert the VARCAH2 string value into ASC number value

Like: 'ABC' into 656667
And also 656667 into 'ABC'

Regards!

Hine






--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html



--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html

Oracle LazyDBA home page