From: | "William ZHANG" <uniware(at)zedware(dot)org> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: PL/pgSQL 'i = i + 1' Syntax |
Date: | 2006-05-17 14:36:57 |
Message-ID: | e4fcfr$2rd6$1@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
""Albe Laurenz"" <all(at)adv(dot)magwien(dot)gv(dot)at>
> Tom Lane wrote:
...
> > If modifying the loop variable is disallowed in PL/SQL, I'm all for
> > disallowing it in plpgsql, otherwise not. Anyone have a
> > recent copy of Oracle to try it on?
>
> I tried this on Oracle 10.2.0.2.0 (which is the most recent version):
>
> SET SERVEROUTPUT ON
> BEGIN
> FOR i IN 1..10 LOOP
> i := i + 1;
> DBMS_OUTPUT.PUT_LINE(i);
> END LOOP;
> END;
> /
> i := i + 1;
> *
> ERROR at line 3:
> ORA-06550: line 3, column 7:
> PLS-00363: expression 'I' cannot be used as an assignment target
> ORA-06550: line 3, column 7:
> PL/SQL: Statement ignored
>
> And the documentation also explicitly states that it is not allowed.
>
> By the way, PL/SQL screams if you want to do an assignment with '='.
> But I guess that the current behaviour of PL/pgSQL should not reflect
> that to maintain backward compatibility, right?
>
I think Oracle's syntax and behaviour are better.
As for this feature, breaking the backward compatibility is acceptable.
Regards,
William ZHANG
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2006-05-17 14:39:17 | Re: pg_dump and backslash escapes |
Previous Message | Tom Lane | 2006-05-17 14:31:24 | Re: pg_dump and backslash escapes |