Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    quoteColumnNames doesn't work with customSelectExpression and includeFrom field names

    SmartClient 13.0-p20240210

    Hello, I just noticed that DataSource.quoteColumnNames doesn't work when the field has a customSelectExpression, so I get a query like this:

    Code:
    SELECT LEG_SERVIZI_PACCHETTI."ID_REC",
           LEG_SERVIZI_PACCHETTI."ID_FASCIA_PREZZO_FK",
           LEG_SERVIZI_PACCHETTI."ID_SERVIZIO_AGGIUNTIVO_FK",
           CASE WHEN SYSTIMESTAMP BETWEEN DATA_INIZIO_VENDITA AND DATA_FINE_VENDITA THEN 'F' ELSE 'T' END AS _canRemove
    ....
    where _canRemove is not quoted - actually for this use case I prefer to change the property name, so not a big deal for me.

    I also noticed that it doesn't work for includeFrom fields.

    The database is Oracle.

    #2
    You're using quoteColumnNames? These days it's doc'd as basically "don't use this unless forced to"..

    We can't add quoting within a customSelectExpression unless we were to do something like implement a SQL parser so we could figure out which parts of your custom SQL are column names. But you can still quote them yourself, in your customized SQL.

    Comment


      #3
      I'm not using it, just tried it briefly because _canRemove is not a valid column name in Oracle.

      And I noticed that _canRemove (and also includeFrom fields) aren't quoted. I didn't mean I expected quoting inside the customSelectExpression.

      Anyway, it's not important for me.

      Comment

      Working...
      X