in reply to Re^2: DBIx::Simple and Oracle dates
in thread DBIx::Simple and Oracle dates

Why isn't "like" appropriate?

Because you can't just make stuff up? "LIKE" is a specific operator for matching strings where "%" can be used in one as a wildcard. It isn't some generic "roughly similar to" DWIM magical operator. Perhaps you should check your documentation?

Now, I often regret when I have to learn more about Oracle (because it usually means I've had to try to use Oracle) and I know Oracle does some rather bizarre things. But I'd still be rather surprised to find out Oracle took the string-comparing LIKE and overloaded it for testing if datetimes were "near".

- tye        

  • Comment on Re^3: DBIx::Simple and Oracle dates (stuff)

Replies are listed 'Best First'.
Re^4: DBIx::Simple and Oracle dates (stuff)
by Argel (Prior) on Jun 15, 2010 at 19:54 UTC
    As I indicated in my OP the query works in SQL Developer. Maybe it's massaging the code, or maybe newer clients support using "like" in that context. I actually did verify the code in SQL Developer, implying the problem could be a difference in the clients or with DBIx::Simple! You were on the right track (see the updated OP), but there was no need to be so hostile about it!

    Elda Taluta; Sarks Sark; Ark Arks

      As I indicated in my OP the query works in SQL Developer.

      Yeah, it is common for DBs to allow you to silently treat a date or datetime as a string, so you often won't get any warning or error for saying "sometime LIKE somedate". But doing that just converts 'somedate' to a string, treats any resulting '%' characters (surely none) as wildcards, and then compares that to the stringification of 'sometime'. Is that what you wanted to do? If so, that is certainly a confusing way to accomplish it.

      but there was no need to be so hostile about it!

      I don't see where I could even be reasonably interpreted as "hostile" much less "so hostile". The closest I came to "hostile" was toward Oracle. Did you take that personally? Perhaps I should have been more like Dominus and instead said "You can't just make shit up, Retardo." At least that would've been rude. "Hostile" surely goes beyond "rude". I tried to find some examples of "hostile remarks" but every hit I checked just showed people being unwilling to even repeat them in quotes. I encourage you to not paint in your mind text-only remarks with such stark emotions so readily.

      - tye        

        Our master list is based on who is in what group on the CiscoSecure ACS appliances, because this is the real level of access users have. An audit script runs against that and updates the table I am hitting. So the only way for me to identify current users is to check the upate_timestamp field. As long as my script runs after the other auditing script then the string comparison is fine. And if they do not match up then my script will exit (well, I will probably have it email me a warning that there were no users found).

        With that said, it would probably make more sense to find any entries that update_timestamp is 24 hours old or less in instead of doing the string comparison. And this was supposed to be a quick and dirty script.

        Regarding hostile: The 'Because you can't just make stuff up?" paragraph. The "question" sets a pretty negative tone, and the rest of the paragraph reinforces it. It didn't help that it felt like you glossed over my post -- i.e. that the query works in SQL Developer. I mean, it worked, so I wasn't just "making stuff up".

        Elda Taluta; Sarks Sark; Ark Arks