I am preparing a script using which i would like to execute mysql query. I am already having access to local node so I can use mysql –e “Query” DBNAME. What I am trying to do is following.
my $Query1 = "mysql -e \"SELECT count(id_) FROM jbpm_taskinstance WHER +E isopen_ IS TRUE AND actorid_ IS NOT NULL\" DB1"; my $Query2 = "mysql -e \"SELECT count(id_) FROM jbpm_taskinstance WHER +E create_>(SELECT DATE_ADD(NOW(), INTERVAL '-3' HOUR))\" DB1"; my @QXXXX = (\$Query1,\$Query2); foreach my $q (@QXXXX) { $out = qx(Dumper($q)); print $out . "\n"; }
but when executing I get error.
sh: -c: line 0: syntax error near unexpected token `SCALAR'
sh: -c: line 0: `Dumper(SCALAR(0x307ef60))'
sh: -c: line 0: syntax error near unexpected token `SCALAR'
sh: -c: line 0: `Dumper(SCALAR(0x307ef70))'
Could someone help me in fixing it?In reply to storing queries in an array and execute by kaka_2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |