Hi there, I'm trying to update some specific fields in a table(solicitudes) from oracle with information from another table(originacion_decision). In the oracle table solicitudes I have two fields, score and decision_id, those fields are null and I have to update them with the fields score and decision from the table originacion_decision only with the matching ones I'm using this code with proc sql procedure, but it still doesn't work, really don't know why I'm doing wrong. The unique key is a combination of the fields tipo_identificacion, nro_identificacion, nro_solicitud, codigo_subproducto libname sasvi oracle user=&user password= &pswd
path=&path
cas mysess sessopts=(caslib=Public);
libname Public cas caslib=Public datalimit=all;
caslib _all_ assign; proc sort data=Public.originacion_decision out= Public.originacion_decision nodupkey; by nro_identificacion tipo_identificacion nro_solicitud; run; proc sort data=sasvi.solicitudes out=Public.originacion_decision nodupkey; by nro_identificacion tipo_identificacion nro_solicitud; run; proc sql; update sasvi.solicitudes as ora set score=(select id.score from Public.originacion_decision as id where ora.score=. and ora.tipo_identificacion=id.tipo_identificacion and ora.nro_identificacion=id.nro_identificacion and ora.codigo_subproducto=id.codigo_subproducto and ora.nro_solicitud=id.nro_solicitud), decision_id=(select id.decision from Public.originacion_decision as id where ora.decision_id="" and ora.tipo_identificacion=id.tipo_identificacion and ora.nro_identificacion=id.nro_identificacion and ora.codigo_subproducto=id.codigo_subproducto and ora.nro_solicitud=id.nro_solicitud) where exists (select * from Public.originacion_decision as id where ora.tipo_identificacion=id.tipo_identificacion and ora.nro_identificacion=id.nro_identificacion and ora.codigo_subproducto=id.codigo_subproducto and ora.nro_solicitud=id.nro_solicitud); quit; I'll be grateful if somebody help me!
... View more