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

Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie question about PL/SQL

Re: Newbie question about PL/SQL

From: Wim Poets <poetsw_at_realsoftware.be>
Date: Tue, 29 Aug 2000 07:06:20 GMT
Message-ID: <MhJq5.11$HH4.780@nreader1.kpnqwest.net>

declare

iCounter number;

begin
  select count() into iCounter from table;     if iCounter > 100 then

        update a table
    else
    insert in a table
    end if;
end;

Simon Filiatrault wrote in message ...
>Hi all,
>
>All I know for now is sqlplus and how to do a simple select statement.... I
>want to be able to do something like that:
>
>if (select count() from table) > 100
>then
> update a table
>else
> insert in a table
>end if;
>
>I am trying to do that trough sqlplus on a solaris 7 with oracle 8.05.
>Everthing would be done by a perl script. I want to insert or update
>depending on what's in that table.
>
>Can I use sqlplus to run that kind of program?
>
>I am used to work in sybase, where I can use isql to do that stuff, but it
>seems that sqlplus by itself does not do that...
>
>Any hints would help
>
>Thanks in advance
>
>Simon
>
>
>
Received on Tue Aug 29 2000 - 02:06:20 CDT

Original text of this message

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