[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to rotate the text to 90 degrees?

Posted on 2014-04-07
2
Medium Priority
?
347 Views
Last Modified: 2014-04-11
Hi,

 I'm on DB2 UDB 9.7.
I need to display some text to rotate to 90 degrees.
If this can be done in straight SQL (not involving any CTE), then that would be helpful.
Because, the tool we are using doesn't support CTEs.

Thank you!

Example:
If the text is : Department, then we need to display the text as:

T
N
E
M
T
R
A
P
E
D

Open in new window

0
Comment
Question by:pvsbandi
2 Comments
 
LVL 26

Accepted Solution

by:
Tomas Helgi Johannsson earned 2000 total points
ID: 39988486
Hi!

This solution shows some good reverse function and/or reqursive sql.
http://www.experts-exchange.com/Database/DB2/Q_27521882.html

This can then be use to do a simple substr(mystring,thepos,1) on the reversed string.
Best solution would be to create a function that has string as a input and outputs a resultset with the string reversed and cut into character, row by row.

Regards,
    Tomas Helgi
0
 

Author Closing Comment

by:pvsbandi
ID: 39994969
Thanks! Good idea to reverse and shrink, so it looks rotated.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question