Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Newbie: Saving a row
sounds more like you are UPDATING rather than INSERTING
here are some basics:
Inserting only selected fields into a table creating a NEW ROW:
insert into TABLE_NAME (<field_names separated by comma>) values (<values for each field specified>)
Updating just one field in an EXISTING ROW
update TABLE_NAME set FIELD_NAME = value where condition
cursor c1 is select field_name from table_name where condition FOR UPDATE
begin
for c in c1 loop
update table_name set field_name = some_new_value WHERE CURRENT OF C1;
end loop;
end;
as Sybrand Bakker will undoubted inform you at some point in this thread,
READ THE <expletive deleted> MANUAL
aka RTFM
"Daniel Morgan" <dmorgan_at_exesolutions.com> wrote in message
news:3DA72D34.3F82B653_at_exesolutions.com...
> P B wrote:
>
> > I've read a row from a table into a PL/SQL variable, made some change
> > (including the primary key) and want to insert it back to the table.
> >
> > Do I have to list all the 50 columns to do the insertion or I can
> > insert the row variable in one shot?
> >
> > Thanks
>
> Without seeing your code I haven't a clue what you mean by read a row
> into a variable so that answer is ... don't know because I don't know
> what you did.
>
> But likely ... it is that you must name the fields.
>
> Daniel Morgan
>
Received on Fri Oct 11 2002 - 17:24:26 CDT
![]() |
![]() |