Subject | AW: [firebird-support] execute statement and in(variable) |
---|---|
Author | Olaf Kluge |
Post date | 2008-10-16T07:46:21Z |
Hello,
Ive a little problem with this:
CREATE PROCEDURE P_TEST(
INPUTPARAM1 varchar(50))
returns(
menge double precision)
AS /**/
declare variable statement1 varchar(100);
BEGIN
statement1 = 'Select Menge from auftraege where auftrag_pos in('||
inputparam1 || ')';
for execute statement :statement1 into :menge do suspend;
END
The result is: Precompiler Error: parsing error - execute.
Any ideas?
Thank you.
Mit freundlichen Grüßen/with best regards
SATRON Sachsen
Steuerungstechnik GmbH
Olaf Kluge
Fon +49 (0) 37 25/ 35 06-31
Fax +49 (0) 37 25/ 35 06-12
Mob +49 (0) 1 70/ 92 92 375
E-Mail: <mailto:olaf.kluge@...> olaf.kluge@...
...........................................................................
SATRON Sachsen Steuerungstechnik GmbH
Geschäftsführer: Bernd Grötzschel, Gerd Kaden
Sitz: D-09405 Zschopau, Johann-Gottlob-Pfaff-Straße 7
Amtsgericht: Chemnitz HRB 1218
Diese E-Mail ist vertraulich und beabsichtigt einzig zum Gebrauch der
Person, an die sie adressiert ist.
Wenn Sie nicht der Empfänger sind, nehmen Sie zur Kenntnis, dass Sie diese
E-Mail in Fehler und jeder Verwendung erhalten haben,
Verbreitung, Weiterleitung, Drucken oder Kopieren dieser E-Mail wird strikt
verboten.
_____
Von: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] Im Auftrag von Martijn Tonies
Gesendet: Donnerstag, 16. Oktober 2008 09:35
An: firebird-support@yahoogroups.com
Betreff: Re: [firebird-support] execute statement and in(variable)
Hello Olaf,
value,
not a text string. With [FOR] EXECUTE STATEMENT this should work fine.
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene. <http://www.upscene.com> com
My thoughts:
http://blog. <http://blog.upscene.com/martijn/> upscene.com/martijn/
Database development questions? Check the forum!
http://www.database <http://www.databasedevelopmentforum.com>
developmentforum.com
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.173 / Virus Database: 270.8.1/1727 - Release Date: 15.10.2008
20:02
[Non-text portions of this message have been removed]
Ive a little problem with this:
CREATE PROCEDURE P_TEST(
INPUTPARAM1 varchar(50))
returns(
menge double precision)
AS /**/
declare variable statement1 varchar(100);
BEGIN
statement1 = 'Select Menge from auftraege where auftrag_pos in('||
inputparam1 || ')';
for execute statement :statement1 into :menge do suspend;
END
The result is: Precompiler Error: parsing error - execute.
Any ideas?
Thank you.
Mit freundlichen Grüßen/with best regards
SATRON Sachsen
Steuerungstechnik GmbH
Olaf Kluge
Fon +49 (0) 37 25/ 35 06-31
Fax +49 (0) 37 25/ 35 06-12
Mob +49 (0) 1 70/ 92 92 375
E-Mail: <mailto:olaf.kluge@...> olaf.kluge@...
...........................................................................
SATRON Sachsen Steuerungstechnik GmbH
Geschäftsführer: Bernd Grötzschel, Gerd Kaden
Sitz: D-09405 Zschopau, Johann-Gottlob-Pfaff-Straße 7
Amtsgericht: Chemnitz HRB 1218
Diese E-Mail ist vertraulich und beabsichtigt einzig zum Gebrauch der
Person, an die sie adressiert ist.
Wenn Sie nicht der Empfänger sind, nehmen Sie zur Kenntnis, dass Sie diese
E-Mail in Fehler und jeder Verwendung erhalten haben,
Verbreitung, Weiterleitung, Drucken oder Kopieren dieser E-Mail wird strikt
verboten.
_____
Von: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] Im Auftrag von Martijn Tonies
Gesendet: Donnerstag, 16. Oktober 2008 09:35
An: firebird-support@yahoogroups.com
Betreff: Re: [firebird-support] execute statement and in(variable)
Hello Olaf,
> The follow code doesn't work:Any message?
> Declare statement1 as string;You cannot have the INTO clause inside this string.
>
> Statement1 = "select abc from tabc where x =" || :inputparameter || " into
> :iabc "
> For Execute statement :statement1INTO :iabc
> Do beginOf course not.
> .
> end
>
> When I take the "for" into the statement-string, it doesn't work too.
> The reason for this statement is an input parameter (string) with a list.How "doesn't" it work?
> (100, 200, 300). This is also my second question:
>
> The in(..) statement doesn't work,
>if I delivered an internal variable soCorrent, IN ( ... ) cannot work with a variable cause a variable is a single
> for example:
>
> For select a from abc where b in (:inputparametervariable). But this works
> fine: For select a from abc where b in (100, 200, 300).
value,
not a text string. With [FOR] EXECUTE STATEMENT this should work fine.
> Please, can you give me a tip? The question 1 is described in theRead the syntax again ;-)
> firebird-documentation, but it doesn't work.
>I don't like to set moreMartijn Tonies
> input-parameters for my procedure, therefore this stringlist.
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle &
MS SQL Server
Upscene Productions
http://www.upscene. <http://www.upscene.com> com
My thoughts:
http://blog. <http://blog.upscene.com/martijn/> upscene.com/martijn/
Database development questions? Check the forum!
http://www.database <http://www.databasedevelopmentforum.com>
developmentforum.com
No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.173 / Virus Database: 270.8.1/1727 - Release Date: 15.10.2008
20:02
[Non-text portions of this message have been removed]