uPdate scott.emp
set ename='SCT%',emp_date=TO_DATE('04/16/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),empno='15645'
WHERE dept=20 and ename IN(select ename from emp where empno='1111');
####
Incomplete SET clause! at ./post_audit.pl line 173
Incomplete SET clause! at ./post_audit.pl line 173
##
##
+12 use SQL::Parser;
+34 my $statement = "uPdate scott.emp set ename='SCT%',emp_date=TO_DATE('04/16/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),empno='15645' WHERE dept=20 and ename IN(select ename from emp where empno='1111')";
+172 my $parser = SQL::Parser->new('AnyData', {RaiseError=>1} );
+173 $parser->parse($statement);
##
##
sub SET_CLAUSE_LIST
{
my ( $self, $set_string ) = @_;
my @sets = split( /,/, $set_string );
my ( @cols, @vals );
for my $set (@sets)
{
my ( $col, $val ) = split( m/ = /, $set );
return $self->do_err('Incomplete SET clause!') unless ( defined($col) && defined($val) );
push( @cols, $col );
push( @vals, $val );
}
return undef
unless ( $self->{struct}->{column_defs} = $self->ROW_VALUE_LIST( join ',', @cols ) );
return undef unless ( $self->LITERAL_LIST( join ',', @vals ) );
return 1;
}