in reply to DBD::Sybase and dump dataabse

I just tried it, and I did get a RaiseError. Run your script with DBI->trace(3) to see what the system is doing (note that a "missing/unknown database" error is error #911)

Michael

Replies are listed 'Best First'.
Re: Re: DBD::Sybase and dump dataabse
by thor (Priest) on May 15, 2004 at 15:18 UTC
    Sometimes I amaze myself with my own myopia. In actuality, I had set a syb_err_handler...that always returned 0. However, I have a question related to that. What I'm trying to do is create a record of what all is happening For example, when you normally dump a database, you receive messages like "DUMP phase 1 complete". I want to retain these messages, but continue to fail where I should.

    My question is: if you don't explicitly return from the custom handler, is the error handled "properly" by DBI in all cases? That is to say: with respect to RaiseError, is any functionality changed by installing a custom handler?

    thor

      The normal way of handling this would be to check the second argument to the error handler (the error "severity"). If the severity is > 10 it is an error, and you should return a positive value from the handler so that DBI's normal error handling can catch the error. If the severity is <= 10 you do what you want with the message, and return 0 from the handler so that there is no risk that DBI will catch the error/message.

      Michael