Skip to main content

04a/Query for job changes

This job was provided by an OpenFn.org user via the job library API.

Metadata

  • Name: 04a/Query for job changes
  • Adaptor: @openfn/language-mysql
  • Adaptor Version: latest
  • Created almost 5 years ago
  • Updated over 4 years ago
  • Score: 0 (an indicator of how useful this job may be)

Key Functions

alterState

Expression

sqlString(state => {
return "SELECT position_id, position_name, salary, facility_id, facility_name, status \
FROM position_updates WHERE status in ('NEW', 'CLOSED');";
});

alterState(state => {
state.new_jobs = state.response.body;
console.log(state.new_jobs);
return state;
})

sqlString(state => {
return `UPDATE position_updates SET status='PROCESSED' WHERE status in ('NEW','CLOSED')`;
});