Re: PLS-00103 ORA-06550: line 27, column 0

From: Mark <markg_at_mymail.co.uk>
Date: 22 May 2002 00:22:10 -0700
Message-ID: <ddb31653.0205212322.6ad2fd26_at_posting.google.com>


You havent ended your block!

Put an END after your end_loop;

M

leefarrant_at_hotmail.com (Lee Farrant) wrote in message news:<97ad5817.0205210228.23e86e8e_at_posting.google.com>...
> I am havng problems trying to cure this error, can anyone help?
>
> Error is:
>
> ORA-06550: line 27, column 0:
> PLS-00103: Encountered the symbol "end-of-file" when expecting one of
> the following:
>
> begin declare end exception exit for goto if loop mod null
> pragma raise return select update while <an identifier>
> <a double-quoted delimited-identifier> <a bind variable> <<
> close current delete fetch lock insert open rollback
> savepoint set sql execute commit forall
> <a single-quoted SQL string>
> =====================================================================
>
> Code is:
>
> declare
> l_stmt varchar2(20000) := null;
> l_subid pls_integer;
> l_id pls_integer;
> l_old pls_integer;
> l_count pls_integer := 0;
> begin
> select subid ,custid into l_subid, l_id from ( select subid
> ,count(custid) idd from custin group by custid order by 2 desc)
> old_table where rownum < 2 order by 2;
> for i in 1..l_id
> loop
> l_stmt := l_stmt || 'subid' ||i ||' '||'varchar2(20) ,';
> end loop;
> l_Stmt := substr(l_stmt, 1, length(l_stmt) -1); -- remove additional
> comma
> l_stmt := 'create table new_table ( '|| l_stmt ||' )';
> execute immediate l_stmt;
> begin
> for c in (select * from old_table order by 2) loop
> count := count + 1;
> if c.custid <> l_old then l_count := 1;
> if count = 1 then l_stmt := 'insert into new_table(custid,subid'
> || l_count ||') values('||c.custid||','||c.subid||');commit;';
> else l_stmt := 'update new_table set subid'||l_count|| ' = ' ||
> c.subid ||'where custid = '||c.custid ||';commit';
> end if;
> execute immediate l_stmt;
> l_old := c.custid;
> end if;
> end loop;
> ===================================================================
>
> thanks in advance
>
> Lee
Received on Wed May 22 2002 - 09:22:10 CEST

Original text of this message