Prepare for your Next Interview
This is a discussion on updateing the record with mapping different column within the SQL forums, part of the Databases category; i need to update the record in table line .but i have to map the specific line record using line_esn ,account,company_number_loc .but in update we can pass only one ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
updateing the record with mapping different column
i need to update the record in table line .but i have to map the specific line record using line_esn ,account,company_number_loc .but in update we can pass only one table like update "tablename".
How could i do that....... update line_esn le, line l, account a, company_number_location cnl set l.pin =8351 where le.line_id = l.line_id and le.mdn = '4042108351' and le.esn = '09900311161' and cnl.company_cd = 'REVASDATA' and a.number_loc = cnl.number_loc and a.account_id = l.account_id |
| The Following User Says Thank You to AnjaliWatane For This Useful Post: | ||
| Sponsored Links |
|
|||
|
Re: updateing the record with mapping different column
You can't specify more than one table name in update.
Do it in the following way UPDATE line l SET l.pin = 8351 WHERE l.line_id = ( SELECT line_id from line_esl le WHERE le.line_id = l.line_id AND le.mdn = '4042108351' AND le.esn = '09900311161' ) and l.account_id = (SELECT a.account_id from account a , company_number_location cnl WHERE a.account_id = l.account_id AND a.number_loc = cnl.number_loc and cnl.company_cd = 'REVASDATA') |
| The Following User Says Thank You to krishnaindia2007 For This Useful Post: | ||
|
|||
|
Re: updateing the record with mapping different column
Have your tried this
UPDATE l SET l.pin = 8351 FROM line l join line_esl le on le.line_id = l.line_id AND le.mdn = '4042108351' AND le.esn = '09900311161' join account a on a.account_id = l.account_id AND a.number_loc = cnl.number_loc and cnl.company_cd = 'REVASDATA' Regards AM |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| mapping | spandana_it | Data Warehousing | 1 | 09-12-2007 05:27 AM |
| XML Object Mapping | garg_me | Data Warehousing | 2 | 09-07-2007 11:22 AM |
| How can we upload job after mapping? | selvaraj.durairaj | Data Warehousing | 1 | 08-24-2007 08:11 AM |
| Mapping and Auxiliary Mapping? | sanghala | Data Warehousing | 0 | 08-21-2007 05:25 AM |
| Record GUI Script and Record Session icons are always disabled | Geek_Guest | Rational Robot | 1 | 06-01-2007 08:01 AM |