Hello Jiri,

its my fault: AUSLASTUNG_GEHOERT_ZU is Varchar(20), the parameter "Halle 6 -  
Schlosserei" is 21 chars long.... After correcting the length to 30 it works 
fine. Interessting the slq console does not compain about the too long input 
for the query.

Thanks for answering to my posting that fast. 

Can you please add 1 line to describe the difference between using {0} vs. @p0 
? 

Thanks

Niko

-----Ursprüngliche Nachricht-----
Von: Jiří Činčura [mailto:j...@cincura.net] 
Gesendet: Dienstag, 2. Mai 2017 11:57
An: firebird-net-provider@lists.sourceforge.net
Betreff: Re: [Firebird-net-provider] EF handling - as string parameter

What's the AUSLASTUNG_GEHOERT_ZU's datatype?

--
Mgr. Jiří Činčura
https://www.tabsoverspaces.com/

On Tue, May 2, 2017, at 11:55, Nikolaus Kern wrote:
> Hello Jiri,
> 
> thanks for the response.
> 
> I guess I am missing something here. The code below produces the same 
> error as {0}.
> 
> ppaQuery = "SELECT * FROM LPP_PRODUKTIONSAUFTRAEGE WHERE 
> PRODUKTIONSSTATUS NOT IN ('Abgeschlossen','Storno') AND 
> AUSLASTUNG_GEHOERT_ZU = @p0 ORDER BY PRODUKTIONSAUFTRAG_ID"; tmpPPA = 
> this._ctx.LPP_PRODUKTIONSAUFTRAEGE.SqlQuery(ppaQuery, new 
> object[]{this.CurrentHalle}).ToList();
> 
> If I copy the query to the SQL tool and execute the query it works 
> fine (even when it does not return a record, which is also the case in 
> other working queries).
> SELECT * FROM LPP_PRODUKTIONSAUFTRAEGE WHERE PRODUKTIONSSTATUS NOT IN
> ('Abgeschlossen','Storno') AND AUSLASTUNG_GEHOERT_ZU = 'Halle 6 - 
> Schlosserei' ORDER BY PRODUKTIONSAUFTRAG_ID
> 
> Do you have an idea whats missing?
> 
> Thanks
> 
> Niko
> 
> -----Ursprüngliche Nachricht-----
> Von: Jiří Činčura [mailto:j...@cincura.net]
> Gesendet: Dienstag, 2. Mai 2017 10:02
> An: firebird-net-provider@lists.sourceforge.net
> Betreff: Re: [Firebird-net-provider] EF handling - as string parameter
> 
> You should use @p0 instead of {0}
> (https://msdn.microsoft.com/en-us/library/system.data.entity.dbset.sqlquery%28v=vs.113%29.aspx).
> Optionally you can also specify the Size in FbParameter.
> 
> --
> Mgr. Jiří Činčura
> https://www.tabsoverspaces.com/
> 
> On Tue, May 2, 2017, at 09:58, Nikolaus Kern wrote:
> > Hi,
> > 
> > I just saw that the query and the execution do not match correct. 
> > This is the query with the parameter that creates an exception if 
> > the parameter is "Halle 6 - Schlosserei".
> > 
> > ppaQuery = "SELECT * FROM LPP_PRODUKTIONSAUFTRAEGE WHERE 
> > PRODUKTIONSSTATUS NOT IN ('Abgeschlossen','Storno') AND 
> > AUSLASTUNG_GEHOERT_ZU = {0} ORDER BY PRODUKTIONSAUFTRAG_ID"; tmpPPA 
> > = this._ctx.LPP_PRODUKTIONSAUFTRAEGE.SqlQuery(ppaQuery,
> > this.CurrentHalle).ToList();
> > 
> > Niko
> > 
> > -----Ursprüngliche Nachricht-----
> > Von: Jiří Činčura [mailto:j...@cincura.net]
> > Gesendet: Dienstag, 2. Mai 2017 09:43
> > An: firebird-net-provider@lists.sourceforge.net
> > Betreff: Re: [Firebird-net-provider] EF handling - as string 
> > parameter
> > 
> > What parameter? I don't see any parameter in the query.
> > 
> > --
> > Mgr. Jiří Činčura
> > https://www.tabsoverspaces.com/
> > 
> > 
> > --------------------------------------------------------------------
> > --
> > -------- Check out the vibrant tech community on one of the world's 
> > most engaging tech sites, Slashdot.org! http://sdm.link/slashdot 
> > _______________________________________________
> > Firebird-net-provider mailing list
> > Firebird-net-provider@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
> > 
> > 
> > --------------------------------------------------------------------
> > --
> > -------- Check out the vibrant tech community on one of the world's 
> > most engaging tech sites, Slashdot.org! http://sdm.link/slashdot 
> > _______________________________________________
> > Firebird-net-provider mailing list
> > Firebird-net-provider@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
> 
> ----------------------------------------------------------------------
> -------- Check out the vibrant tech community on one of the world's 
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot 
> _______________________________________________
> Firebird-net-provider mailing list
> Firebird-net-provider@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
> 
> 
> ----------------------------------------------------------------------
> -------- Check out the vibrant tech community on one of the world's 
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot 
> _______________________________________________
> Firebird-net-provider mailing list
> Firebird-net-provider@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech 
sites, Slashdot.org! http://sdm.link/slashdot 
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to