Home > Software engineering >  Update not occurring during script
Update not occurring during script

Time:10-01

I am running a script that Creates a table Copies records into the table using the POSTGRESQL Copy Function Then I create an enhanced version of the table with additional fields I insert records from the first into the second table using an Insert into with a select Then I run an Update to add field description based on a mater file When I review the second table, there are no updates. However if after a few minutes I run the exact same update, all is good.

Update elan_staging.rx_claims  
set proprietary_name=public.ndc.proprietary_name,
non_proprietary_name=public.ndc.non_proprietary_name,
package_description=public.ndc.package_description,
labeler_name=public.ndc.labeler_name
from public.ndc
where ndc_number_code=ndc_11;

Thoughts?

CodePudding user response:

Maybe you start your second update before the commit takes place? In that case data is not yet visible for the second transaction.

  • Related