Home > Archive > ASE Database forum > April 2005 > writing recordset to ascii file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author writing recordset to ascii file
VMI

2005-04-09, 8:26 pm

How can I write a recordset to an ascii file? I have to add
this functionality to a stored procedure.

Thanks.
Bret Halford

2005-04-09, 8:26 pm



VMI wrote:

> How can I write a recordset to an ascii file? I have to add
> this functionality to a stored procedure.
>
> Thanks.


Where do you want the file - on the client machine, or the server host
machine?

This kind of thing would usually be approached on the client end. Some
clients have built-in ways to turn file logging on and off. For
instance,
SQSH http://www.isug.com/Sybase_FAQ/ASE/section9.html#9.6.1
uses shell-like redirection or pipes

1> select * from sysobjects
2> go 2>/dev/null >/tmp/objects.txt


The ISQL client doesn't have anything interactive - you can send all the
output
for the whole session to a file using the -o parameter when you invoke
it, but that
is about it.


From the server side, you can put information in files by using
xp_cmdshell
to CAT lines onto a file. You could also purchase the optional external
file systems
(XFS) license which will let you create proxy tables on file systems -
then you could
just insert your records into a proxy table mapped to a file.

-bret


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com