Yes, all you have to do is change the select portion of the statement.
So if you wanted everyone's user id to read as BSMITH then you could do:

INSERT INTO RGTSYS/UELLU (EENAME,EUSRID, ECPM, ECPMC)

select EENAME, 'BSMITH', ECPM, ECPMC                    
 from uellu where eusrid = 'SMITHMI'   

or if the userid is a number and you wanted to make everyones user ID
one higher you could do:

INSERT INTO RGTSYS/UELLU (EENAME,EUSRID, ECPM, ECPMC)

select EENAME, EUSRID + 1, ECPM, ECPMC                    
 from uellu where eusrid = 'SMITHMI'   

You should be able to do anything you can do in a select statement.

Christopher

-----Original Message-----
From: midrange-l-bounces+cpayne=thecrowngrp.com@xxxxxxxxxxxx
[mailto:midrange-l-bounces+cpayne=thecrowngrp.com@xxxxxxxxxxxx] On
Behalf Of Smith, Mike
Sent: Friday, October 14, 2005 10:45 AM
To: midrange-l@xxxxxxxxxxxx
Subject: SQL Insert

I'm trying to create an SQL statement that will take records from a file
and duplicate them.  However, I want 1 field to change.  
I can get this to work 
INSERT INTO RGTSYS/UELLU (EENAME,EUSRID, ECPM, ECPMC)

select EENAME, EUSRID, ECPM, ECPMC                    
 from uellu where eusrid = 'SMITHMI'    

This copies the records as they are, however, I want to change the value
of EUSRID when I do the copy.  
I haven't been able to get this to work.  Is this possible?  
                

Michael Smith
iSeries.mySeries.


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.