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 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.

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.

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


--
Alexander Foken
mailto:alexander@xxxxxxxx http://www.foken.de/alexander/

.



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: 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: how to invoke .sql file from dbi
    ... recommended changing all the SQL*Plus scripts into DBI calls. ... The sql statements are SELECT statements and we are expecting plain (no ... to just point the dbi to a sql file and dbi taking care of it. ...
    (perl.dbi.users)
  • Re: use of DBI; I am getting multiple error messages mixed in with the correct output.
    ... T> expected a mature library like DBI to behave like this. ... I learned plenty about the perl side of things from her posts. ... closely represent the SQL idea of a null. ... trivially easy to perform bulk loads using the DB's particular ...
    (comp.lang.perl.misc)
  • RE: New DBI in-memory tables, heterogeneous operations, SQL-Statement
    ... SQL ERROR: Bad predicate: 'id'! ... New DBI in-memory tables, heterogeneous operations, ... > functions, in-memory tables, and heterogeneous operations across all DBI ... > As with AoA in-memory tables, once a heterogeneous query in-memory table ...
    (perl.dbi.users)