Re: A solution to SQL reformatting problem (fwd)
Posted in 1992
Steve Price writes (quoting cauhape@twg.com (Jeff Cauhape x7147)) > > I've found a solution for UNIX systems. Sort of ... /usr/gdc/fcddev 10> stty columns 1000 unknown mode: columns uname -a gives: OSx64 moses 5.0d-900928 0909i Pyramid-9815 HP-UX gdc A.08.00 B 9000/855 116104132 I tried 'setenv COLUMNS 1000; tset -Q' on both boxes, but that didn't have much effect either (except that the menu's didn't display right out of isql). > > It appears that sql looks at the width of the output device as defined > >by the "columns" variable in the stty data structure when it makes a decision > >to change format or not. To fool sql into not changing the format, reset the > >value of columns variable in your current session to be wide enough that > >sql thinks there's enough room. > >I then reset the columns width to 1000 characters. > >From here I run my sql script and it writes one record per line. Remember to > >reset your tty device back when your done. Could you let us know what it *does* work on, please ? Ta ! Suppose it also requires that the script is running on a terminal ? As in, if I run a cron job, it doesn't get a tty and so I can't stty the line. > stty 80 # this is not really needed, since shell can not > # reset stty values for parent shell This *is* really needed, since this is a line driver thing, not a shell environment thing. > Steve Price UNIX: pacbell!pbhyf!rsprice PHONE: (510)823-1951 Nice idea, thanks. Shame it doesn't work everywhere, though. Cheers - Tony. _________________________________________________________________________ Tony Heskett th@bnr.co.uk Phone: (+44) 279 402637 BNR, London Road, Harlow, Essex CM17 9NA Fax: (+44) 279 451434