I am running the following query in IBM data studio but it does not write the file to my library, it errors out without a description of the error. Can anyone help, is there something wrong with my syntax?
DROP TABLE IF EXISTS DANBLIB/FILE1;
CREATE TABLE DANBLIB/FILE1 AS
(
SELECT HHIITMN AS "Product Number", SUBSTR(HHIDTES,5,2) ||
SUBSTR(HHIDTES,7,2) || SUBSTR(HHIDTES,1,4) AS "Transaction Date"
FROM S2151BDW.PWRDTA.HHIORDDP --Order Detail History
WHERE HHICMPN = ' 1'
ORDER BY HHIDTES
) WITH DATA;