Multiple Select into outfile

Edwin's profile image Edwin posted 4 years ago in Running SQL scripts Permalink

I m trying to run a query in HeidiSQL 11.0.0.5919. If I run only one of two SELECT statements, everything works fine. If I want to run both SELECT statements as one I keep getting SQL error 1064

Any ideas what to change to the code?

SELECT id, date, customer_id INTO OUTFILE 'orders.txt' CHARACTER SET utf8 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM orders;

SELECT order_id, line_number, quantity, discount, price INTO OUTFILE 'order_line_items.txt' CHARACTER SET utf8 FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM order_line_items;

Thanks!

ansgar's profile image ansgar posted 4 years ago Permalink

This is a cross-post. The original post is on Stackoverflow: https://stackoverflow.com/questions/64697817/multiple-select-into-outfile

Please login to leave a reply, or register at first.