<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.talis.com/tdn" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Talis Developer Network - formatting isql output - Comments</title>
 <link>http://www.talis.com/tdn/node/1802</link>
 <description>Comments for &quot;formatting isql output&quot;</description>
 <language>en</language>
<item>
 <title>Formatting SQL query</title>
 <link>http://www.talis.com/tdn/node/1802#comment-709</link>
 <description>&lt;p&gt;You can do this using the Sybase substring command.  The figure is the starting point in the string and the second number is the number of characters to be displayed.&lt;/p&gt;
&lt;p&gt;select BARCODE,&lt;br /&gt;
substring(SURNAME,1,30) SURNAME,&lt;br /&gt;
substring(FIRST_NAMES,1,30) FIRST_NAMES&lt;br /&gt;
from BORROWER&lt;br /&gt;
where BORROWER_ID between 1000 and 1050&lt;/p&gt;
&lt;p&gt;When you use substring then the attribute names for those columns are not displayed as headings.  By adding a name at the end these can be added back (as above)&lt;/p&gt;
&lt;p&gt;However isql is limited in what you can do formatting-wise.  More can be done by using Talis Decisions or PERL scripts.  There is a TDN article about creating CSV files called &lt;a href=&quot;/tdn/system/files?file=art_lm181pl01.pdf&quot;&gt;Creating a CSV file of borrower information&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Brian Crampton&lt;br /&gt;
Developer, Talis&lt;/p&gt;
</description>
 <pubDate>Wed,  1 Oct 2008 15:02:58 +0100</pubDate>
 <dc:creator>Brian Crampton</dc:creator>
 <guid isPermaLink="false">comment 709 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>formatting isql output</title>
 <link>http://www.talis.com/tdn/node/1802</link>
 <description>&lt;p&gt;For someone out there in sql land this should be easy! I have retrieved a list of borrower names and barcodes (BARCODE, SURNAME, FIRST_NAMES) and want to set the columns in the output file so they are shortened to 30 spaces per column instead of the default settings. This is to enable me to play around with it in Excel. Any suggestions how I can do this? Thanks&lt;/p&gt;
</description>
 <comments>http://www.talis.com/tdn/node/1802#comments</comments>
 <category domain="http://www.talis.com/tdn/taxonomy/term/60">Talis Library System</category>
 <pubDate>Wed,  1 Oct 2008 14:06:00 +0100</pubDate>
 <dc:creator>CTHOMAS</dc:creator>
 <guid isPermaLink="false">1802 at http://www.talis.com/tdn</guid>
</item>
</channel>
</rss>
