select project_id,
name,
description,
active_p,
project_lead
from logger_projects
where project_id = :project_id
insert into logger_project_var_map (project_id, variable_id, primary_p)
values (:project_id, :variable_id, :primary_p)
delete from logger_project_var_map
where project_id = :project_id
and variable_id = :variable_id
update logger_project_var_map
set primary_p = 'f'
where project_id = :project_id
update logger_project_var_map
set primary_p = 't'
where project_id = :project_id
and variable_id = :variable_id
select count(*)
from logger_project_var_map
where project_id = :project_id
and primary_p = 't'
select variable_id
from logger_project_var_map
where project_id = :project_id
and primary_p = 't'
select variable_id
from logger_project_var_map
where project_id = :project_id
update logger_projects
set name = :name,
description = :description,
project_lead = :project_lead,
active_p = :active_p
where project_id = :project_id
update logger_projects
set active_p = :active_p
where project_id = :project_id