.CM  SCRIPT , Version - 1.1 , last edited by barbara
.pa
.ad 8
.bm 8
.fm 4
.bt $Copyright (c) 2000-2005 SAP AG$$Page %$
.tm 12
.hm 6
.hs 3
.TT 1 $SQL$Project Distributed Database System$VIN27$
.tt 2 $$$
.TT 3 $$Connect / Release$1998-06-19$
***********************************************************
.nf
 
.nf
 
 .nf

    ========== licence begin  GPL
    Copyright (c) 2000-2005 SAP AG

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    ========== licence end
.fo

 
.fo
 
 
.fo
.nf
.sp
MODULE  : connect_release
=========
.sp
Purpose : connect to/release from the database
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :
 
        PROCEDURE
              i27connect (
                    calling_component : tsp4_component;
                    installation      : boolean;
                    VAR charsetname   : tsp00_KnlIdentifier;
                    VAR status        : tin_connect_status);
 
        PROCEDURE
              i27userparms (
                    calling_component : tsp4_component;
                    VAR status        : tin_connect_status);
 
        PROCEDURE
              i27release;
&       ifndef INLINK
 
        PROCEDURE
              i27additionalconnect (
                    g_area             : tin_global_in_vars;
                    VAR symbolicdbname : tsp00_DbName;
                    VAR dbname         : tsp00_DbName;
                    VAR node_id        : tsp00_NodeId;
                    VAR username       : tsp00_KnlIdentifier;
                    VAR pword          : tsp00_CryptPw;
                    asutility          : boolean;
                    nolog              : boolean;
                    special_connect    : boolean;
                    VAR acon_rc        : tin_connect_status );
&       endif
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
        FROM
              global_variable : VIN01;
 
        VAR
              i01g : tin_global_in_vars;
 
      ------------------------------ 
 
        FROM
              setparms: VIN07;
 
        PROCEDURE
              i07initsetparms (
                    component  : tsp4_component );
 
      ------------------------------ 
 
        FROM
              general-setprocedures : VIN09;
 
        PROCEDURE
              i09replacesetparms (
                    i01g       : tin_global_in_vars;
                    VAR stored : boolean);
 
      ------------------------------ 
 
        FROM
              SQLDB-command-interface : VIN21;
 
        PROCEDURE
              i21switchsession (
                    g_area     : tin_global_in_vars;
                    session_no : integer);
 
        PROCEDURE
              i21mdbsrelease (
                    g_area         : tin_global_in_vars;
                    VAR dbname_arg : tsp00_DbName);
 
        PROCEDURE
              i21connect (
                    g_area          : tin_global_in_vars;
                    installation    : boolean;
                    VAR charsetname : tsp00_KnlIdentifier;
                    VAR status      : tin_connect_status);
 
        PROCEDURE
              i21release (
                    g_area     : tin_global_in_vars);
 
        PROCEDURE
              i21gettrans_tables (
                    g_area    : tin_global_in_vars);
 
        PROCEDURE
              i21gxval (
                    g_area      : tin_global_in_vars;
                    l_val       : tin_natural;
                    VAR pos     : tsp00_Int4;
                    VAR val     : tsp00_KnlIdentifier;
                    VAR is_null : boolean);
 
        PROCEDURE
              i21g1xval (
                    g_area      : tin_global_in_vars;
                    l_val       : tin_natural;
                    VAR pos     : tsp00_Int4;
                    VAR val     : tsp00_C8;
                    VAR is_null : boolean);
 
        PROCEDURE
              i21p1cmnd (
                    g_area : tin_global_in_vars;
                    VAR s  : tsp00_C20;
                    l_s    : tin_natural);
 
        PROCEDURE
              i21pccmnd (
                    g_area : tin_global_in_vars;
                    c      : char);
 
        PROCEDURE
              i21pcuname (
                    g_area  : tin_global_in_vars;
                    VAR nam : tsp00_KnlIdentifier);
 
        PROCEDURE
              i21finish_part (
                    g_area   : tin_global_in_vars);
 
        PROCEDURE
              i21request (
                    g_area        : tin_global_in_vars;
                    VAR rq_status : tin_connect_status);
 
        PROCEDURE
              i21receive (
                    g_area         : tin_global_in_vars;
                    VAR rc_status  : tin_connect_status;
                    VAR sqlstate   : tsp00_SqlState;
                    VAR returncode : tsp00_Int2;
                    VAR errorpos   : tsp00_Int4);
 
        PROCEDURE
              i21reset (
                    g_area : tin_global_in_vars;
                    m_type : tsp1_cmd_mess_type);
 
        PROCEDURE
              i21scspecialconnect (
                    g_area          : tin_global_in_vars;
                    VAR status      : tin_connect_status);
 
        FUNCTION
              i21dbok (
                    g_area : tin_global_in_vars ) : boolean;
 
      ------------------------------ 
 
        FROM
              Init-Translation : VIN31;
 
        PROCEDURE
              i31inittranslattables;
 
      ------------------------------ 
 
        FROM
              Packet_handling : VSP26;
 
        PROCEDURE
              s26find_part (
                    VAR return_segm : tsp1_segment;
                    part_kind       : tsp1_part_kind;
                    VAR retpart_ptr : tsp1_part_ptr);
 
        PROCEDURE
              s26nextpart (VAR part_ptr : tsp1_part_ptr);
