Home » SQL & PL/SQL » SQL & PL/SQL » printing special character
printing special character [message #340048] Mon, 11 August 2008 04:02 Go to next message
jitender.sadh
Messages: 82
Registered: May 2007
Member
hi,

I want to print A to the power B in oracle through sql or pl/sql
for example i have the pl/sql block which prints the special character

BEGIN
for i in 49824 .. 49839 LOOP
Dbms_Output.put_line(CHR(i));
END LOOP;
END;


but i want to print A to the power B(not want to calculate but, only want to display it)

best regards
jitender





Re: printing special character [message #340053 is a reply to message #340048] Mon, 11 August 2008 04:47 Go to previous messageGo to next message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What does mean "A to the power B"? Are A and B integers? What is the purpose of CHR? What is the relation between "A to the power B" and "for i in 49824 .. 49839"?
What you want is really unclear.

Regards
Michel
Re: printing special character [message #340060 is a reply to message #340053] Mon, 11 August 2008 05:23 Go to previous messageGo to next message
jitender.sadh
Messages: 82
Registered: May 2007
Member
Hi

Please find the attached file, form that I think it’s clear that what I want.

Actually we provide the facility to the user that he can select any special character from the form and when he selected it, the text field of other form is appended by the selected special character. But now the user want a facility of still have a need of writing power minus one: -1, e.g. min-1(-1 is the power of min and min is a character ).

So that when he selects min-1, then field of other form is appended by the min-1.


best regards
Jitender


Re: printing special character [message #340061 is a reply to message #340053] Mon, 11 August 2008 05:23 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Is the POWER command anything to do with what you want?
Re: printing special character [message #340063 is a reply to message #340061] Mon, 11 August 2008 05:39 Go to previous messageGo to next message
rajatratewal
Messages: 507
Registered: March 2008
Location: INDIA
Senior Member
Confused

Your requirement is not clear to me.

I didn't see any attached file.

Regards,
Rajat
Re: printing special character [message #340066 is a reply to message #340063] Mon, 11 August 2008 05:46 Go to previous messageGo to next message
jitender.sadh
Messages: 82
Registered: May 2007
Member
hi

there is some propleum in upload the file.

i do't know whats going on..

best regards
jitender
Re: printing special character [message #340067 is a reply to message #340066] Mon, 11 August 2008 05:49 Go to previous messageGo to next message
rajatratewal
Messages: 507
Registered: March 2008
Location: INDIA
Senior Member
I don't know what you are looking for.

But i am making a guess that you are looking for some concatenation opeartor in oracle.

SELECT 
 'POWER('||223||',2)' Formula  
FROM dual


Regards,
Rajat
Re: printing special character [message #340069 is a reply to message #340066] Mon, 11 August 2008 05:53 Go to previous messageGo to next message
jitender.sadh
Messages: 82
Registered: May 2007
Member
hi

actually the probleum that i want to display A to the -2/3.

best regards
jitender
Re: printing special character [message #340071 is a reply to message #340069] Mon, 11 August 2008 05:57 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
select power(5,-1*(2/3)) from dual;
Re: printing special character [message #340072 is a reply to message #340069] Mon, 11 August 2008 05:58 Go to previous messageGo to next message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Your requirements are still clear as mud.

Post, "if the client enters this and I want to return that because..."

Regards
Michel
Re: printing special character [message #340073 is a reply to message #340069] Mon, 11 August 2008 05:58 Go to previous messageGo to next message
rajatratewal
Messages: 507
Registered: March 2008
Location: INDIA
Senior Member
So what is the problem then?? Confused

Display it.

Regards,
Rajat
Re: printing special character [message #340074 is a reply to message #340071] Mon, 11 August 2008 05:59 Go to previous messageGo to next message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
If this is that ( Question ) then just:
SQL> select power(5,-2/3) from dual;
POWER(5,-2/3)
-------------
   .341995189

1 row selected.

Regards
Michel
Re: printing special character [message #340075 is a reply to message #340069] Mon, 11 August 2008 06:02 Go to previous messageGo to next message
jitender.sadh
Messages: 82
Registered: May 2007
Member
hi

please find the attached file

best regards
jitender
  • Attachment: 1.JPG
    (Size: 84.86KB, Downloaded 119 times)
Re: printing special character [message #340077 is a reply to message #340075] Mon, 11 August 2008 06:10 Go to previous messageGo to next message
jitender.sadh
Messages: 82
Registered: May 2007
Member
No Message Body
  • Attachment: 2.JPG
    (Size: 52.22KB, Downloaded 117 times)
Re: printing special character [message #340079 is a reply to message #340048] Mon, 11 August 2008 06:15 Go to previous messageGo to next message
Littlefoot
Messages: 20897
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
jitender.sadh wrote on Mon, 11 August 2008 11:02
i want to print A to the power B(not want to calculate but, only want to display it)

I *think* that this is what Jitender.sadh is looking for (which doesn't mean I know how to do that):

./fa/4774/0/
Re: printing special character [message #340081 is a reply to message #340079] Mon, 11 August 2008 06:25 Go to previous messageGo to next message
jitender.sadh
Messages: 82
Registered: May 2007
Member
hi

yeah i want the same the result as littlefoot displayed , can you tell me how can i display that.

best regards
jitender
Re: printing special character [message #340086 is a reply to message #340081] Mon, 11 August 2008 07:00 Go to previous messageGo to next message
jitender.sadh
Messages: 82
Registered: May 2007
Member
hi


I think this select statement, gives the output , which i want

SELECT 3||Chr(49842) from dual;


best regards
jitender.
Re: printing special character [message #340088 is a reply to message #340086] Mon, 11 August 2008 07:29 Go to previous message
Michel Cadot
Messages: 64130
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This works for square and cube but I don't know if it exists a predefined character for others:
SQL> SELECT 3||Chr(49842) from dual;
3|
--
3

1 row selected.

SQL> SELECT 3||Chr(49843) from dual;
3|
--
3

1 row selected.

Same thing unformatted as it seems formated does not display it cleanly:
SQL> SELECT 3||Chr(49842) from dual;
3|
--
3

SQL> SELECT 3||Chr(49843) from dual;
3|
--
3

Regards
Michel
Previous Topic: creating a unified table from many tables
Next Topic: how to extract the same date when it is last day of the month?
Goto Forum:
  


Current Time: Wed Dec 07 08:30:09 CST 2016

Total time taken to generate the page: 0.07633 seconds