delimiter \\
drop procedure storage_data_associate\\
create procedure storage_data_associate(in i_node_access_key char(32), in i_access_key char(32))
begin
    declare l_data_class boolean;

    -- if the storage node is a cache, we are dealing with a dataset tag.
    -- Otherwise it will be a dataset

    select
       data_class into l_data_class
    from
        storage_node
    where
        access_key = i_node_access_key;
    
    
    insert ignore into dataset_node_jct values (i_access_key, i_node_access_key, l_data_class) ;
    

end\\
delimiter ;