I am trying to export a table using dbd::db2 and failing miserably. I am using DB2 v0.75; DBI v1.19 and perl v5.6.1 built for MSWin32-x86. And, we are using DB2 5.2.
Here is a code snippet and the resulting error message. Any advice/sample code etc would be greatly appreciated. Thanks. Mike Boyle =============== ==================Code Snippet============== sub ExportTempTableToFile { my $exportName = "U:url1.ixf"; my $exportFile = "U:urltxt1.txt"; my $sql = "export to $exportName of ixf messages $exportFile select noncedomain, parsed_url, dwparsedurlhash from globals.cydomains "; Debug_Trace("export sql: $sql"); #My own debugging call - writes messages to log file and command window #Execute sql statement (#.... dies not needed with my DBI flags set) # Tried both methods below and both failed. $sth = $DBH->do($sql); #$sth = $DBH->prepare($sql); #$sth->execute(); } #Error message returned for this version of Export attempt DBD::DB2::st execute failed: [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected t oken "export to U:url1.ixf of ixf messages U:urltx" was found following "BEGIN-O F-STATEMENT". Expected tokens may include: "<from>". SQLSTATE=42601 DBD::DB2::st execute failed: [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected t oken "export to U:url1.ixf of ixf messages U:urltx" was found following "BEGIN-O F-STATEMENT". Expected tokens may include: "<from>". SQLSTATE=42601