Home » SQL & PL/SQL » SQL & PL/SQL » Inserting values
Inserting values [message #246654] Thu, 21 June 2007 09:56 Go to next message
lawlade
Messages: 59
Registered: May 2007
Location: LAUREL, MARYLAND
Member
Can someone send me the code to insert values into a values based on a select statement while changing the values of one column

SQL> desc svc_ee_mtf
Name Null? Type
----------------------------------------- -------- ----------------------------
SVC_EE_CD NOT NULL VARCHAR2(5)
FIXED_COST_PERCENT NOT NULL NUMBER(3,2)
FISCAL_YEAR NOT NULL VARCHAR2(4)
SVC_CD NOT NULL VARCHAR2(1)
PARENT_DMIS_ID NOT NULL VARCHAR2(4)

my rationale is
insert into svc_ee_mtf
select * from svc_ee_mtf
where fiscal_year = '2007 and parent_dmis_id = '6223'


and then I get stumbed. Insert new values for parent_dmis_id with 0100.

Can anyone help? Please let me know if anyone needs clarification. Thank you so much!
Re: Inserting values [message #246679 is a reply to message #246654] Thu, 21 June 2007 11:19 Go to previous messageGo to next message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
insert into svc_ee_mtf (col1, col2, ..., PARENT_DMIS_ID)
select col1, col2, ..., '0100'
from ...

Regards
Michel
Re: Inserting values [message #246932 is a reply to message #246679] Fri, 22 June 2007 09:33 Go to previous message
lawlade
Messages: 59
Registered: May 2007
Location: LAUREL, MARYLAND
Member
I thought as much. Thanks for your response Michel. You are genius!
Previous Topic: Series of numbers
Next Topic: Concat SQL results
Goto Forum:
  


Current Time: Sun Dec 11 02:33:47 CST 2016

Total time taken to generate the page: 0.17214 seconds