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: PL/SQL statement

Re: PL/SQL statement

From: Kenneth C Stahl <BlueSax_at_Unforgettable.com>
Date: Tue, 02 Nov 1999 14:47:37 -0500
Message-ID: <381F3FD9.24B3F21E@Unforgettable.com>


elufker_at_llama.swcp.com wrote:
>
> Hi All;
>
> Does anyone have any example code that would check to see if a table
> exsists, and if not skip to the create table statement. If the table does
> exsist, then just skip to the end.
>
> Thanks in advance for any help here
> Eddie Lufker

Declare

    Cursor C1 is
    select *
    from all_tables
    where owner = 'SCOTT'
      and table_name = 'EMP';
    Rowcount Integer(1) := 0;
Begin

    For I in C1 Loop

        Rowcount := SQL%ROWCOUNT;
        Exit;

    End Loop
    If Rowcount = 0 Then

        /* put code here to create table */     End if;
End; Received on Tue Nov 02 1999 - 13:47:37 CST

Original text of this message

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