Re: PL/SQL - is inserting of %ROWTYPE variable possible?

From: FC <flavio_at_tin.it>
Date: Wed, 08 Jan 2003 18:39:59 GMT
Message-ID: <3g_S9.1646$AA2.46243_at_news2.tin.it>


If the fields being added/deleted are not referenced in the program, I don't see the point.
If they are referenced, then you are doing something with them in your programs, so, again, I don't see the point, sooner or later you must deal with them, I don't understand why selects/inserts are representing an obstacle.

If you are developing general purpose procedures taking "records" and "tables" as arguments, then you can take advantage of dynamic SQL for building the DML statements.
I have the impression that you are trying to translate something from MS-Access, where you have the "fields" collection and you can enumerate its members.
But in the end, I still don't understand why it is "necessary" that approach, please enlighten me.

Bye,
Flavio

"Scott Mattes" <Scott_at_TheMattesFamily.ws> wrote in message news:08WS9.64524$VA5.10589535_at_news1.news.adelphia.net...
> How about, if the table structure changes already written code won't break
> unless the field/s being changed in the code between the select and insert
> are changed?
>
> In the 2+ years that I have been on this project, which was to have gone
> live 2 years ago, the tables in the DB have changed AT LEAST once a week!
>
>
>
> "FC" <flavio_at_tin.it> wrote in message
> news:nkVS9.95277$R45.4486975_at_news2.tin.it...
> > Could you please supply a valid reason to do this instead of using more
> > orthodox approaches ?
> >
> > Bye,
> > Flavio
> >
> >
> > "Bogien" <bogien_at_xcom.pl> wrote in message
 news:3E1B57D3.DDBC8532_at_xcom.pl...
> > > Hello,
> > >
> > > Suppose I have a table named "tab" with columns "a", "b", "c", "d",
 "e".
> > > Now, I declare a variable named "rec" of type "tab%ROWTYPE", which
> > > reflects single record of the table.
> > >
> > > Question:
> > > Can I insert such variable into the table in PL/SQL at once?
> > >
> > > So fat, I've been performing this task this way (doesn't look
 nice...):
> > > INSERT INTO tab (a, b, c, d, e) VALUES (rec.a, rec.b, rec.c, rec.d,
 rec.e);
> > >
> > > Is something like "INSERT INTO tab VALUES rec" possible?
> > >
> > > Thanks!
> > >
> > > PS. I use Oracle 9i, if it can be of any help.
> >
> >
>
>
Received on Wed Jan 08 2003 - 19:39:59 CET

Original text of this message