Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: sqlplus question

Re: sqlplus question

From: Johanne fradet <fradjoh_at_magma.ca>
Date: Thu, 29 Aug 2002 22:49:32 GMT
Message-ID: <0yxb9.10320$V21.220708@news>


Thank you Daniel for the answer.

For Analyze, Native dynamic sql would work but sometimes we need to execute SQLplus command conditionally
like EXIT when certain criteria are met so is it possible to do that without writing the command to a file?
Daniel Morgan <dmorgan_at_exesolutions.com> wrote in message news:3D6E5AF6.D63DCC8E_at_exesolutions.com...
> Johanne fradet wrote:
>
> > I have win2k
> > Oracle 8i (8.1.7.3)
> >
> > I'm trying to conditionally execute a command in sqlplus based on what
the
> > user entered in the table.
> >
> > I tried to resolved that with substitution variable like this
> >
> > COL cal NEW_VALUE cal;
> >
> > SELECT DECODE(field_entered,'ANAYLSE',' ','rem') cal
> > FROM parm_entered;
> >
> > &cal ANALYZ TABLE ......;
> >
> > this does not work because I think that sqlplus is expecting a command
at
> > the begining of a line
> >
> > I know I could do the conditional execution of the command by putting
the
> > analyze command into a file
> > and calling that file with the substitution variable like before and it
> > would work because the line would
> > begin with @ BUT i do not like the idea of creating a file for one
line
> > of code and was wondering
> > if it was possible to trick it to work . I also try to do it through
> > PL/SQL but it did not like the ANALYZE
> > command(and the exact same command worked direcly in sqlplus)
> > so I supposed it is not a command that can be run through PL/SQL.
> >
> > I hope, I'm not asking something obvious but I did not find my answer in
the
> > documentation
> >
> > Thanks in advance
>
> Have you heard of native dynamic SQL?
>
> If not ... investigate it at http://tahiti.oracle.com.
>
> Daniel Morgan
>
Received on Thu Aug 29 2002 - 17:49:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US