in reply to Re: OT: Failing to export from DB2
in thread OT: Failing to export from DB2

Such an obvious avenue -- and it didn't occur to me. Sort of like forgetting to use strict (or maybe warnings).

Anyway, tried that with my existing code that did an execute and got:

SQL0104N An unexpected token "EXPORT" was found following "BEGIN-OF-S +TATEMENT". Expected tokens may include: "<values>". SQLSTATE=42601

I tried just using do instead of execute and got the same error. Tanktalus suggested using ADMIN_CMD(my command), which got me a different error:

SQL0104N An unexpected token "ADMIN_CMD(EXPORT TO /" was found follo +wing "BEGIN-OF-STATEMENT". Expected tokens may include: "<values>". + SQLSTATE=42601

I'm going to try a filename without any slashes to see if that works. If anyone else has any suggestions, shout them out.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Replies are listed 'Best First'.
Re^3: OT: Failing to export from DB2
by Anonymous Monk on Mar 31, 2009 at 06:27 UTC
    That makes it sound like its true that EXPORT is not a SQL statement - it's a CLP command and therefore cannot be used in a stored procedure. Maybe you want to use DB2::Admin, it has an Export method.