Solved

How to rotate the text to 90 degrees?

Posted on 2014-04-07
2
336 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 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 500 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

839 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