Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

About show error 'PLS-00103: Encountered the symbol "_" when expecting one of the following'

Quanwen ZhaoAug 27 2017 — edited Aug 28 2017

Hi,experts

When i solve Oracle DataGuard physical standby database about GAP's problem,due to most of archived logs have not existed in dynamic performance view 'v$archived_log' and also existed in OS,therefore i need to register these archived logs manually,such as 'alter database register logfile '/u01/oradata/archivelog/1_90384_850739945.dbf';' and registering archived logs one by one is so difficult that i decide to use an PL/SQL code to finish.

My PL/SQL code as follows,execute it on SQL*Plus and has some error,

SYS@standby> begin

  2  for sequence in 90385 .. 90435

  3  loop

  4    execute immediate 'alter database register logfile '/u01/oradata/archivelog/1_' || sequence || '_850739945.dbf'';

  5  end loop;

  6  end;

  7  /

  execute immediate 'alter database register logfile '/u01/oradata/archivelog/1_' || sequence || '_850739945.dbf'';

                                                                               *

ERROR at line 4:

ORA-06550: line 4, column 80:

PLS-00103: Encountered the symbol "_" when expecting one of the following:

* & = - + ; < / > at in is mod remainder not rem return

returning <an exponent (**)> <> or != or ~= >= <= <> and or

like like2 like4 likec between into using || bulk member

submultiset

Please give me some advices,thanks!

Best Regards

Quanwen Zhao

This post has been answered by Manik on Aug 27 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2017
Added on Aug 27 2017
12 comments
23,926 views