Click here to Skip to main content
15,911,132 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
when i am inserting new item its working
but when im updating item its not working

can any one help me?

IF I_FBP_CHANGED = 'C' AND I_INITIAL_CUST_LOAD IS NOT NULL THEN
insert into ABC
(restortn_step_id, evnt_id ,cust_acc_no ,house_no ,street_name ,cust_name
, MODIFED_TIMESTAMP,MODIFED_BY )

(select I_STEP_ID as step_id ,
I_EVNT as evnt_id, a.acc_no,a.house_no, a.street_name
,a.cust_name
, sysdate , MODIFIED_BY from ABC a
where a.restortn_step_id = I_INITIAL_CUST_LOAD);

i need to update item using this query how?
Posted
Updated 4-Dec-13 1:15am
v2
Comments
AlexDpars 4-Dec-13 9:11am    
You mean using the select query?
devchina 5-Dec-13 0:02am    
insert query
AlexDpars 5-Dec-13 9:31am    
Ok you would like to update values in table abc with values of the insert statement right?

1 solution

This should do the trick...
SQL
UPDATE ABC
SET restortn_step_id = a.restortn_step_id,evnt_id = a.evnt_id --...
from ABC a
where a.restortn_step_id = I_INITIAL_CUST_LOAD
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900