Re: perl DBI on windows 64
- From: martin.evans@xxxxxxxxxxxx (Martin Evans)
- Date: Fri, 14 Mar 2008 09:07:01 +0000
Ramakrishna Raju wrote:
Alexander,
t-SQL has a print command and lot of stored procs have print
statements in the code to indicate progress of execution or whatever.
I need to capture it and print that to my log.
In the error handling department, if there is duplicate key
error on a insert or a table is missing, then that error gets printed to
the console thru the perl script, but it's getting printed thru some
low-level driver and not by the user statement. I need to grab that
error situation and send out an email or something. How do I do that?
I will do some reading and try to put something together and
then we can compare notes.
Start your reading with the PrintError, RaiseError and HandleError attributes in DBI. Of course, once you've looked at the 20SqlServer example in DBD::ODBC you will see it uses HandleError.
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
-----Original Message-----.
From: Alexander Foken [mailto:alexander@xxxxxxxx] Sent: Thursday, March 13, 2008 2:41 PM
To: Ramakrishna Raju
Cc: dbi-users@xxxxxxxx
Subject: Re: perl DBI on windows 64
On 13.03.2008 19:49, Ramakrishna Raju wrote:And now, I am looking for a web link or a short snippet thatUse the RaiseError DBI attribute, preferably during connect().
does robust error handling of SQL errors.
And how to process the outputSQL does not print, it has no print statements (at least there not portable ones). You may want to print what $sth->fetchXXX returns. For debugging, you may want to use Data::Dumper.
of sql print statements.
I've done Sybase db-lib programming more thanYou don't care about that. DBI will handle that for you. Sybase db-lib is one level below DBI. Look at the DBI documentation <http://search.cpan.org/perldoc?DBI>. There is also an O'Reily book about the DBI <http://www.oreilly.com/catalog/perldbi/>, it even has an example collection page online at
15 years back and I realize that are 2 channels back to the client, a
message handler and an error handler. How is it done in perl odbc?
<http://examples.oreilly.com/perldbi/>.
There is one annoyance with SQL server: You can't have more than one "active" statement, i.e. a statement that is executing but not yet finished, per connection. This is a limitation of the SQL server protocol, not a DBI limitation. Other databases, like Oracle and the free PostgreSQL, can handle at least a sufficiently large number of parallel active statements. For the MS SQL Server, you have to use several distinct connections if you need parallel active statements.
Personally, I would never start a project on MS SQL Server if I can use Oracle or PostgreSQL. Not just because of that limitation, but also because of some other annoyances, like the trigger implementation and the regular deadlocks of MS SQL Server.
Alexander
- Follow-Ups:
- RE: perl DBI on windows 64
- From: Ramakrishna Raju
- RE: perl DBI on windows 64
- From: Ramakrishna Raju
- RE: perl DBI on windows 64
- References:
- perl DBI on windows 64
- From: Ramakrishna Raju
- Re: perl DBI on windows 64
- From: Martin Evans
- RE: perl DBI on windows 64
- From: Ramakrishna Raju
- Re: perl DBI on windows 64
- From: Martin Evans
- RE: perl DBI on windows 64
- From: Ramakrishna Raju
- Re: perl DBI on windows 64
- From: Alexander Foken
- RE: perl DBI on windows 64
- From: Ramakrishna Raju
- perl DBI on windows 64
- Prev by Date: Re: perl DBI on windows 64
- Next by Date: Re: perl DBI on windows 64
- Previous by thread: RE: perl DBI on windows 64
- Next by thread: RE: perl DBI on windows 64
- Index(es):
Relevant Pages
|
|