sql - Insert into from CTE -


  dtl   (select cmpi_code,          cmn_cdty_mtrl,          cmi_wt_factor,          cmi_cntrct_rate,          'pl',          present_price,          trm_code,          round(((nvl(present_price,1)*cmi_wt_factor) / cmi_cntrct_rate),2) pl_factor   vw_cmd_material trm_code = 41)   insert ipa_prcadj_hdr(trm_code,ipaph_adj_factor,ipaph_amt_cur,ipaph_remarks)   select trm_code,sum(pl_factor) pl_factor,((sum(pl_factor)*10)) amt_cur,'asdf'    dtl group (trm_code); 

showing error ora-00928: missing select keyword

this syntax insert table cte:

-- create table tmp ( tmp_id number(10) );  insert tmp( tmp_id )   cte (     select 1 tmp_id dual   )   select tmp_id   cte; 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -