From: Norbert Buchmuller Date: Wed, 26 Nov 2008 19:18:57 +0000 (+0000) Subject: Documented { op => \'...' } and { op => \['...', @bind] } syntaxes. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=44b9e5020c2bf5ae465aa7ddb760d9fd5a67f638;p=scpubgit%2FQ-Branch.git Documented { op => \'...' } and { op => \['...', @bind] } syntaxes. --- diff --git a/lib/SQL/Abstract.pm b/lib/SQL/Abstract.pm index 248ec3a..eb660db 100644 --- a/lib/SQL/Abstract.pm +++ b/lib/SQL/Abstract.pm @@ -1615,6 +1615,19 @@ Which would generate: $stmt = "WHERE user = ? AND priority = ? OR priority != ?"; @bind = ('nwiger', '2', '1'); +If you want to include literal SQL (with or without bind values), just use a +scalar reference or array reference as the value: + + my %where = ( + date_entered => { '>' => \["to_date(?, 'MM/DD/YYYY')", "11/26/2008"] }, + date_expires => { '<' => \"now()" } + ); + +Which would generate: + + $stmt = "WHERE date_entered > "to_date(?, 'MM/DD/YYYY') AND date_expires < now()"; + @bind = ('11/26/2008'); + =head2 Logic and nesting operators