Hi,
the expansion of the known operators was actually quite easy (~ line 970
in OpenXPKI::Server::DBI::SQL):
(I used a temporary variable $op_key for the sake of readability)
my $operator = "=";
my $op_key = $args->{DYNAMIC}->{$dynamic_key}->{OPERATOR};
if ( $op_key ) {
if ( $op_key eq "EQUAL" ) {
$operator = "=";
} elsif ( $op_key eq "LIKE" ) {
if ( $self->{DBH}->column_is_numeric($col) ) {
OpenXPKI::Exception->throw(
message =>
"I18N_OPENXPKI_SERVER_DBI_SQL_SELECT_LIKE_ON_NUMERIC",
params => { CONDITION => $dynamic_key, }
);
}
$operator = "like";
} elsif($operator_of{$op_key}){
$operator = $operator_of{$op_key};
}else {
OpenXPKI::Exception->throw(
message =>
"I18N_OPENXPKI_SERVER_DBI_SQL_SELECT_UNKNOWN_OPERATOR",
params => { CONDITION => $dynamic_key,
OPERATOR => $op_key}
);
}
}
which brought my api request (see below) to generate this sql
SELECT ... FROM workflow WHERE workflow_wakeup_at < ? AND watchdog_key =
? AND workflow_proc_state = ?
cu,
Dieter
>
>
> Another thing:
> I tried to retrieve all entries, whre the set "wake_up_at" timestamp
> is over ... like this:
> my $now = DateTime->now->strftime( '%Y-%m-%d %H:%M:%S' );
>
> my $db_result = $dbi->first(
> TABLE => $workflow_table,
> COLUMNS => [ 'WORKFLOW_SERIAL'],
> DYNAMIC => {
> 'WORKFLOW_PROC_STATE' => {VALUE => 'pause'},
> 'WATCHDOG_KEY' => {VALUE => ''},
> 'WORKFLOW_WAKEUP_AT' => {VALUE => $now, OPERATOR
> => 'LESS_THAN'},
> },
> );
>
> which resulted in an
> I18N_OPENXPKI_SERVER_DBI_SQL_SELECT_UNKNOWN_OPERATOR Exception ...;-))
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenXPKI-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openxpki-devel