&       ifndef INLINK
 
      ------------------------------ 
 
        FROM
              RTE_driver : VEN102;
 
        PROCEDURE
              sqlcharsetname (
                    VAR charsetname : tsp00_KnlIdentifier );
&       endif
 
      ------------------------------ 
 
        FROM
              Kernel_move_and_fill: VGG101;
 
        PROCEDURE
              SAPDB_PascalForcedMove (
                    source_upb  : tsp00_Int4;
                    destin_upb  : tsp00_Int4;
                    source      : tsp00_MoveObjPtr;
                    source_pos  : tsp00_Int4;
                    destin      : tsp00_MoveObjPtr;
                    destin_pos  : tsp00_Int4;
                    length      : tsp00_Int4);
 
        PROCEDURE
              s10mv (
                    source_upb  : tsp00_Int4;       
                    destin_upb  : tsp00_Int4;
                    source      : tsp00_MoveObjPtr;    
                    source_pos  : tsp00_Int4;
                    destin      : tsp00_MoveObjPtr;    
                    destin_pos  : tsp00_Int4;
                    length      : tsp00_Int4);
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
        PROCEDURE
              i21gxval;
 
              tsp00_Buf tsp00_KnlIdentifier
 
        PROCEDURE
              i21g1xval;
 
              tsp00_Buf tsp00_C8
 
        PROCEDURE
              sqlcharsetname;
 
              tsp00_KnlIdentifier tsp00_KnlIdentifier
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : BarbaraJ
.sp
.cp 3
Created : 1987-09-14
.sp
.cp 3
.sp
.cp 3
Release :      Date : 1998-06-19
.sp
***********************************************************
.sp
.cp 20
.fo
.oc _/1
Specification:
.pb '@'
In order to allow a better optimization of the database requests via
the PC link, the logon and logoff procedures from VIN20 are expanded.
In order, on the other hand, to avoid module cycles, these procedures
are now kept in a special module VIN27:
.sp 2;.nf
PROCEDURE
      i27connect (
            calling_component : tsp4_component;
            VAR charsetname   : tsp00_KnlIdentifier;
            VAR status        : ti_connect_status);
.sp 2;.fo
This procedure logs the user onto the VDN kernel.  It requires that
the user name and password be available in the global variable i01g.
.sp
The CONNECT request must always be the first request when operating
the request interface.
.sp 2
After a successful logon to the database, this procedure carries out
the following additional tasks:
.hi 20;.sp
Privilege check
 (get_user_privileges, formerly VIN04)
This procedure stores the privileges of the user in I01_G, if the
logon was successful, and sets the user name displayed in the dialog
components to "SUPERDBA" in case the user has logged on with another name.
.sp;Set parameters
 (I03_SETPARMS) This procedure stores the current SET PARMS in
I01_G.
It is called if the logon was successful.
.hi 0
.sp
One of the following codes is returned in STATUS:
.sp;.cp 6;.nf
   -  rc_ok
   -  rc_dbms_start_required,
   -  rc_too_many_users,
   -  rc_restart_required,
   -  rc_user_or_pswd_illegal
