Announcement

Collapse
No announcement yet.

SC cuts my MySQL Query (CHAR_LENGTH)

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • SC cuts my MySQL Query (CHAR_LENGTH)

    Hi all
    only one simple questions:
    I have a grid. Why Scriptcase change this MySql Statement from
    Code:
    SELECT  IF(CHAR_LENGTH(`Description`) < 3,'Enter Description', `Description`) FROM table
    to

    Code:
    SELECT  IF(`Description` < 3,'Enter Description', `Description`) FROM table
    ???
    It removes the function name CHAR_LENGTH. In PHPMyAdmin works the 1st query with no problems..

    Thanks.
    Steve

  • #2
    The basic sql is parsed by scriptcase to retrieve fieldnames etc. This parsing is not always right, I've had issues with union and others. It's up to scriptcase to tell if this is a bug or not. I think that this is too complex to be used in a grid as SC cannot decide which fields to generate. In SC the generated fields are static, not dynamic.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      I think I had a similiar problem a while and if memory serves right it was because I started the statement with a function.
      Ty to have a field before the function, like:

      SELECT some_field, IF(CHAR_LENGTH(`Description`) < 3,'Enter Description', `Description`) FROM table

      jsb

      Comment


      • #4
        Originally posted by jsbinca View Post
        I think I had a similiar problem a while and if memory serves right it was because I started the statement with a function.
        Ty to have a field before the function, like:

        SELECT some_field, IF(CHAR_LENGTH(`Description`) < 3,'Enter Description', `Description`) FROM table

        jsb
        Thank's for this. Works, if you not Link this field :-) But i link this field to another application, and then, works not.

        Comment

        Working...
        X