in reply to problems with DBI and am oracle statement

While serf solved your immediate problem, I'd like to offer an alternate solution. This one uses a couple other DBI features which are useful, better SQL features, plus formats the SQL in a way I really like that a DBA once showed me.
my $sth = $dbh->prepare( <<'__END_SQL__' ); SELECT smt.uniqueid ,smt.creationtime ,att.name ,att.val ,gsm.msisdn FROM dagenericsmt smt JOIN dagenericsmtattribute att ON smt.uniqueid = att.genericsmt_uniq +ueid JOIN dagsmproduct gsm ON smt.product_uniqueid = gsm.uniqueid WHERE smt.smtstatus = ? AND smt.smtcommand = ? AND smt.acktime IS NULL AND att.name IN (?,?) ORDER BY smt.uniqueid __END_SQL__ $sth->execute( 2, 3, 'GSM/Cur/IMSI', 'GSM/Rpl/IMSI' );
Explanations:

Yes, it takes a ton more lines. It's also more maintainable. If you had to make a change to the query, would you rather do it to yours or mine?


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: problems with DBI and am oracle statement
by Alex_T2 (Initiate) on Jan 11, 2006 at 15:54 UTC
    thx for your reply ;D well im the DBA here and your right if someone send me this i wouldnt look @ it ;D i will try your suggestion and will come back with the results ;D <--- perl nub btw ;D