Re: PL/SQL and SQL Navigator

From: Niraj Mehta <mehta_niraj_at_hotmail.com>
Date: Thu, 22 Aug 2002 04:26:59 GMT
Message-ID: <nKZ89.85179$eK6.2840856_at_twister.austin.rr.com>


Actually, there is a syntax error in the code. Here is what it should be begin

   if exists (select 1 from user_tables where table_name='C_POLOZ') then    begin

       select 1 from dual;
   end;
   else
   begin

       select 2 from dual;
  end;
   end if;
 end;

"Pavel Vetesnik" <Pavel.Vet_at_volny.cz> wrote in message news:3657dfa4.0208020013.68ed08fc_at_posting.google.com...
> Hello,
>
> thank you for your answer -
> - I've tried your solution, but I got folowing error:
> ============
> [1]: (Error): ORA-06550: line 5, column 3: PLS-00103: found symbol
> "ELSE" in situation, where folowing was supposed:
> 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>
> ORA-06550: line 8, column 1: PLS-00103: found symbol "END"
> ============
>
> But thank you anyway - think I use the code provided by Thomas
> Olszewicki. It is easy an elegant solution.
>
> Pavel
>
> "J?gen ?tergaard" <joesterg_at_hotmail.com> wrote in message
 news:<aicco7$2jql$1_at_news.cybercity.dk>...
> > Pavel,
> >
> > in the SQL*Navigator, can't you just wrap your PL/SQL script below into
 the
> > begin end:
> >
> > begin
> > if exists (select 1 from user_tables where table_name='C_POLOZ') then
> > begin
> > select 1 from dual;
> > else
> > select 2 from dual;
> > end if;
> > end;
> >
> > and then run it? -this is a standard anonymous PL/SQL block of code.
> >
> > cheers,
> >
> > Jørgen
> >
> > "Pavel Vetesnik" <Pavel.Vet_at_volny.cz> wrote in message
> > news:3657dfa4.0207290218.c11c33b_at_posting.google.com...
> > > Hello,
> > >
> > > as you see, I am still beginner in using Oracle (ver 8.1.7.) and the
> > > SQL Navigator.
> > > I can run SQL commands in the Navigator without troubles. But as I
> > > found, I can't run the PL/SQL commands.
> > > For example I wanted to see, if a table exists. So I wrote this
> > > construction:
> > > ======================
> > > if exists (select 1 from user_tables where table_name='C_POLOZ') then
> > > begin
> > > select 1 from dual;
> > > else
> > > select 2 from dual;
> > > end if;
> > > ======================
> > > But I got ORA00900: Invalid SQL command
> > >
> > > As I learned, I may need to install a "procedural option". And I also
> > > learned (in
> >

 http://groups.google.com/groups?hl=cs&lr=&ie=UTF-8&oe=UTF-8&selm=36162906.49
> > 3E9E01%40websoft.com.au)
> > > that this option can be installed running catproc.sql script.
> > >
> > > Frankly - I am quite afraid of running this, because it must be run
> > > with administrator's privileges and I don't know if it will not hurt
> > > our existing code.
> > > So my questions:
> > > (1) Is installing "procedural option" (catproc.sql) safe?
> > > (2) Will this really help me in running PL/SQL commands in SQL
> > > Navigator (SQL Editor Window).
> > > (3) Should I use another tool to write Pl/SQL scripts?
> > >
> > > Thank you in advance!
> > > Pavel
Received on Thu Aug 22 2002 - 06:26:59 CEST

Original text of this message