Subject | -104 Token unknown - line 1, column 497 ? |
---|---|
Author | Varga Balázs |
Post date | 2013-02-25T17:39:15Z |
Hi,
I have this query with some parameters:
"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, '" & KPNEM & "' 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.
[Non-text portions of this message have been removed]
I have this query with some parameters:
"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, '" & KPNEM & "' 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.
[Non-text portions of this message have been removed]