Hey folks,
I am trying to do the following on a MySQL 5 DB to select entities beginning with a certain number.
psSelectRegex =connection.prepareStatement(
"SELECT * FROM artikel where artikel_nr regexp '^?' ORDER BY artikel_nr LIMIT 0,25"
);
psSelectRegex.setString(1,iartikel_nr);
psSelectRegex.executeQuery();
As an unprepared Statement in the following form it works perfectly.
"SELECT * FROM artikel where artikel_nr regexp '^" + iartikel_nr + "' ORDER BY artikel_nr LIMIT 0,25"
The error i get is: Parameter index out of range (1 > number of parameters, which is 0).
How do i solve this to use the regexp??
Thanks in advance
Best regards
Oliver