Hello.

Background information:
1. SQL Server 2005
2. Tables which contain unicode characters.
3. Perl app to take XML based data and do inserts.

Problem:
Original Perl code (#3) used DBD::ODBC. Now that we've included unicode characters in some of our tables, data is mangled on the round trip. Switched to using Win32::OLE and tricks like Win32::OLE->Option(CP => Win32::OLE::CP_UTF8, LCID => 65001);

The good:
Round trip appears to be working (can put/get same data back in unicode, it isn't mangled, data is consistent).

The bad:
We have constraints on our tables and would like to know when they are violated during INSERT. Before using DBD::ODBC the dbh->errstr would provide SQL Server 2005's error string/description which pointed to constraint violations.

Now that we are using Win32::OLE (and I suspect DBD::ADO may do the same, trying this now), the error that is returned is OLE specific vs. context-relevant for a constraint violation in the DB.

Is there a way around this or something I am missing with Win32::OLE? I miss the more descriptive, context-relevant errors I was getting with DBI via dbh->errstr (and need them for the app we are working on). Currently using Win32::OLE LastError, or the Error obj contained as part of a Win32::OLE connection object from an ADODB Connection.

Any suggestions appreciated greatly,

-s

In reply to More context-relevant errors with Win32::OLE or DBD::ADO? by skubey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.