因子库入库函数UpdateFactorData 源码

by  lianzhang

最近在大家因子库,刚写了个因子入库函数,粘出来,很简单,大家莫笑话

function UpdateFactorData(instance,username,password,table,column,FactorData,Date)

%this function is used to update factor data DB

 %programed by Lian Xiangbin(连长,<a href="mailto:785674410@qq.com">785674410@qq.com</a>),DUFE,20141009

%connect to the db

 conna=database(instance,username,password);

  %convert the mat to cell

 FactorDataCell=num2cell(FactorData);


%construct where cell

temp=['where date='];

temp1=repmat(temp,size(Date));

Where=strcat(temp1,'''',Date,'''');


%do the updating work

update(conna,table,{column},FactorDataCell,Where);


%close the connection

close(conna);



end