Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
Why can't I use a dynamic parameter here? |
Sun, Apr 17 2011 10:25 AM | Permanent Link |
Uli Becker | <<
DECLARE FAnteilProzentOPrivat INTEGER; DECLARE FAnteilProzentOKasse INTEGER; DECLARE Result CURSOR FOR Stmt; PREPARE Stmt FROM 'SELECT AnteilProzentOPrivat, AnteilProzentOKasse, AnteilProzentA from Optionen'; OPEN Result; Fetch First From Result('AnteilProzentOPrivat','AnteilProzentOKasse') into FAnteilProzentOPrivat,FAnteilProzentOKasse; CLOSE Result; Execute Immediate ' Update Abrechnungen set AnteilProzentO = if(Privat = true then ? else ?), ErloesO = DRGPreis + ImplantatePreis + ZuAbschlagPreis + AbzuegePreis, AnteilSummeO = (ErloesO * AnteilProzentO) / 100 where IsOperateur = true' using FAnteilProzentOPrivat, FAnteilProzentOKasse; >> When executing this procedure, it says: ElevateDB Error #700 An error was found in the statement at line 16 and column 19 (Invalid expression ? found, dynamic parameter type cannot be inferred) I don't understand why I can't use dynamic parameters here. Thanks Uli BTW: @Tim: from where do you get the line and column numbers? They never match. |
Sun, Apr 17 2011 1:22 PM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | Uli
>I don't understand why I can't use dynamic parameters here. I don't understand either, but I do know its not allowed in functions - either its the standard, Tim hasn't got around to it yet or its just to much like hard work I was told but I can't remember. >BTW: @Tim: from where do you get the line and column numbers? They never >match. They do sometimes, they don't sometimes but I'm puzzled as to what differentiates the do's from the don'ts At least I know its usually somewhere near. Roy Lambert [Team Elevate] |
Sun, Apr 17 2011 3:43 PM | Permanent Link |
Uli Becker | Roy,
> I don't understand either, but I do know its not allowed in functions Ah, I didn't know that. Thanks. Hopefully Tim will enable this - it's useful. Uli |
Tue, Apr 19 2011 5:55 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Uli,
<< I don't understand why I can't use dynamic parameters here. >> You can't use dynamic parameters for *both* result expressions of the IF because EDB cannot figure out how to properly type-check the expression during compilation. At least one of the result expressions must not be a NULL constant or a dynamic parameter, basically something that EDB can use to infer the result type. << BTW: @Tim: from where do you get the line and column numbers? They never match. >> They should always match. Please send me an example and I'll take a look. -- Tim Young Elevate Software www.elevatesoft.com |
Mon, Apr 25 2011 7:17 AM | Permanent Link |
Uli Becker | Tim,
> << BTW: @Tim: from where do you get the line and column numbers? They > never match. >> > > They should always match. Please send me an example and I'll take a look. They *do* in all cases after sending this post. Sorry - if I find something else, I'll send it to you. Regards Uli |
This web page was last updated on Tuesday, April 30, 2024 at 03:55 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |