Hi,
I have this query with some parameters:
Code:
INSERT INTO
szamlaegyenlegek(szamlaszam, halmt, halmk, halme, uzleti_ev, alperiodus_kod, datum, targyt, targyk, targye, kpnem)
SELECT DISTINCT
szamlaegyenlegek.szamlaszam, (select max(halmt) from (select halmt from szamlaegyenlegek where uzleti_ev=@elozofoper and datum<=@elozovege)),
(select max(halmk) from (select halmk from szamlaegyenlegek where uzleti_ev=@elozofoper and datum<=@elozovege)),
(select max(halme) from (select halme from szamlaegyenlegek where uzleti_ev=@elozofoper and datum<=@elozovege)),
@kovuzlev AS uzleti_ev, 0 AS alperiodus_kod, DATE @kovuzlev_kezdes AS datum,
0, 0, 0, 'EUR' AS kpnem
FROM szamlaegyenlegek INNER JOIN szamlatukor ON szamlaegyenlegek.szamlaszam=szamlatukor.szamlaszam
WHERE szamlatip IN ('Aktív', 'Passzív') AND szamlaegyenlegek.szamlaszam=@szamlaszam and uzleti_ev=@elozofoper AND datum<=@elozovege
If I run the query, I get the error:
Dynamic SQL Error SQL error code = -104 Token unknown - line 1, column 497 ?
The column 497 is at
@elozofoper and datum<=@elozovege)), @kovuzlev AS uzleti_ev.
As you see, all the parameters have a value:
FirebirdSql.Data.FirebirdClient Information: 0 : Parameters:
FirebirdSql.Data.FirebirdClient Information: 0 : Name:@kovuzlev Type:VarChar Used Value:2014
FirebirdSql.Data.FirebirdClient Information: 0 : Name:@kovuzlev_kezdes Type:TimeStamp Used Value:01/01/2014 00:00:00
FirebirdSql.Data.FirebirdClient Information: 0 : Name:@elozofoper Type:VarChar Used Value:2013
FirebirdSql.Data.FirebirdClient Information: 0 : Name:@elozovege Type:VarChar Used Value:2013.12.31.
FirebirdSql.Data.FirebirdClient Information: 0 : Name:@szamlaszam Type:VarChar Used Value:541100
It is strange, why I don't get the same error f.e at one line above in the query. I have there the same parameter.