Main Tables Views Materialized Views Indexes Constraints Triggers Procedures Functions Packages Sequences Java Sources Sanity Check Index DDL scrips
Arguments Source

LOOKUP_CONFIG_INFO

DDL script

Arguments:

NameData TypeDefault ValueIn/Out
USERNAME_INVARCHAR2 IN
GROUPNAME_INVARCHAR2 IN
FILEMODE_INVARCHAR2 IN
SELINUX_CTX_INVARCHAR2 IN

Returns:

NUMBER(38)

Source

Legend: comment string keyword reserved word operator
     1: function
     2: lookup_config_info (
     3:     username_in     in varchar2,
     4:     groupname_in    in varchar2,
     5:     filemode_in     in varchar2,
     6:     selinux_ctx_in  in varchar2
     7: ) return number
     8: deterministic
     9: is
    10:     pragma autonomous_transaction;
    11:     v_id    number;
    12:     cursor lookup_cursor is
    13:         select id
    14:           from rhnConfigInfo
    15:          where 1=1
    16:            and username = username_in
    17:            and groupname = groupname_in
    18:            and filemode = filemode_in
    19:            and nvl(selinux_ctx, ' ') = nvl(selinux_ctx_in, ' ');
    20: begin
    21:     for r in lookup_cursor loop
    22:         return r.id;
    23:     end loop;
    24:     -- If we got here, we don't have the id
    25:     select rhn_confinfo_id_seq.nextval
    26:       into v_id
    27:       from dual;
    28:     insert into rhnConfigInfo (id, username, groupname, filemode, selinux_ctx)
    29:     values (v_id, username_in, groupname_in, filemode_in, selinux_ctx_in);
    30:     commit;
    31:     return v_id;
    32: end lookup_config_info;