Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesFirebird SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 27th, 2013, 11:54 AM
derstauner derstauner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2010
Posts: 76 derstauner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 24 m 53 sec
Reputation Power: 4
Parameter problem

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.

Reply With Quote
  #2  
Old March 7th, 2013, 01:06 AM
costin_mentor costin_mentor is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 31 costin_mentor User rank is Lance Corporal (50 - 100 Reputation Level)costin_mentor User rank is Lance Corporal (50 - 100 Reputation Level)costin_mentor User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 13 h 12 m 34 sec
Reputation Power: 7
Replace @ with ? in your query and it will work.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Parameter problem

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap