http://qs321.pair.com?node_id=518250


in reply to Perl or SQL ?

Here's my take on this. Given that the sysaudits tables can be very large I would use a perl script to generate the view, and then use bcp to extract the data.

My reasoning is that bcp will pull data out from Sybase much faster than DBD::Sybase can (much less overhead), so assuming that the views cover a fairly large subset of the sysaudits tables you could potentially gain quite a lot of time.

The view is only needed so that you can use bcp (bcp will not accept any WHERE qualifiers as you know, but others here might not), and generating it in the perl script on the fly and dropping it once the request is done seems perfectly reasonable. You would probably want to create the view in the tempdb database to avoid any unnecessary database polution.

Michael