Alternate solution for select ... into outfile in Azure database for MySQL?

Kishore Chilaparapu 1 Reputation point
2020-09-14T16:54:06.003+00:00

We have a requirement, capture query output to output file like as below in Azure MySQL. The below query is possible in on-prem MySQL server. But we need the same in cloud PAAS solution or alternative method to achieve it

SELECT COUNT(*) FROM TEST_TABLE
INTO OUTFILE 'TEST.CSV'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
721 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Anurag Sharma 17,576 Reputation points
    2020-09-16T09:43:37.687+00:00

    Hi @Kishore Chilaparapu , Welcome to Microsoft Q&A.

    'SELECT ... INTO OUTFILE' is not supported by Azure Database for MySQL as per the article.

    However, alternatively you can use the Azure Data Factory where-in you can define mapping of the output and finally copy the data in supported data stores. Please refer to below article on how to use it and which data stores are supported.
    https://learn.microsoft.com/en-us/azure/data-factory/connector-azure-database-for-mysql

    Please let us know if this solves the issue you are facing.

    ----------

    If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.

    0 comments No comments