Nikolaus Kern
2017-05-02 07:39:16 UTC
Hello,
I am using following query to get all workitems for a specific organisation
unit:
ppaQuery = "SELECT * FROM LPP_PRODUKTIONSAUFTRAEGE WHERE PRODUKTIONSSTATUS
NOT IN ('Abgeschlossen','Storno') ORDER BY PRODUKTIONSAUFTRAG_ID";
tmpPPA = this._ctx.LPP_PRODUKTIONSAUFTRAEGE.SqlQuery(ppaQuery).ToList();
This works fine, unless the parameter contains a -. In this case I receive
an exception "arithmetic exception, numeric overflow, or string
truncation\r\nstring right truncation"
In the case I concatenate the sql query it works fine:
ppaQuery = "SELECT * FROM LPP_PRODUKTIONSAUFTRAEGE WHERE PRODUKTIONSSTATUS
NOT IN ('Abgeschlossen','Storno') AND AUSLASTUNG_GEHOERT_ZU = '" +
this.CurrentHalle + "' ORDER BY PRODUKTIONSAUFTRAG_ID";
tmpPPA = this._ctx.LPP_PRODUKTIONSAUFTRAEGE.SqlQuery(ppaQuery,
this.CurrentHalle).ToList();
Its EF 6.13 and Firebird .net Provider 4.10 (I am aware of the newer
versions but need to migration a big number of assemblies).
I would like to understand if there is a way to resolve this problem in a
more elegant way.
Thanks
Niko
I am using following query to get all workitems for a specific organisation
unit:
ppaQuery = "SELECT * FROM LPP_PRODUKTIONSAUFTRAEGE WHERE PRODUKTIONSSTATUS
NOT IN ('Abgeschlossen','Storno') ORDER BY PRODUKTIONSAUFTRAG_ID";
tmpPPA = this._ctx.LPP_PRODUKTIONSAUFTRAEGE.SqlQuery(ppaQuery).ToList();
This works fine, unless the parameter contains a -. In this case I receive
an exception "arithmetic exception, numeric overflow, or string
truncation\r\nstring right truncation"
In the case I concatenate the sql query it works fine:
ppaQuery = "SELECT * FROM LPP_PRODUKTIONSAUFTRAEGE WHERE PRODUKTIONSSTATUS
NOT IN ('Abgeschlossen','Storno') AND AUSLASTUNG_GEHOERT_ZU = '" +
this.CurrentHalle + "' ORDER BY PRODUKTIONSAUFTRAG_ID";
tmpPPA = this._ctx.LPP_PRODUKTIONSAUFTRAEGE.SqlQuery(ppaQuery,
this.CurrentHalle).ToList();
Its EF 6.13 and Firebird .net Provider 4.10 (I am aware of the newer
versions but need to migration a big number of assemblies).
I would like to understand if there is a way to resolve this problem in a
more elegant way.
Thanks
Niko