Re: OUTPUT ... and File Layout
Posted in 2003
Dirk Moolman wrote:
> I am generating a script using an unload - actually an output statement:
>
> output to med_h.sql without headings
> select unique "update statistics high for table "||trim(tabname)||"("||trim(coln> ame)||") distributions only;"
> from systables a, syscolumns b, sysindexes c
> where a.tabid = b.tabid
> and b.tabid = c.tabid
> and b.colno = c.part1
> and a.tabid > 99
> and tabtype = "T"
>
> The problem is that, the lines are too long and get cut in half, for example
>
> update statistics high for table zzz_cont_contrib(serial_no) dist
> ributions only;> (2 separate lines)
>
> and this gives me syntax errors. Is there an easy way to generate these lines so that they are actually one line inside the output file ?
There are various tricks, but most will involve post editing the output.
You will find sed very useful for that.
If you want a quick fix, then make sure the 2 lines break at a
convenient position by replacing one of the double pipes with a comma.
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mdstock@MydasSolutions.com |//////// /|
| Mydas Solutions Ltd http://MydasSolutions.com |///// / //|
| +-----------------------------------+//// / ///|
| |We value your comments, which have |/// / ////|
| |been recorded and automatically |// / /////|
| |emailed back to us for our records.|/ ////////|
+----------------------+-----------------------------------+-----------+