Path: news.easynews.com!easynews!feedwest.news.agis.net!aleron.net!sfo2-feed1.news.algx.net!allegiance!logbridge.uoregon.edu!fu-berlin.de!uni-berlin.de!213.145.128.88!not-for-mail
From: "Roman Mirzaitov" <rmirzaitov@kt.kg>
Newsgroups: comp.databases.oracle.server
Subject: Re: newbie: Pl/SQL - loop - hotbackup
Date: Fri, 5 Apr 2002 09:06:19 +0500
Lines: 66
Message-ID: <a8j4bi$sthh5$1@ID-127142.news.dfncis.de>
References: <2ea00f5e.0204041728.60feb12f@posting.google.com>
NNTP-Posting-Host: 213.145.128.88
X-Trace: fu-berlin.de 1017975987 30328357 213.145.128.88 (16 [127142])
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Xref: easynews comp.databases.oracle.server:142108
X-Received-Date: Thu, 04 Apr 2002 20:04:13 MST (news.easynews.com)

Hi,

looking carefully at your code I guess that you miss one | sign right after
...TABLESPACE '| ... statement.
Change like that: TABLESPACE '|| ... This is the first mistake.
And also I suggest to replace ||tablespacename|| expression with
||tablespacename.tablespace_name|| one.

Regards,

--
Roman Mirzaitov
Brainbench MVP for Oracle Administration
www.brainbench.com


"Vi." <viper@gmx.fr> wrote in message
news:2ea00f5e.0204041728.60feb12f@posting.google.com...
> Hi,
>
> I am trying to write a code to turn all the tablespaces on a db box in
> backup mode. I have the code using sqlplus but this time, I need to
> trigger that from a JDBC connection.
>
> Here is the code I am trying to send through JDBC:
>
> BEGIN
> FOR tablespacename IN (SELECT tablespace_name FROM dba_tablespaces)
> LOOP
> execute immediate 'ALTER TABLESPACE '|tablespacename||' BEGIN BACKUP';
> END LOOP;
> END;
> /
>
> and I am getting the following exception (because the pl/sql is
> wrong):
>
> Exception occured in SQL statement [ BEGIN FOR tablespacename IN
> (SELECT tablespace_name FROM dba_tablespaces) LOOP execute immediate
> 'ALTER TABLESPACE '|tablespacename||' BEGIN BACKUP'; END LOOP; END;
> ]:
> ORA-06550: line 1, column 118:
> PLS-00103: Encountered the symbol "|" when expecting one of the
> following:
>
>    . ( * @ % & = - + ; < / > at in is mod not rem return
>    returning <an exponent (**)> <> or != or ~= >= <= <> and or
>    like between into using || bulk
> The symbol ". was inserted before "|" to continue.
>
> Exception occured: ORA-06550: line 1, column 118:
> PLS-00103: Encountered the symbol "|" when expecting one of the
> following:
>
>    . ( * @ % & = - + ; < / > at in is mod not rem return
>    returning <an exponent (**)> <> or != or ~= >= <= <> and or
>    like between into using || bulk
> The symbol ". was inserted before "|" to continue.
>
>
> What wrong in this simple pl/sql code ?
> Thank you VERY MUCH for your help.
>
> Jean-Noel


