Bug in Editor on created query
Bug in Editor on created query
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
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
@allan Thank you