can anyone explain this weird behavior?
alive but dead
dies at last line
my $db = DBI->install_driver('mysql')
or die;
my $ipplan = DBI->connect('DBI:mysql:host=www;database=ipplan','xxxx','xxxxx')
or die;
my $C = $ipplan->prepare("SELECT count(*),sum(if(lastpol > ?,1,0)) as recent...
thanks but
mysql> select d07 from service where if(instr(d07,' ') > 0, left(d07,instr(d07,' ')),d07) = '10.101.1.1' ;
Empty set (0.02 sec)
mysql> select d07 from service where d07 regexp '^10.100.1.1 |^10.100.1.1$';
+--------------------+
| d07 |
+--------------------+
|...
I have a solution for my case - IP first position in field
may be the entire field or followed with space and possibly more data or nothing.
(just translate the above to regexp!)
[wink]
mysql> select d07 from service where d07 regexp '^10.100.1.1 |^10.100.1.1$';
+--------------------+
| d07...
! you are correct ! thanks !
verified by further testing
call the search term in quotes a "word"
with no qualifies it appears that LIKE and = produce the same result!
(but watch out for white space!)
My original task remains unsolved: how to match fields that contain an unique IP which may or...
thanks for the suggestions
with a little "hacking" around the suggestions of using LIKE
I think I found a solution but do not know why it works.
And still do not know why regexp fails.
So two open questions!
My solution based upon your suggestions.
The earlier suggestion does not work because...
thanks
I have tried that - and also [[:<:]] . . . [[:>:]] - same results
also with and without the escape \ - same results
note that NONE of the "matches" match the first 6 characters
I am bewildered!
mysql> select d07 from service where d07 regexp '^10\.100\.1\.1[[:>:]]'...
Select a record where a field contains a specific IP.
where field regexp IP
gives multiple matches
I do not have clue as to the unexpected results
mysql> select d07 from service where d07 regexp '^10.100.1.1';
+------------------------------------------------+
| d07...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.