views:

66

answers:

1

I'm trying to output the results of a SELECT query to a tab delimited text file in Advantage Data Architect. I know I can use the 'Export to' feature to do this, but there are a lot of tables and that is going to take forever. I would rather use the SQL editor, but I found out it does not accept the OUTPUT TO argument, even though that command is part of Sybase SQL.

I would like to do this:

SELECT * FROM tablename;
OUTPUT TO 'C:/ExportDirectory' DELIMITED BY '\t' FORMAT TEXT;

Is there another way?

+1  A: 

Maybe someone else knows a clever way to do this, but I don't think this functionality exists natively in the Advantage SQL engine. If you are Delphi developer, one possibility comes to mind. The Advantage Data Architect ships with the source. The file texttable.pas has the bulk of the logic that writes the text file for the export functionality you mentioned.

Mark Wilkins
Thanks for the reply Mark. According to their documentation, 'OUTPUT TO' is part of the Sybase proprietary SQL syntax (equivalent to 'INTO OUTFILE' in real SQL), so I can't help but think this functionality was disabled purposely to make it extra hard to migrate away from Advantage. It sucks really. I'm going to see how far I get with SQLAlchemy and pyodbc. I'll post the results so the next poor sucker doesn't have to find this out the hard way.
likesalmon
@likesalmon: I don't think Advantage Database Server ever had support for OUTPUT TO (rather than being something that was disabled). Advantage is a completely different product from "Sybase SQL" (which I don't think is an actual product name, but maybe you are referring to Adaptive Server Enterprise or SQL Anywhere). Advantage has an ODBC driver that maybe you can use to import data into something else if that is your goal.
Mark Wilkins