More SQL questions

bmcferon

ADSM.ORG Member
Joined
Feb 4, 2003
Messages
73
Reaction score
0
Points
0
Website
http
Is there a way to "shorten" returned columns from a select query. Example:



When I select from the summary table, the ENTITY column is incredibly long:



ENTITY

----------------------------------------------------------------



how could I shorten it to be like this:



ENTITY

----------------------------------------



Any suggestions?, This would greatly help in formatting text for daily reports, and dumping data to statistics databases.
 
My answer would be: Yes and No



No, by using the default output from TSM there is no way that I know of to shorten the column width.



HOWEVER,



Yes if I get the output in either tab or comma delimited, and format it myself using either perl or Korn shell scripts.



To get the data in either tab or comma delimited format, from the command line you type: "dsmadmc -tabdelimited ...." or "dsmadmc -commadelimited ....". Remember, to output you results to a file and then process the file to the desired output. Also, note that if you do things this way you can either print or not the header information at the top serveral lines of the file.
 
WOW, I did not know this but it looks like you can manipulate the column length in the SQL select statement. For details, see the following resource:



IBM Redbook Publication: SG24-6554-00

Tivoli Storage Manager Version 5.1: Technical Guide



In particular see Appendix A.



I guess this still means that if your not doing SQL statements you still sunk, and have to look at what I suggested before, with formating yourself.



I hope that helps,

Andy.
 
<TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Quote:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><BLOCKQUOTE>WOW, I did not know this but it looks like you can manipulate the column length in the SQL select statement. For details, see the following resource:



IBM Redbook Publication: SG24-6554-00

Tivoli Storage Manager Version 5.1: Technical Guide



In particular see Appendix A.



I guess this still means that if your not doing SQL statements you still sunk, and have to look at what I suggested before, with formating yourself.



I hope that helps,

Andy.

</BLOCKQUOTE></FONT></TD></TR><TR><TD><HR></TD></TR></TABLE>



No this is great, I figured there was a way to do it, just didnt know how or where to look to find out. I use tabdelimited for a few choice things, but in reporting, mostof the time outputting to a file lays out everything correctly anyway (example select * from syscat.columns , If you did this inside the admin client, it returns things in "paragraph" format rather than row/column format, however output to a file, and it is in row/column) I only use KSH script for specific line editing when I absolutely cannot format in TSM.



Brandon
 
Back
Top