Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting records to a table

Status
Not open for further replies.

isonlyme

Programmer
Apr 20, 2002
171
PR
Hi all!!

I have a simple question, i want to insert records to a table using the exceptions table results for example:

insert into contact_arc (
CONTACTID,
CSUSERID,
STARTDATETIME,
CUSTOMERNUMBER,
ARCHIVEDATETIME)
values('00125200104261927300339', <---select from exceptions
195,
TO_DATE('2001-09-03 23:59:00', 'SYYYY-MM-DD HH24:MI:SS','NLS_CALENDAR=GREGORIAN' ),
)

now this is the thing i want to select all records (6019 in total) an use only the rowid (that would be the contactid for the table i'm inserting to) and added to the values section
in other words i don't want to run 6019 times the insert statement changing manually the first value.

Can anyone suggest how can this be done with a script or SQL statement?

Thanks in advance...
 
Something like:

INSERT INTO contact_arc (
CONTACTID,
CSUSERID,
STARTDATETIME,
CUSTOMERNUMBER,
ARCHIVEDATETIME)
SELECT rowid,
195,
TO_DATE('2001-09-03 23:59:00',
'SYYYY-MM-DD HH24:MI:SS',
'NLS_CALENDAR=GREGORIAN' ),
NULL,
NULL
FROM exceptions;

?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top