kaka_2 has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: storing queries in an array and execute
by hippo (Archbishop) on Nov 25, 2016 at 11:43 UTC | |
|
Re: storing queries in an array and execute
by choroba (Cardinal) on Nov 25, 2016 at 09:41 UTC | |
by kaka_2 (Sexton) on Nov 25, 2016 at 09:59 UTC | |
by choroba (Cardinal) on Nov 25, 2016 at 10:42 UTC | |
by kaka_2 (Sexton) on Nov 25, 2016 at 10:57 UTC | |
by choroba (Cardinal) on Nov 25, 2016 at 11:35 UTC | |
by marto (Cardinal) on Nov 25, 2016 at 11:01 UTC |