.sp;.fo
The STATUS is assigned RC_OK only if 'request' and 'receive' were
ok and the VDN returncode is 0.  All returncodes that do not equal 0
and were not converted to other STATUS assignments by i21_RECEIVE
are reported as rc_user_or_pswd_illegal.
.sp 2;.nf
PROCEDURE
      i27release;
.sp 2;.fo
Stores the current set parameters (if changed) via
I03_PUT_SETPARMS and then logs off of the database.  This procedure
is called if no other VDN calls are expected during the course of
the current dialog session.
.sp
It logs the user off of the VDN kernel with COMMIT^WORK^RELEASE and
releases the link of the dialog component to its server process
in the VDN kernel.
.nf
    PROCEDURE
          i21additionalconnect (
                g_area             : tin_global_in_vars;
                VAR symbolicdbname : tsp00_DbName;
                VAR dbname         : tsp00_DbName;
                VAR node_id        : tsp00_NodeId;
                VAR username       : tsp00_KnlIdentifier;
                VAR pword          : tsp00_CryptPw;
                as_utility         : boolean;
                nolog              : boolean;
                VAR acon_rc        : tin_connect_status );
.fo;.sp
Connect auf der durch symbolicdbname bezeichneten Datenbank
(Datenbank Nummer n) mit den angegebenen Parametern. Eine
symbolische Datenbank kann nacheinander verschiedenste tatsaechliche
Datenbanken repraesentieren.
.CM *-END-* specification -------------------------------
.sp 2.fo
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Description:
 
.CM *-END-* description ---------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.nf
.oc _/1
Structure:
 
.CM *-END-* structure -----------------------------------
.sp 2
**********************************************************
.sp
.cp 10
.nf
.oc _/1
.CM -lll-
Code    :
 
 
CONST
      i27_sysresname = 'I27CONN_R           ';
 
 
(*------------------------------*) 
 
PROCEDURE
      i27connect (
            calling_component : tsp4_component;
            installation      : boolean;
            VAR charsetname   : tsp00_KnlIdentifier;
            VAR status        : tin_connect_status);
 
BEGIN
i21connect (i01g, installation, charsetname, status);
IF  status = rc_ok
THEN
    BEGIN
    i01g^.i32.transtables [1] [ ord ('A') + 1 ] := chr (0);
    in27_connect_userparms ;
    IF  i01g^.i32.transtables [1] [ ord ('A') + 1 ] <> 'a'
    THEN
        i31inittranslattables;
    (*ENDIF*) 
    i07initsetparms (calling_component);
    END;
(*ENDIF*) 
END; (* i27connect *)
 
&ifndef INLINK
(*------------------------------*) 
 
PROCEDURE
      i27additionalconnect (
            g_area             : tin_global_in_vars;
            VAR symbolicdbname : tsp00_DbName;
            VAR dbname         : tsp00_DbName;
            VAR node_id        : tsp00_NodeId;
            VAR username       : tsp00_KnlIdentifier;
            VAR pword          : tsp00_CryptPw;
            asutility          : boolean;
            nolog              : boolean;
            special_connect    : boolean;
            VAR acon_rc        : tin_connect_status );
 
VAR
      i           : integer;
      cont        : boolean;
      error       : boolean;
      full        : boolean;
      charsetname : tsp00_KnlIdentifier;
 
