Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Inserting a Record into a Table
Thanks a lot. This is what I need ..... but unfortunately we are on 8.0.5. But this does tell me that I can not do it the way I want.
I appreciate the confirmation.
Kevin
-----Original Message-----
Sent: Friday, August 03, 2001 9:53 AM
To: 'ORACLE-L_at_fatcity.com'; 'kgel_at_ppoone.com'
If you are (or will be) using 9i,
straight from the manual ....
<manual>
Inserting Records into the Database
A new PL/SQL-only extension of the INSERT statement lets you insert records
into database rows using a single variable of type RECORD or %ROWTYPE
instead of a list of fields. That makes your code more readable and
maintainable. The record type cannot be nested. Also, the number of fields
in the record must equal the number of columns listed in the INTO clause,
and corresponding fields and columns must have compatible datatypes. An
example follows:
DECLARE
TYPE EmpRec IS RECORD (
emp_id NUMBER(4), job_title VARCHAR2(9), salary NUMBER(7,2));
emp_info.emp_id := 7975; emp_info.job_title := 'CLERK'; emp_info.salary := 1500;
DECLARE
dept_info dept%ROWTYPE;
BEGIN
dept_info.dept_num := 70; dept_info.dept_name := 'PERSONNEL'; dept_info.location := 'DALLAS';
HTH
Raj
QOTD: Any clod can have facts, but having an opinion is an art !
*********************************************************************2
This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.
*********************************************************************2
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists --------------------------------------------------------------------To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Aug 03 2001 - 12:56:11 CDT
![]() |
![]() |