Received: (qmail 30225 invoked from network); 29 Jun 2012 04:25:33 -0500
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by static-ip-85-25-126-90.inaddr.ip-pool.com with SMTP; 29 Jun 2012 04:25:30 -0500
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 54939ED931D;
 Fri, 29 Jun 2012 05:25:18 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1340961918; bh=uTZomoQrO1ZKEhK1xLproC9VOBviRrv5DnlwvBrN
 134=; h=MIME-Version:In-Reply-To:References:From:Date:Message-ID:
	 Subject:To:Cc:Content-type:Content-Transfer-Encoding:Sender:
	 Reply-To:List-help:List-unsubscribe:List-Id:List-subscribe:
	 List-owner:List-post:List-archive; b=uWTER6HVbpPjaltuvzd8fLf31b7Ly
 SHVaBjiggtNTYg3l4lw6LQb/+7gRHOdBesMd1tOQemzPrOgf8UrLcOyKyykCq4qB6FJ
 A1LnkJLTNhrWImf/9N8yme7+P5vYzMDymIxpwVVuozp0dIHUEaBh5ckBEF1WObQqFpB
 2b2ObpRE=
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id uzh0mwXdBhan; Fri, 29 Jun 2012 05:25:18 -0400 (EDT)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 09DC4ED9300;
 Fri, 29 Jun 2012 05:24:34 -0400 (EDT)
Received: with ECARTIS (v1.0.0; list oracle-l); Fri, 29 Jun 2012 05:23:53 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 78A52ED8CFD
 for <oracle-l@freelists.org>; Fri, 29 Jun 2012 05:23:53 -0400 (EDT)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id FbSFvS7wqjbc for <oracle-l@freelists.org>;
 Fri, 29 Jun 2012 05:23:53 -0400 (EDT)
Received: from na3sys009aog135.obsmtp.com (na3sys009aog135.obsmtp.com [74.125.149.84])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7FCA6ED8CEC
 for <oracle-l@freelists.org>; Fri, 29 Jun 2012 05:23:52 -0400 (EDT)
Received: from mail-vb0-f48.google.com ([209.85.212.48]) (using TLSv1) by na3sys009aob135.postini.com ([74.125.148.12]) with SMTP
 ID DSNKT+10JtqfGiPu/+mU49cG7kgD465fPCDX@postini.com; Fri, 29 Jun 2012 02:23:52 PDT
Received: by vbjk17 with SMTP id k17so2707814vbj.35
        for <oracle-l@freelists.org>; Fri, 29 Jun 2012 02:23:47 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=google.com; s=20120113;
        h=mime-version:in-reply-to:references:from:date:message-id:subject:to
         :cc:content-type:x-gm-message-state;
        bh=mVq9jANfxWBR3/zeSCrHWbyctv6hipB8nDKNs3oUEJ4=;
        b=E+UjdMQDCQUnTJYbRSiz2shzUkoW3PRqUMWIr4PDDKCJ9OF6qXQcd5FyqWvWqRGhg2
         xbgMsfoKSsYDPSHs3Dv6tl3Yb9E3j0aQ0wI5x62MLVjTlvfPEaXcnpDRfRT5gkiwtP8d
         5KnGewnpkS3jGsansApzsTKBPKFmEbm6f7tS73rIaCGrZkJnSQpmk0RUcNyG1WYi3Wuo
         iDOD7pLGspbwHPQ4Zo5TV2vhdCHe/kitVjqaQuR+sDBdIGhBdmNQds55O/NkLO+dcFG0
         1NbjHDUxcsm2zvp5fgCKj4c5MBQQoE3iypNQV+MRFYh6eR122TE+h7hvCMu63RlT8oDl
         bpcg==
Received: by 10.52.174.226 with SMTP id bv2mr419561vdc.32.1340961826902; Fri,
 29 Jun 2012 02:23:46 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.220.142.210 with HTTP; Fri, 29 Jun 2012 02:23:26 -0700 (PDT)
In-Reply-To: <1340961022.46688.YahooMailNeo@web29010.mail.ird.yahoo.com>
References: <CABe10sZNaXyiQ823TOFEdijmj-406V4ZesEd6PjFU2Q8brrS3A@mail.gmail.com>
 <A250F0C68C23514CA9F3DF63D60EE10E163BBD18@onews31> <CABe10sZ3ab4adK=_HUkr10yWDzH3mr86VctnFP4uNK1UXLSkvA@mail.gmail.com>
 <1340961022.46688.YahooMailNeo@web29010.mail.ird.yahoo.com>
From: Steve Baldwin <stbaldwin@multiservice.com>
Date: Fri, 29 Jun 2012 19:23:26 +1000
Message-ID: <CAC-6Hs3w7P9jVTY-nemsDouyBRQmyR7D=5v95hCVH3yeU76uEA@mail.gmail.com>
Subject: Re: Insert within PLSQL fails
To: hrishys@yahoo.co.uk
Cc: ORACLE-L <oracle-l@freelists.org>
Content-type: text/plain
X-Gm-Message-State: ALoCoQknLp9zuov2PMhHrxlOaFfCOt7RtuVvZHAh+bgoEIqv+MI3T+/t9G6X5cAqSJbyuRN6ESLG
Content-Transfer-Encoding: 8bit
X-archive-position: 43536
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: stbaldwin@multiservice.com
Precedence: normal
Reply-To: stbaldwin@multiservice.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l

Hi,
I am pretty sure that this is a compile-time error rather than a run-time
error.

If the row_chain_demo table does not exist at the start of execution you
need to make the insert dynamic.

HTH

Steve

On Fri, Jun 29, 2012 at 7:10 PM, hrishy <hrishys@yahoo.co.uk> wrote:

> Hi
> I have the following piece of plsql.
> Insert within the plsql fails any idea ?
>
> insert into row_chain_demo (col1,col256) values(1,'Hello World');
>             *
> ERROR at line 43:
> ORA-06550: line 43, column 13:
> PL/SQL: ORA-00942: table or view does not exist
> ORA-06550: line 43, column 1:
> PL/SQL: SQL Statement ignored
>
>
> declare
>
> l_create_table_query varchar2(2000) default 'create table row_chain_demo
> (col1 number) segment creation immediate' ;
> l_alter_table_query  varchar2(2000) ;
> l_column_name user_tab_columns.column_name%type default 'col' ;
>
>
> begin
>
> for x in (select *
>             from dual
>             where not exists (select null
>                                 from user_tables
>                                 where table_name = upper('row_chain_demo')
> ) )
> loop
>   execute immediate l_create_table_query;
> end loop;
>
> dbms_output.put_line (l_create_table_query);
>
> for l_cntr in 2..256
> loop
>   l_column_name       := 'col' || l_cntr ;
>   l_alter_table_query := 'alter table row_chain_demo add  ' ||
> l_column_name || ' char(2000) ' ;
>
>
>   for x in (select *
>                 from dual
>                 where not exists (select null
>                                     from user_tab_columns
>                                     where table_name =
> upper('row_chain_demo')
>                                     and column_name = upper( l_column_name
> )
>                                  )
>             )
>   loop
>     execute immediate l_alter_table_query ;
>
>   end loop;
>
> end loop;
> commit;
>
> insert into row_chain_demo (col1,col256) values(1,'Hello World');
>
> end;
> /
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>


---------------------------------------------------------------------------------------
This email is intended solely for the use of the addressee and may
contain information that is confidential, proprietary, or both.
If you receive this email in error please immediately notify the
sender and delete the email.
---------------------------------------------------------------------------------------


--
http://www.freelists.org/webpage/oracle-l


