Subject | RE: [IBDI] Create Proceedure Question |
---|---|
Author | Claudio Valderrama C. |
Post date | 2000-11-23T08:14:37Z |
> -----Original Message-----Robert, I may be flamed since this is not a tech support list, but anyway:
> From: Robert F. Tulloch [mailto:tultalk@...]
> Sent: MiƩrcoles 22 de Noviembre de 2000 16:19
>
> IBConsole: Preparing below return SQL Parse Error Parameter
> Name Expected. I have gone through this over and over to make sure
> names are correct and in correct sequence. Can't see problem so I
> must conclude that 1. I am blind; 2. I don't know what I am doing;
> 3. One cannot do this.
- IBConsole has some problems in the parser. For example, if you don't put
the latest SET TERM command to restore the default terminator, you'll be
able to compile procedures that otherwise won't be accepted. Don't worry
about restoring the terminator for now, since current IBConsole resets it
automagically to its default after each command. No joke, Jeff explained
briefly how the code he received works in this sense.
- When you are in doubt, please use the command-line islq.exe utility to
compare.
- Your procedure is really convoluted. You are doing:
select ID,
(select A from ...),
(select B from ...)
(select C from ...)
from tbl
into :ID, :A, :B, :C;
and so you're complicating your life only for masochism. Let's face it,
nested selects in this case are used when the nested queries are driven by
the outer select, for example:
select ID,
(select A from t where t.f = tbl.f),
(select B from t2 where t2.f = tbl.f)
(select C from t3 where t3.f = tbl.f)
from tbl
into :ID, :A, :B, :C;
but in your case, the inner selects have no clause that link them to the
outer select. Therefore, rewrite your procedure for the sake of clarity as:
select ID from tbl into :ID;
select A from t into :A;
select B from t2 into :B;
select C from t3 into :C;
and put a suspend at the end instead of the EXIT, so you'll avoid an IB bug
by using selectable procedures instead of executing procedures that have
output parameters. You have been warned.
- I don't agree with your conclusion in kinobi.ibconsole NG that colons
shouldn't be used before variable names in the INTO clause. I noticed you
have an space between the colon and the "NewDues" variable; don't do that
and avoid further motives to confuse the parser. If you come with an example
in isql.exe where a colon in front of a variable name after the INTO clause
makes a compilation to fail, I would consider such case a bug.
C.