Bug in Editor on created query

Bug in Editor on created query

febra69febra69 Posts: 5Questions: 3Answers: 0
edited March 2022 in Editor

Error messages shown: The identifier that starts with '...' is too long. Maximum length is 128.
Description of problem:
I have this code in php
Field::inst('(((((CASE WHEN st.iva1incl=0 THEN st.epv1*(1+(0.01*tx.taxa)) ELSE st.epv1 END)/1.10)/(1+(0.01*tx.taxa)))-st.epcpond)*100)/CASE WHEN st.iva1incl=0 THEN st.epv1*(1+(0.01*tx.taxa)) ELSE st.epv1 END', 'MARGEM1_0' )
the lid editor put in sql this
(((((CASE WHEN st.iva1incl=0 THEN st.epv1*(1+(0.01*tx.taxa)) ELSE st.epv1 END)/1.10)/(1+(0.01*tx.taxa)))-st.epcpond)*100)/CASE WHEN st.iva1incl=0 THEN st.epv1*(1+(0.01*tx.taxa)) ELSE st.epv1 END as '(((((CASE WHEN st.iva1incl=0 THEN st.epv1*(1+(0.01*tx.taxa)) ELSE st.epv1 END)/1.10)/(1+(0.01*tx.taxa)))-st.epcpond)*100)/CASE WHEN st.iva1incl=0 THEN st.epv1*(1+(0.01*tx.taxa)) ELSE st.epv1 END'
instead
(((((CASE WHEN st.iva1incl=0 THEN st.epv1*(1+(0.01*tx.taxa)) ELSE st.epv1 END)/1.10)/(1+(0.01*tx.taxa)))-st.epcpond)*100)/CASE WHEN st.iva1incl=0 THEN st.epv1*(1+(0.01*tx.taxa)) ELSE st.epv1 END as MARGEM1_0

Look my old post
https://datatables.net/forums/discussion/72136/the-identifier-that-starts-with-is-too-long-maximum-length-is-128#latest

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,697Questions: 1Answers: 10,102 Site admin
    Answer ✓

    Hi,

    For that kind of query, at the moment you would need to use a VIEW. The aliasing our libraries do isn't very "smart" in that they just use the identifier again, which is why you are running into this issue.

    That is something I'm going to address in future.

    Allan

  • febra69febra69 Posts: 5Questions: 3Answers: 0

    @allan Thank you

Sign In or Register to comment.