Re: perl DBI on windows 64



Alexander Foken wrote:
On 13.03.2008 19:49, Ramakrishna Raju wrote:
And now, I am looking for a web link or a short snippet that
does robust error handling of SQL errors.
Use the RaiseError DBI attribute, preferably during connect().

And how to process the output
of sql print statements.
SQL 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.

In SQL Server there is a print statement that may be used in procedures - see the t/20SQLServer test.

I've done Sybase db-lib programming more than
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?
You 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 <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.

That is no longer true Alexander:

MARS. Multiple Active Result Sets (MARS), enables your applications to have more than one pending request per connection, and, in particular to have more than one default result set open per connection. The MARS feature removes the restriction present in earlier versions of SQL Server in which an open default result set blocks the driver from sending requests to the server until the entire result set is consumed.

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.

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
.



Relevant Pages

  • Re: perl DBI on windows 64
    ... does robust error handling of SQL errors. ... Use the RaiseError DBI attribute, ... it has no print statements. ... 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. ...
    (perl.dbi.users)
  • Re: Unable to Apply SP4 to SQL 2000 Cluster (new Node)
    ... Rebuild the node in the failover cluster. ... Scenario 1" in SQL Server 2000 Books Online. ... This setup process updates to SP4 only the binaries on the new ...
    (microsoft.public.sqlserver.clustering)
  • Re: WSS 3.0 question
    ... I followed the advise given in removing WSS 3.0 etc, ... the server is complaining that the SQL service(?) was tempered with or corrupt. ... I may just instal the SQL server as I was going eventuall use it anyway. ... If WSUS 3.0 is installed, I would suggest you uninstall it and then you install WSS 3.0. ...
    (microsoft.public.windows.server.sbs)
  • RE: Question with DBI versus PERL
    ... Question with DBI versus PERL ... statement at once (if I parse my SQL file) my pl/sql will work? ... All spool statements will turn to Perl print() calls. ... I want to know how can i run this sql script with DBI. ...
    (perl.dbi.users)
  • Re: SQL Server 2005 Cluster Setup Quiz
    ... I did test and it did not install the client tools. ... http://www.clusterhelp.com - Cluster Training ... Microsoft SQL Server MVP ... Provide a template on how to read SQL Server 2005 setup log files. ...
    (microsoft.public.sqlserver.clustering)