in reply to OT: Failing to export from DB2

Turn on tracing

Replies are listed 'Best First'.
Re^2: OT: Failing to export from DB2
by talexb (Chancellor) on Mar 30, 2009 at 17:55 UTC

    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

      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.