Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 25th, 2003, 12:41 AM
wazzag wazzag is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 wazzag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Q. about a couple of oracle commands

hi all,
got a couple of 'how to' questions about a couple of oracle commands.

First one is how do u get items in a column that you have produced from a select statement to be aligned to the right.

Second, is it possible to rename an item in a report that you have produced. For example if in the table that you created the report off, there is a column called head size and the values in that column are either S,M,L. but in the report u want those values to appear as Small, Medium,Large.

thanks, waz.

Reply With Quote
  #2  
Old September 25th, 2003, 09:13 AM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 5
Hi,
(1) You can specify alignment of a column value using SQL*Plus command:
for example in 'emp' table, you want column 'ename' to be appear right justified.

SQL>COLUMN ENAME JUSTIFY RIGHT

(2) DECODE funtion provides IF.... THEN.....ELSE implementation in SELECT statement. For example

SELECT Item#,
Ord_qty,
DECODE(Size,'S', 'Small', 'M',Medium', 'L', 'large'),
FROM Order_detail
/

If you are using Oracle9i then you can also use CASE....WHEN expression.


Regards

Reply With Quote
  #3  
Old September 25th, 2003, 01:33 PM
Dan Drillich Dan Drillich is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 68 Dan Drillich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
BTW, The CASE....WHEN expression is also available in 8.1.6.

Cheers,
Dan

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Q. about a couple of oracle commands


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway