Re: dbaccess sql output
Posted in 1997
}>From ilist@rmy.emory.edu Thu Apr 24 18:41:34 1997
}>Received: from rmy.rmy.emory.edu by hobbes.dbintellect.com via ESMTP (940816.SGI.8.6.9/930416.SGI.AUTO)
}> for <settler@dbintellect.com> id SAA28168; Thu, 24 Apr 1997 18:41:33 -0600
}>Received: (from ilist@localhost) by rmy.rmy.emory.edu (8.7.1/8.7.1) id TAA09626 for informix-list-out; Thu, 24 Apr 1997 19:05:01 -0400 (EDT)
}>From: Jacob Salomon <jake@apparel.net>
}>Message-Id: <E95x7B.En9@nonexistent.com>
}>Subject: Re: dbaccess sql output
}>Date: Fri, 25 Apr 1997 00:57:08 GMT
}>Reply-To: jake@apparel.net
}>Organization: ApparelNet Inc.
}>Sender: informix-list-owner@rmy.emory.edu
}>To: informix-list@rmy.emory.edu
}>X-Informix-List-Id: <news.37088>
}>
}>Terron Wright wrote:
}>>
}>> Is there away to force a sql dbaccess script to produce output with each
}>> record being displayed horizontally? My script is:
}>>
}>> select * from atable
}>>
}>> The output looks like this:
}>>
}>> acolumn1 test
}>> acolumn2 test2
}>> acolumn3 test3
}>> acolumn4 test4
}>>
}>> I would like for the report to look like this:
}>>
}>> acolumn1 acolumn2 acolumn3 acolumn4
}>>
}>> I can do this if I do a select and put in each individual column but
}>> that is time consuming. Does anyone have a solution or suggestion?
}>
}>Terron,
}>
}>I've tried soooo many tricks! Using environment variables ROWS, COLUMNS
}>after altering my screen window. Nothing helps. Methinks the screen
}>size of 80x24 (how quaint ;-) is hard coded into dbaccess.
}>
}>The only way I have been able to do this is by running the SQL statement
}>in an ACE report, which seems to assume a wider display (132) by
}>default.
}>--
}> -- Jake (In pursuit of undomesticated aquatic avians)
}>
}>+-----------------------------------------------------------+
}>| Impeccable Logic: A thought process which successfully |
}>| resists chicken bites |
}>+-----------------------------------------------------------+
}>
A rather kludgey method, but you could do this:
UNLOAD TO 'filename' DELIMITER ' '
SELECT whatever FROM tablename;
This unloads (i.e., outputs) records horizontally, but
the delimiter of space is replaced by backslash. We use
UNIX sed to change the backslash to space.
-------------------------------------------------------------------
Jeff Craig | dbINTELLECT Technologies, Inc.
Senior Consultant | Golden, CO
| (303) 275-6954 ext. 8008
| email: settler@dbintellect.com
| fax: (303) 275-2134
-------------------------------------------------------------------