Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> PL/SQL Insert
Try
Insert into datafile
values (data_record.fld_a,data_record.fld_b);
But be very careful if you do not explicitly name the columns you are
inserting the values into
and you later modify the table by adding a column, or recreate the table
with a different column order
things could get very messy. When you do not name the columns you are
inserting oracle inserts the first data value into the first column in
the table and the second value into the second column etc. This works
fine until the order of columns changes. If you are lucky you will get a
data type error. If you are unlucky the load will succeed and you will
have the wrong data in the wrong column!
-----Original Message----- From: dejaron_at_my-dejanews.com [mailto:dejaron_at_my-dejanews.com] Posted At: Wednesday, September 02, 1998 1:07 PM Posted To: server Conversation: PL/SQL Insert Subject: PL/SQL Insert Is there a simple way to INSERT a row without having to list each field name? Here's a code example... DECLARE data_record data_file%ROWTYPE; BEGIN; data_record.fld_a := 'ABC123'; data_record.fld_b := 1234.56; INSERT INTO data_file {what to put here?} END; I have a large record with over 100 fields and listing them (specifically maintaining them) is a hassle. Your help is appreciated. -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your OwnFree Member Forum Received on Wed Sep 02 1998 - 16:13:34 CDT