Home » Fusion Middleware & Colab Suite » Business Intelligence » How to convert number to ASCII
How to convert number to ASCII [message #465887] Thu, 15 July 2010 22:18 Go to next message
gacon1982
Messages: 7
Registered: July 2010
Junior Member
Hi every body
I have a problem .

In file RFT . I create a number automatic increase .
<?xdoxslt:set_variable($_XDOCTX,'NUM',0)?>
<?xdoxslt:set_variable($_XDOCTX,'NUM',xdoxslt:get_variable($_XDOCTX,'NUM')+1)?>
<?xdoxslt:get_variable($_XDOCTX,'NUM')?>

I will have NUM = 1 , 2 , 3 ,4 ..vv.vv
But I want NUM = A , B , C , D ...v.vv or I , II , III , IV
Help me ...
Thanks
Re: How to convert number to ASCII [message #465903 is a reply to message #465887] Thu, 15 July 2010 23:45 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: How to convert number to ASCII [message #465958 is a reply to message #465903] Fri, 16 July 2010 02:30 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
What is 'vv.vv'?

By
Vamsi
Re: How to convert number to ASCII [message #465970 is a reply to message #465958] Fri, 16 July 2010 03:09 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
"etc.", I guess.

gacon1982, we have a problem: as long as it is relatively simple to match numbers 1, 2, 3 with letters A, B, C, what would you want to do once numbers (and their letter pairs) reach the last letter (Z)? What comes next?

Roman numbers (I, II, III, IV, ... MCMLXVIII) are, whoa, another story. There's no 1:1 relationship, so you'd probably have to work a little bit harder in order to make it work.
Re: How to convert number to ASCII [message #465974 is a reply to message #465970] Fri, 16 July 2010 03:30 Go to previous messageGo to next message
gacon1982
Messages: 7
Registered: July 2010
Junior Member
thanks for your reply
Littlefoot , I would like to convert max number = 26 , ex : 1,2,3 ...26 respectively A,B,C ....Z . finish.
My English not very good , help me please...
Re: How to convert number to ASCII [message #465979 is a reply to message #465974] Fri, 16 July 2010 03:51 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't use Business Intelligence, but - if you could create a (database? BI?) function, it would be something like this - of course, regarding your statement that only 26 numbers are possible:
0         1         2
01234567890123456789012345
ABCDEFGHIJKLMNOPQRSTUVWXYZ
SQL> create or replace function fun_letter (par_number in number)
  2    return char
  3  is
  4  begin
  5    return (chr(par_number + 65));
  6  end;
  7  /

Function created.

SQL> select fun_letter(8) I, fun_letter(13) N, fun_letter(20) U from dual;

I  N  U
-- -- --
I  N  U

SQL>
Re: How to convert number to ASCII [message #465982 is a reply to message #465979] Fri, 16 July 2010 04:03 Go to previous messageGo to next message
gacon1982
Messages: 7
Registered: July 2010
Junior Member
Thanks Littlefoot .
But I can not call function from BI , because I have numbers automatically increase from BI .
<?xdoxslt:set_variable($_XDOCTX,'NUM',0)?>
<?xdoxslt:set_variable($_XDOCTX,'NUM',xdoxslt:get_variable($_XDOCTX,'NUM')+1)?>
<?xdoxslt:get_variable($_XDOCTX,'NUM')?>

and I must convert the number ('NUM' as 1,2,3..) to character A , B , C ...
Help me please ..
Re: How to convert number to ASCII [message #465986 is a reply to message #465982] Fri, 16 July 2010 04:14 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
As I said: I don't know BI. But, from what I can tell, it *could* be (but probably is not) something like

<?xdoxslt:set_variable($_XDOCTX,'NUM',xdoxslt:fun_letter(get_variable($_XDOCTX,'NUM')+1))?>
Re: How to convert number to ASCII [message #465991 is a reply to message #465986] Fri, 16 July 2010 04:56 Go to previous messageGo to next message
gacon1982
Messages: 7
Registered: July 2010
Junior Member
Thanks Littlefoot
But not call user-defined function from BI . I have tried but not been...
Headache
Re: How to convert number to ASCII [message #465995 is a reply to message #465991] Fri, 16 July 2010 05:00 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm sorry, I can't help any further.
Re: How to convert number to ASCII [message #465998 is a reply to message #465995] Fri, 16 July 2010 05:20 Go to previous messageGo to next message
gacon1982
Messages: 7
Registered: July 2010
Junior Member
Thanks Littlefoot , you are my best friend .
Please also discuss this issue
Help me please !
Re: How to convert number to ASCII [message #465999 is a reply to message #465995] Fri, 16 July 2010 05:21 Go to previous messageGo to next message
ramoradba
Messages: 2456
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
I am not using BI but I just tried to help you ..
While searching on google I found that you can use "EVALUATE" function for this
Using which one can call the defined functions so that yo can use little foot function I guess

Good luck

sriram Smile
Re: How to convert number to ASCII [message #466005 is a reply to message #465999] Fri, 16 July 2010 06:06 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Check whether following is helpful for you or not.
xdofx:chr
xdofx:decode
position

By
Vamsi
Re: How to convert number to ASCII [message #466100 is a reply to message #466005] Fri, 16 July 2010 20:26 Go to previous messageGo to next message
gacon1982
Messages: 7
Registered: July 2010
Junior Member
Vamsi kasina,I have tried but not been...
Re: How to convert number to ASCII [message #471123 is a reply to message #466100] Thu, 12 August 2010 07:33 Go to previous message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
I too didn't get before.
After I install latest version, I could see A, B, C for 1, 2, 3.
What is your version?

But I've used position. Anyway you've initialized to zero and increasing by 1.
If you are doing that by row by row, you can use
<?xdofx:chr(64 + position())?>

Some how if we use xdoxslt and xdofx, it is erring out.

By
Vamsi
Previous Topic: Data level Security
Next Topic: Installation of OBIEE in Unix hangs and don't complete
Goto Forum:
  


Current Time: Thu Mar 28 09:34:11 CDT 2024