Klaus Reger wrote:
> Am Mittwoch, 16. Mai 2001 16:10 schrieb Jan Wieck:
> > Here it is. stmt_else is defined as type <stmts>, not <stmt>.
> > The PLpgSQL_stmt_if struct has a condition query and two
> > statement lists (type <stmts>). You're trying to put a single
> > statement into the else part instead of a list of statements.
> Thank you for the hint! That was it.
>
> > Maybe it'll work if you surround it with another
> > PLpgSQL_stmts struct where your new PLpgSQL_stmt_if is the
> > only statement in it's list. Since I have some bigger work
> > outstanding for PL/pgSQL, send the resulting patch (if you
> > get it to work) directly to me.
> The patch follows this message. May you tell me what kind of work it is,
> cause I'm so curous :-). By the way, the next thing I try is a
> EXCEPTION WHEN OTHER-clause, like in Oracle. Let's look if I'm successful.
Patch applied.
Really a smart solution, just touching the gram.y and scan.l files and using the existing instruction code.
Thanks for the contribution.
What about a CASE ... WHEN ...? I think that could be implemented in a similar way. Don't do it right now,
I might be ready to commit the cursor stuff early next week and it'll touch alot more than just the grammar and
scanner.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com