Results 1 to 3 of 3

Thread: Query Output

  1. #1
    Join Date
    Feb 2004
    Posts
    24

    Unanswered: Query Output

    I am very new to Sybase. Is there a way to output my query to txt or csv file. I know I am able to do this in Oracle with the spool command. Is there anything similar in Sybase? I would like to do it within the Sybase prompt and not through isql or bcp.

  2. #2
    Join Date
    Feb 2004
    Posts
    28

    Re: Query Output

    Can you be specific about what "Sybase prompt" is that you are referring to?
    There is a way to generate comma separated files using ISQL and BCP.

    From isql, connect with these options:

    isql -s"," -w 999 -U user -P paswd -S server -o outputfile -i input_sql.sql

    This option will give the comma separated output of all queries. For this you will have to put sql statements into an inputfile. There is no way to change the column separator on the fly once you log in through isql. And also, you cannot generate an output file within isql.
    However, there is a tool available(thankfully!) that does what you require. Name of the tool is sqsh. To put it simply, this is an infinitely improved brilliant version of isql. I highly recommend it.

    To download it, visit - http://www.sqsh.org


    j


    Originally posted by abe6162
    I am very new to Sybase. Is there a way to output my query to txt or csv file. I know I am able to do this in Oracle with the spool command. Is there anything similar in Sybase? I would like to do it within the Sybase prompt and not through isql or bcp.

  3. #3
    Join Date
    Feb 2004
    Posts
    24

    Re: Query Output

    When I meant sybase prompt, I meant the prompt that ISQL takes you too. But you have answered my questions. Thanks! I try to use the program you recommended!


    Originally posted by abe6162
    I am very new to Sybase. Is there a way to output my query to txt or csv file. I know I am able to do this in Oracle with the spool command. Is there anything similar in Sybase? I would like to do it within the Sybase prompt and not through isql or bcp.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •