Rodster001 has asked for the wisdom of the Perl Monks concerning the following question:
SELECT DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX(path, "\\", -2), "\\", 1) AS dir FROM filesBut I get a "DBD::mysql::st execute failed" error when I run this:
DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\", 1) AS dirmy $query = qq~ SELECT DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX(path, "\\", -2), "\\ +", 1) AS dir FROM files ~; my $sth = $dbh->prepare($query); my $rv = $sth->execute;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI mysql substring_index syntax error
by Loops (Curate) on Oct 22, 2014 at 04:16 UTC | |
by Rodster001 (Pilgrim) on Oct 22, 2014 at 04:19 UTC | |
|
Re: DBI mysql substring_index syntax error
by FloydATC (Deacon) on Oct 22, 2014 at 04:47 UTC | |
by Rodster001 (Pilgrim) on Oct 22, 2014 at 06:32 UTC | |
by Laurent_R (Canon) on Oct 22, 2014 at 06:57 UTC |