On Mon, Sep 15, 2003 at 11:53:53AM +0200, "Timmerman, P." <[EMAIL PROTECTED]> wrote:
> I'am having trouble using the odbc_err_handler callback mechanisme. I really would
> like to retrieve informational messages from stored-procedures (as wel as
> resultsets). I'am using perl 5.6.1, MSSQL-server 2000, DBI v1.37 and DBD::ODBC
> v1.06. When there is more than one informational message, I get an invalid cursor
> message.
>
> Here's the code i use
>
[snip]
>
> my $sth = $dbh->prepare(<<SQLEND);
> print 'this is test 1'
> print 'this is test 2'
> SQLEND
>
> my $rc = $sth->execute;
> $sth->finish;
>
[snip]
>
> **** De cursorstatus is ongeldig
> DBD::ODBC::st execute failed: (DBD: dbd_describe/SQLNumResultCols err=-1) at
> D:\temp\perl\web\dbi_tst.pl line 20.
>
> "De cursorstatus is ongeldig" is dutch for "cursor status not valid"
>
> any ideas?
I think the problem is that you're using prepare() and execute() on SQL that
doesn't return anything. Try something like this instead:
my $sth = $dbh->do(<<SQLEND);
print 'this is test 1'
print 'this is test 2'
SQLEND
--
David Good [EMAIL PROTECTED]
This space intentionally left blank.