Hi all,

I need to write a perl script to create/ replace procedure in Teradata.
The problem is that Teradata ODBC driver doesn't support prepare for CREATE/ REPLACE procedure statements.
So instead of prepare and then execute I've tried "do":

$con = DBI->connect("dbi:ODBC:$DSN", $user, $pass, {PrintError => 0, RaiseError => 1, AutoCommit => 1} );
my $res = $con->execute($SQL);
and this works fine, except situations when $SQL generates database error.
Teradata ODBC driver returns recordset with database errors if it fails to execute $SQL with create procedure statement and no exception is generated.

Question: how can I get this list of errors? According to the documentation "do" statement does not return result... From the other side - I can't prepare statement because ODBC driver doesn't support this...

More generally - how to execute statement that returns data and doesn't support prepare?