Ed,A couple of feature requests, then. For DBI, if the driver does not provide an attribute until after $sth->execute() then the error should indicate this, for example
NAME attribute not available with this driver until you execute()
rather than 'unrecognised attribute'. Perhaps this will mean drivers
letting DBI know which attributes this applies to, I don't know.
which of these 2 is it ?
DBI.xs:1377: char *msg = "Can't set %s->{%s}: unrecognised attribute or invalid value%s";
DBI.xs:1664: croak("Can't get %s->{%s}: unrecognised attribute",neatsvpv(h,0),key);
FWIW,
Ill presume you considered wrapping the $sth->{NAME} in an eval,
and executing if you get that specific error.And that you didnt prepare a patch cuz;
1. its XS, and you dont go there.
2. just blindly executing the $sth could be bad, esp if its a 'drop database'
its ok for user to do, cuz they know what the SQL says.
Am I close ?
So, how does one do a related query ? IE, given: "delete from Foo where x = y" you could execute " delete from Foo where x=y AND 1=0 "
obviously - if theres no where in your clause, s/AND/WHERE/
this should be legal SQL, that will execute, but not do anything,
then this $related_sth will have ->{NAME} available.
But how to give it to original $sth ?