BEGIN
WITH g_area^ DO
    BEGIN
    full  := true;
    cont  := true;
    error := false;
    i := 2;
    WHILE (i <= mxin_dbs) AND (cont) DO
        WITH session [i] DO
            BEGIN
            IF  (symbolic_dbname  = symbolicdbname)
            THEN
                IF  (connect_id  = username)
                    AND (serverdb  = dbname)
                    AND (nodeid  = node_id)
                THEN
                    BEGIN
                    cont    := false;
                    full    := false;
                    acon_rc := rc_ok;
                    END
                ELSE
                    BEGIN
                    i21mdbsrelease (g_area, symbolicdbname);
                    symbolic_dbname  := bsp_dbname;
                    END;
                (*ENDIF*) 
            (*ENDIF*) 
            IF  symbolic_dbname  = bsp_dbname
            THEN
                BEGIN
                cont := false;
                full := false;
                symbolic_dbname  := symbolicdbname;
                serverdb         := dbname;
                nodeid           := node_id;
                connect_id       := username;
                password         := pword;
                isolationlevel   :=  1;
                timeout          := -1;
                cachelimit       := -1;
                as_utility       := asutility;
                nolog_session    := nolog;
                connect_status   := rc_ok;
                i21switchsession (g_area, i);
                IF  special_connect
                THEN
                    i21scspecialconnect ( g_area, acon_rc )
                ELSE
                    BEGIN
                    sqlcharsetname (charsetname);
                    i21connect (g_area, false, charsetname, acon_rc);
                    END;
                (*ENDIF*) 
                IF  acon_rc = rc_ok
                THEN
                    BEGIN
                    IF  NOT special_connect
                    THEN
                        in27_connect_userparms ;
                    (*ENDIF*) 
                    error := false
                    END
                ELSE
                    BEGIN
                    error := true;
                    symbolic_dbname := bsp_dbname;
                    connect_status := rc_ok;
                    as_utility := false;
                    nolog_session := false;
                    END;
                (*ENDIF*) 
                i21switchsession (g_area, 1);
                END
            ELSE
                i := i + 1;
            (*ENDIF*) 
            END;
        (*ENDWITH*) 
    (*ENDWHILE*) 
    IF  full
    THEN
        acon_rc := rc_too_many_databases;
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END; (* i27additionalconnect *)
 
&endif
(*------------------------------*) 
 
PROCEDURE
      in27_connect_userparms ;
 
VAR
      usermode    : tsp00_C8;
      is_superdba : boolean;
      pos         : tsp00_Int4;
      i           : integer;
      len         : integer;
 
BEGIN
WITH i01g^, sql_ptr^, curr_segm_ptr ^ DO
    FOR i := 1 TO sp1s_no_of_parts DO
        BEGIN
        CASE curr_part_ptr ^.sp1p_part_kind OF
            sp1pk_user_info_returned :
                WITH curr_part_ptr^, session [dbno] DO
                    BEGIN
                    pos := 1;
                    (* === read session [dbno].local_sysdba === *)
                    local_sysdba := bsp_c64;
                    len := ord (sp1p_buf [pos]);
                    s10mv (sp1p_buf_size,sizeof (local_sysdba),
                          @sp1p_buf,pos + 1,
                          @local_sysdba,1,len);
                    pos := pos + len + 1;
                    (* === read session [dbno].system_user === *)
                    system_user := bsp_c64;
                    len := ord (sp1p_buf [pos]);
                    s10mv (sp1p_buf_size,sizeof (system_user),
                          @sp1p_buf,pos + 1,
                          @system_user,1,len);
                    pos := pos + len + 1;
                    (* === read usermode === *)
                    usermode := bsp_c8;
                    len := ord (sp1p_buf [pos]);
                    s10mv (sp1p_buf_size,sizeof (usermode),
                          @sp1p_buf,pos + 1,
                          @usermode,1,len);
                    in27_get_userpriv (usermode, user_priv, is_superdba);
                    user_ident := connect_id;
                    pos := pos + len + 1;
                    (* === read session [dbno].group_id === *)
                    group_id := bsp_c64;
                    len := ord (sp1p_buf [pos]);
                    s10mv (sp1p_buf_size,sizeof (group_id),
                          @sp1p_buf,pos + 1,
                          @group_id,1,len);
                    IF  group_id = bsp_c64
                    THEN
                        group_id := user_ident;
                    (*ENDIF*) 
                    END;
                (*ENDWITH*) 
            sp1pk_conv_tables_returned :
                BEGIN
                i21gettrans_tables (i01g);
                END;
            sp1pk_session_info_returned :
                BEGIN
                WITH curr_part_ptr^, session [dbno] DO
                    BEGIN
                    pos := 1;
                    (* === read session [dbno].is_unicode_db === *)
                    is_unicode_db := (chr(true) = sp1p_buf [pos]);
                    pos := pos + 1;
                    END;
                (*ENDWITH*) 
                END;
            END;
        (*ENDCASE*) 
        IF  i < sp1s_no_of_parts
        THEN
            s26nextpart (curr_part_ptr );
        (*ENDIF*) 
        END;
    (*ENDFOR*) 
(*ENDWITH*) 
END; (* in27_connect_userparms *)
 
(*------------------------------*) 
 
PROCEDURE
      in27_get_userpriv (
            VAR usermode    : tsp00_C8;
            VAR user_priv   : tin_user_privilege;
            VAR is_superdba : boolean );
 
