1.118.  storenode_int( integer, text, boolean )

Propriétés de la fonction
Langage: PLPGSQL
Type du code retour: integer

no_id - Identifiant du nœud no_comment - Commentaire « humain » no_spool - Drapeau pour les nœuds virtuels de spool Fonction interne pour traiter l'événement STORE_NODE pour le nœud no_id.

declare
        p_no_id                 alias for $1;
        p_no_comment    alias for $2;
        p_no_spool              alias for $3;
        v_old_row               record;
begin
        -- ----
        -- Grab the central configuration lock
        -- ----
        lock table sl_config_lock;

        -- ----
        -- Check if the node exists
        -- ----
        select * into v_old_row
                        from sl_node
                        where no_id = p_no_id
                        for update;
        if found then 
                -- ----
                -- Node exists, update the existing row.
                -- ----
                update sl_node
                                set no_comment = p_no_comment,
                                no_spool = p_no_spool
                                where no_id = p_no_id;
        else
                -- ----
                -- New node, insert the sl_node row
                -- ----
                insert into sl_node
                                (no_id, no_active, no_comment, no_spool) values
                                (p_no_id, 'f', p_no_comment, p_no_spool);
        end if;

        return p_no_id;
end;