<div dir="ltr">I continued to dig into this, and even with DBI_TRACE set to 15 (the maximum value), I can't see what data values are returned by the various API calls. The return values from fetch*_arrayref are displayed as a reference address:<div>
<br></div><div><div> <- fetchall_arrayref= ( [ ARRAY(0xb95ea60) ] ) [1 items] row2 at //ms/dist/perl5/PROJ/DBIx-Class/0.08250/lib/perl5/DBIx/Class/Storage/DBI/S\</div><div>ybase/ASE.pm line 341 via at //ms/dist/perl5/PROJ/DBIx-Class/0.08250/lib/perl5/DBIx/Class/Storage/DBI.pm line 1908</div>
<div><br></div><div>The interesting information is inside that ARRAY ref, unfortunately.</div><div><br></div><div>I also can see ZERO differences between the trace of a successful insert and a failed one. There are no extra API calls, indicating an additional select, for example. I could provide the traces if anyone cares, but I can't really keep investing more time into this, because...</div>
</div><div><br></div><div>The next thing I tried solved the problem: I added the missing metadata to my add_columns() calls, and switched to using NoBindVars, and the code works perfectly. So, sadly, I did NOT get to a root cause, and after losing a couple of days to this, I'm regretfully going to move on, since I have what amounts to a workaround. I don't see how the use of placeholders will make any difference to how my application ends up working, and in this case, not working.</div>
<div><br></div><div>Many thanks to Peter and others for the debugging hints. Maybe someday I'll be able to get rid of Sybase, and move onto a more supported RDBMS, but until then, you might hear me whining in this forum again.</div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 4, 2014 at 12:30 PM, Peter Rabbitson <span dir="ltr"><<a href="mailto:rabbit+dbic@rabbit.us" target="_blank">rabbit+dbic@rabbit.us</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Feb 04, 2014 at 12:19:48PM -0500, Phillip Moore wrote:<br>
> OK, that must have gone right over my head, 'cause I did read it, but I<br>
> don't see why that means I should expect there to be no trace output.<br>
><br>
> How do you trace the SQL that is generated when the create() method is<br>
> called then?<br>
<br>
</div>Several ways:<br>
<br>
You either preclude DBIC from using an extra connection (by wrapping<br>
your create in a transaction, which will have little effect over Sybase,<br>
but will offer a clue to DBIC to do something else, see second code I<br>
linked)<br>
<br>
Or you reach into the storage that holds the secondary connection (deep<br>
internals, do not use in production):<br>
$schema->storage->_writer_storage->_dbh->...<br>
<div class="im"><br>
> Obviously, I'm just turning on tracing on the connection<br>
> associated with my $dbh, but if that secondary connection isn't exposed to<br>
> me somehow, are you saying my only recourse is to trace the ENTIRE<br>
> application execution, and then wade through the mountain of data?<br>
<br>
</div>That's the last option yes, but the above is easier.<br>
<div class="im"><br>
><br>
> Oh, BTW, I tried switching to using NoBindVars, and was immediately<br>
> reminded of why that failed for me last year:<br>
><br>
> DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Sybase::st<br>
> execute failed: Server message number=257 severity=16 state=1 line=1 \<br>
> server=NYTIBV6T228 text=Implicit conversion from datatype 'VARCHAR' to<br>
> 'NUMERIC' is not allowed. Use the CONVERT function to run this query.<br>
> Server message number=257 severity=16 state=1 line=1 server=NYTIBV6T228<br>
> text=Implicit conversion from datatype 'VARCHAR' to 'NUMERIC' is not a\<br>
> llowed. Use the CONVERT function to run this query.<br>
> [for Statement "INSERT INTO [ENGN_afsvolume] ( [name], [target],<br>
> [toplevel], [type]) VALUES ( 'canon.root', '9', '1', 'cn' )<br>
> SELECT @@IDENTITY"] at ./util/vms_bootstrap_database line 253<br>
><br>
> That '9', and '1' are both foreign keys which are numerics, and the<br>
> dataserver doesn't like them to be quoted.<br>
><br>
<br>
</div>You do not have sufficient metadata on the 'target' and 'toplevel'<br>
columns. If you add data_type => $whateverthetypeis_likely_int to your<br>
add_columns hashref - DBIC will stop quoting:<br>
<a href="https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.08270/lib/DBIx/Class/Storage/DBI/Sybase/ASE/NoBindVars.pm#L28" target="_blank">https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.08270/lib/DBIx/Class/Storage/DBI/Sybase/ASE/NoBindVars.pm#L28</a><br>
<div class="HOEnZb"><div class="h5"><br>
Cheers<br>
<br>
<br>
_______________________________________________<br>
List: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class</a><br>
IRC: <a href="http://irc.perl.org#dbix-class" target="_blank">irc.perl.org#dbix-class</a><br>
SVN: <a href="http://dev.catalyst.perl.org/repos/bast/DBIx-Class/" target="_blank">http://dev.catalyst.perl.org/repos/bast/DBIx-Class/</a><br>
Searchable Archive: <a href="http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk" target="_blank">http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk</a><br>
</div></div></blockquote></div><br></div>