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: Reference an arbitrary number of tables?

Re: Reference an arbitrary number of tables?

From: Erik Diehn <erikd_at_nospamm.cometsystems.com>
Date: Wed, 29 Sep 1999 12:41:01 -0400
Message-ID: <37F2411D.412844EA@nospamm.cometsystems.com>

Ed Stevens wrote:
>
> Name all the related tables in a consistant manner. "SELECT TABLE_NAME
> FROM DBA_TABLES WHERE TABLE_NAME LIKE ...." will give you a result set
> of the tables you want to process.
>
>In article <37F1795F.BCE6F613_at_hotmail.com>,
> Jay <manongjay_at_hotmail.com> wrote:

<snip>
> > Then suppose we need to insert values into these tables:
> > insert into foo_one(id) value(1);
> > insert into foo_two(id) value(2);
> > insert into foo_three(id) value(3);
> > ...
> > insert into foo_N(id) value(N);
> >
> > Is it possible to create a stored procedure that will
> > simplify the above insert for N number of tables???
> > If so how?
> >
> > Thanks in advance.
> >
> >

On the other hand, if you've got a value that you need to insert into an arbitrary number of tables, instinct tells me that you probably need to reexamine your data relationships. You should be able to design your db in such a way that inserts across unknown numbers of tables are unnecessary. Of course, I don't know the specifics of your situation -- why do you need a stored procedure that does this, anyway?

Erik Diehn
erikd_at_nospamm.cometsystems.com-nospamm Received on Wed Sep 29 1999 - 11:41:01 CDT

Original text of this message

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