CONST
      m_dba      = 'DBA     ';
      m_resource = 'RESOURCE';
      m_superdba = 'SUPERDBA'; (* B.J. 30.9.96 zusaetzlich zu k_superdba;*)
      (* an Laenge von usermode angepasst.      *)
 
BEGIN
is_superdba := false;
IF  usermode = m_resource
THEN
    user_priv := private_data
ELSE
    IF  usermode = m_dba
    THEN
        user_priv := public_data
    ELSE
        IF  usermode = m_superdba
        THEN
            BEGIN
            user_priv := public_data;
            is_superdba := true;
            END
        ELSE
            user_priv := no_data;
        (*ENDIF*) 
    (*ENDIF*) 
(*ENDIF*) 
END; (* in27_get_userpriv *)
 
(*------------------------------*) 
 
PROCEDURE
      i27userparms (
            calling_component : tsp4_component;
            VAR status        : tin_connect_status);
 
BEGIN
i31inittranslattables;
in27_check_user_privileges (status);
in27_get_system_user_names (status, true);
in27_get_system_user_names (status, false);
i07initsetparms (calling_component);
END; (* i27userparms *)
 
(*------------------------------*) 
 
PROCEDURE
      in27_check_user_privileges (
            VAR status : tin_connect_status);
 
VAR
      cmnd_text   : tsp00_C20;
      user_priv   : tin_user_privilege;
      request_ok  : boolean;
 
BEGIN
i21reset (i01g, sp1m_dbs);
cmnd_text := 'SELECT              ';
i21p1cmnd (i01g, cmnd_text, 20);
cmnd_text := i27_sysresname;
i21p1cmnd (i01g, cmnd_text, 20);
cmnd_text := '(GROUPNAME,USERMODE)';
i21p1cmnd (i01g, cmnd_text, 20);
cmnd_text := ' FROM DOMAIN.USERS  ';
i21p1cmnd (i01g, cmnd_text, 20);
cmnd_text := ' WHERE USERNAME =   ';
i21p1cmnd (i01g, cmnd_text, 20);
i21pccmnd (i01g, '''');
i21pcuname (i01g, i01g^.session [i01g^.dbno].connect_id);
i21pccmnd (i01g, '''');
i21finish_part (i01g);
in27_ex_db_cmnd (status, request_ok);
IF  request_ok
THEN
    BEGIN
    i21reset (i01g, sp1m_dbs);
    cmnd_text := 'FETCH               ';
    i21p1cmnd (i01g, cmnd_text, 20);
    cmnd_text := i27_sysresname;
    i21p1cmnd (i01g, cmnd_text, 20);
    i21finish_part (i01g);
    in27_ex_db_cmnd (status, request_ok);
    END;
(*ENDIF*) 
IF  status = rc_ok
THEN
    BEGIN
    IF  request_ok
    THEN
        in27_get_priv_infos (user_priv)
    ELSE
        (* Darf eigentlich nicht mehr vorkommen *)
        user_priv := no_data;
    (*ENDIF*) 
    i01g^.session [i01g^.dbno].user_priv := user_priv;
    END;
(*ENDIF*) 
END; (* in27_check_user_privileges *)
 
(*------------------------------*) 
 
PROCEDURE
      in27_get_system_user_names (
            VAR status       : tin_connect_status;
            get_local_sysdba : boolean);
 
VAR
      cmnd_text  : tsp00_C20;
      uname      : tsp00_KnlIdentifier;
      request_ok : boolean;
      is_null    : boolean;
      old_ptr    : tsp1_part_ptr;
      pos        : tsp00_Int4;
 
BEGIN
i21reset (i01g, sp1m_dbs);
cmnd_text := 'SELECT              ';
i21p1cmnd (i01g, cmnd_text, 20);
cmnd_text := i27_sysresname;
i21p1cmnd (i01g, cmnd_text, 20);
cmnd_text := ' (USERNAME)         ';
i21p1cmnd (i01g, cmnd_text, 20);
cmnd_text := ' FROM DOMAIN.USERS  ';
i21p1cmnd (i01g, cmnd_text, 20);
cmnd_text := ' WHERE USERNAME =   ';
i21p1cmnd (i01g, cmnd_text, 20);
IF  get_local_sysdba
THEN
    cmnd_text := ' LOCALSYSDBA        '
ELSE
    cmnd_text := ' SYSDBA             ';
(*ENDIF*) 
i21p1cmnd (i01g, cmnd_text, 20);
i21finish_part (i01g);
in27_ex_db_cmnd (status, request_ok);
IF  request_ok
THEN
    BEGIN
    i21reset (i01g, sp1m_dbs);
    cmnd_text := 'FETCH               ';
    i21p1cmnd (i01g, cmnd_text, 20);
    cmnd_text := i27_sysresname;
    i21p1cmnd (i01g, cmnd_text, 20);
    i21finish_part (i01g);
    in27_ex_db_cmnd (status, request_ok);
    END;
(*ENDIF*) 
IF  request_ok
THEN
    WITH i01g^, sql_ptr^ DO
        BEGIN
        old_ptr := curr_part_ptr ;
        s26find_part (curr_segm_ptr ^, sp1pk_data, curr_part_ptr );
        IF  curr_part_ptr  = NIL
        THEN
            BEGIN
            curr_part_ptr  := old_ptr;
            uname := session [dbno].user_ident;
            END
        ELSE
            BEGIN
            pos := 1;
            i21gxval (i01g, sizeof (tsp00_KnlIdentifier), pos, uname, is_null);
            IF  is_null
            THEN
                uname := session [dbno].user_ident;
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        IF  get_local_sysdba
        THEN
            session [dbno].local_sysdba := uname
        ELSE
            session [dbno].system_user := uname;
        (*ENDIF*) 
        END;
    (*ENDWITH*) 
(*ENDIF*) 
END; (* in27_get_system_user_names *)
 
(*------------------------------*) 
 
PROCEDURE
      in27_get_priv_infos (
            VAR user_priv   : tin_user_privilege);
 
VAR
      usermode    : tsp00_C8;
      pos         : tsp00_Int4;
      is_null     : boolean;
      is_superdba : boolean;
      old_ptr     : tsp1_part_ptr;
 
BEGIN
WITH i01g^, sql_ptr^ DO
    BEGIN
    old_ptr := curr_part_ptr ;
    s26find_part (curr_segm_ptr ^, sp1pk_data,
          curr_part_ptr );
    IF  curr_part_ptr  = NIL
    THEN
        BEGIN
        session [dbno].group_id := bsp_c64;
        user_priv := no_data;
        is_superdba := false;
        curr_part_ptr  := old_ptr;
        END
    ELSE
        BEGIN
        pos := 1;
        i21gxval (i01g, sizeof (tsp00_KnlIdentifier), pos, session [dbno].group_id, is_null);
        IF  is_null
        THEN
            session [dbno].group_id := bsp_c64;
        (*ENDIF*) 
        i21g1xval (i01g, mxsp_c8, pos, usermode, is_null);
        IF  is_null
        THEN
            usermode := bsp_c8;
        (*ENDIF*) 
        in27_get_userpriv (usermode, user_priv, is_superdba );
        END;
    (*ENDIF*) 
    IF  session [dbno].group_id = bsp_c64
    THEN
        session [dbno].group_id := session [dbno].user_ident;
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END; (* in27_get_priv_infos *)
 
(*------------------------------*) 
 
PROCEDURE
      in27_ex_db_cmnd (
            VAR status     : tin_connect_status;
            VAR request_ok : boolean);
 
VAR
      sqlstate   : tsp00_SqlState;
      returncode : tsp00_Int2;
      errorcode  : tsp00_Int4;
 
BEGIN
i21request (i01g, status);
IF  status = rc_ok
THEN
    i21receive (i01g, status, sqlstate, returncode, errorcode);
(*ENDIF*) 
request_ok := (status = rc_ok) AND (returncode = 0);
END; (* in27_ex_db_cmnd *)
 
(*------------------------------*) 
 
PROCEDURE
      i27release;
 
VAR
      stored : boolean;
 
BEGIN
IF  i21dbok (i01g)
THEN
    BEGIN
    IF  i01g^.set_parms.change
    THEN
        i09replacesetparms (i01g, stored);
    (*ENDIF*) 
    i21release (i01g);
    END;
(*ENDIF*) 
END; (* i27release *)
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
.PA 
