.ad 8
.bm 8
.fm 4
.bt $Copyright (c) 2000-2004 SAP AG$$Page %$
.tm 12
.hm 6
.hs 3
.TT 1 $SQL$Project Distributed Database System$VAK48$
.tt 2 $$$
.TT 3 $ThomasA$Show_view$1999-02-17$
***********************************************************
.nf
 
 
    ========== licence begin  GPL
    Copyright (c) 2000-2004 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
.nf
.sp
MODULE  : AK_Show_view
=========
.sp
Purpose : Show Views
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :
 
        PROCEDURE
              a48get_view_def_string (VAR acv : tak_all_command_glob;
                    VAR tabid       : tgg00_Surrogate;
                    length_only     : boolean;
                    outbuf_size     : tsp00_Int4;
                    VAR outbuf      : tsp00_MoveObj;
                    VAR viewtextlen : tsp00_Int4);
 
        PROCEDURE
              a48referenced_columns (VAR acv : tak_all_command_glob;
                    VAR a41v : tak40_show_glob);
 
        PROCEDURE
              a48serverdb_show (VAR acv : tak_all_command_glob;
                    VAR a41v      : tak40_show_glob;
                    show_serverdb : boolean);
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
        FROM
              Scanner : VAK01;
 
        VAR
              a01char_size        : integer;
              a01defaultkey       : tgg00_SysInfoKey;
              a01_il_b_identifier : tsp00_KnlIdentifier;
 
      ------------------------------ 
 
        FROM
              AK_universal_semantic_tools : VAK06;
 
        PROCEDURE
              a06inc_linkage (VAR linkage : tsp00_C2);
 
        PROCEDURE
              a06_systable_get (VAR acv : tak_all_command_glob;
                    dstate       : tak_directory_state;
                    VAR tableid  : tgg00_Surrogate;
                    VAR base_ptr : tak_sysbufferaddress;
                    get_all      : boolean;
                    VAR ok       : boolean);
 
      ------------------------------ 
 
        FROM
              AK_Identifier_Handling : VAK061;
 
        PROCEDURE
              a061get_colname (VAR col_info : tak00_columninfo;
                    VAR colname  : tsp00_KnlIdentifier);
 
      ------------------------------ 
 
        FROM
              AK_error_handling : VAK07;
 
        PROCEDURE
              a07ak_system_error (VAR acv : tak_all_command_glob;
                    modul_no : integer;
                    id       : integer);
 
        PROCEDURE
              a07_b_put_error (VAR acv : tak_all_command_glob;
                    b_err   : tgg00_BasisError;
                    err_code : tsp00_Int4);
 
      ------------------------------ 
 
        FROM
              Systeminfo_cache  : VAK10;
 
        PROCEDURE
              a10rel_sysinfo (syspointer : tak_sysbufferaddress);
 
        PROCEDURE
              a10get_sysinfo (VAR acv : tak_all_command_glob;
                    VAR syskey   : tgg00_SysInfoKey;
                    dstate       : tak_directory_state;
                    VAR syspoint : tak_sysbufferaddress;
                    VAR b_err    : tgg00_BasisError);
 
      ------------------------------ 
 
        FROM
              AK_universal_show_tools : VAK40;
 
        PROCEDURE
              a40get_catalog_table (VAR acv : tak_all_command_glob;
                    VAR a41v : tak40_show_glob);
 
        PROCEDURE
              a40site (VAR acv : tak_all_command_glob;
                    VAR a41v             : tak40_show_glob;
                    VAR siteserverdbname : tsp00_DbName;
                    VAR siteid           : tsp00_NodeId);
 
        PROCEDURE
              a40table_column_to_shbuf (VAR acv : tak_all_command_glob;
                    VAR a41v     : tak40_show_glob;
                    base_ptr     : tak_sysbufferaddress;
                    colindex     : integer);
 
        PROCEDURE
              a40date_time_analyze (VAR acv : tak_all_command_glob;
                    VAR coldesc  : tak_vcolumndescription;
                    dt_format    : tgg00_DateTimeFormat;
                    VAR outbuf   : tsp00_MoveObj;
                    pos          : integer;
                    VAR aux1     : tsp00_C64;
                    VAR auxlen   : integer);
 
      ------------------------------ 
 
        FROM
              Configuration_Parameter : VGG01;
 
        VAR
              g01code           : tgg04_CodeGlobals;
              g01serverdb_ident : tgg04_ServerdbIdent;
              g01unicode        : boolean;
 
      ------------------------------ 
 
        FROM
              Codetransformation_and_Coding : VGG02;
 
        PROCEDURE
              g02pascii_pos_ebcdic (VAR source : tsp00_C64;
                    srcind   : tsp00_Int4;
                    VAR dest : tsp00_MoveObj;
                    destind  : tsp00_Int4;
                    length   : tsp00_Int4);
 
      ------------------------------ 
 
        FROM
              Check-Date-Time : VGG03;
 
        PROCEDURE
              g03fdcheck_date (VAR sbuf   : tsp00_MoveObj;
                    VAR dbuf   : tsp00_C64;
                    spos       : tsp00_Int4;
                    dpos       : tsp00_Int4;
                    actlen     : integer;
                    format     : tgg00_DateTimeFormat;
                    ch_code    : boolean;
                    VAR b_err  : tgg00_BasisError);
 
        PROCEDURE
              g03ftcheck_time (VAR sbuf   : tsp00_MoveObj;
                    VAR dbuf   : tsp00_C64;
                    spos       : tsp00_Int4;
                    dpos       : tsp00_Int4;
                    actlen     : integer;
                    format     : tgg00_DateTimeFormat;
                    ch_code    : boolean;
                    VAR b_err  : tgg00_BasisError);
 
        PROCEDURE
              g03ftscheck_timestamp (VAR sbuf   : tsp00_MoveObj;
                    VAR dbuf   : tsp00_C64;
                    spos       : tsp00_Int4;
                    dpos       : tsp00_Int4;
                    actlen     : integer;
                    format     : tgg00_DateTimeFormat;
                    language   : tsp00_C3;
                    ch_code    : boolean;
                    VAR b_err  : tgg00_BasisError);
 
        PROCEDURE
              g03dchange_format_date ( VAR sbuf : tsp00_C64;
                    VAR dbuf  : tsp00_C64;
                    spos      : tsp00_Int4;
                    dpos      : tsp00_Int4;
                    format    : tgg00_DateTimeFormat;
                    VAR b_err : tgg00_BasisError);
 
        PROCEDURE
              g03tchange_format_time ( VAR sbuf : tsp00_C64;
                    VAR dbuf  : tsp00_C64;
                    spos      : tsp00_Int4;
                    dpos      : tsp00_Int4;
                    format    : tgg00_DateTimeFormat;
                    VAR b_err : tgg00_BasisError);
 
        PROCEDURE
              g03tschange_format_timestamp ( VAR sbuf : tsp00_C64;
                    VAR dbuf  : tsp00_C64;
                    spos      : tsp00_Int4;
                    dpos      : tsp00_Int4;
                    format    : tgg00_DateTimeFormat;
                    language  : tsp00_C3;
                    VAR b_err : tgg00_BasisError);
 
      ------------------------------ 
 
        FROM
              Kernel_move_and_fill : VGG101;
 
        PROCEDURE
              SAPDB_PascalFill (
                    mod_id      : tsp00_C6;
                    mod_num     : tsp00_Int4;
                    obj_upb     : tsp00_Int4;
                    obj         : tsp00_MoveObjPtr;
                    obj_pos     : tsp00_Int4;
                    length      : tsp00_Int4;
                    fillchar    : char;
                    VAR e       : tgg00_BasisError);
 
        PROCEDURE
              SAPDB_PascalUnicodeFill (
                    mod_id      : tsp00_C6;
                    mod_num     : tsp00_Int4;
                    obj_upb     : tsp00_Int4;
                    obj         : tsp00_MoveObjPtr;
                    obj_pos     : tsp00_Int4;
                    length      : tsp00_Int4;
                    fillchar    : tsp00_C2;
                    VAR e       : tgg00_BasisError);
 
        PROCEDURE
              SAPDB_PascalForcedUnicodeFill (
                    obj_upb     : tsp00_Int4;
                    obj         : tsp00_MoveObjPtr;
                    obj_pos     : tsp00_Int4;
                    length      : tsp00_Int4;
                    fillchar    : tsp00_C2 );
 
        PROCEDURE
              SAPDB_PascalMove (
                    mod_id      : tsp00_C6;
                    mod_num     : tsp00_Int4;
                    source_upb  : tsp00_Int4;
                    dest_upb    : tsp00_Int4;
                    source      : tsp00_MoveObjPtr;
                    src_pos     : tsp00_Int4;
                    destin      : tsp00_MoveObjPtr;
                    dest_pos    : tsp00_Int4;
                    length      : tsp00_Int4;
                    VAR e       : tgg00_BasisError);
 
        PROCEDURE
              SAPDB_PascalOverlappingMove (
                    mod_id      : tsp00_C6;
                    mod_num     : tsp00_Int4;
                    source_upb  : tsp00_Int4;
                    dest_upb    : tsp00_Int4;
                    source      : tsp00_MoveObjPtr;
                    src_pos     : tsp00_Int4;
                    destin      : tsp00_MoveObjPtr;
                    dest_pos    : tsp00_Int4;
                    length      : tsp00_Int4;
                    VAR e       : tgg00_BasisError);
 
        PROCEDURE
              SAPDB_PascalForcedFill (
                    size        : tsp00_Int4;
                    m           : tsp00_MoveObjPtr;
                    pos         : tsp00_Int4;
                    len         : tsp00_Int4;
                    fillchar    : char);
 
        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
              SAPDB_PascalForcedOverlappingMove (
                    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
              g10mv (
                    mod_id      : tsp00_C6;            
                    mod_num     : tsp00_Int4;
                    source_upb  : tsp00_Int4;          
                    dest_upb    : tsp00_Int4;
                    source      : tsp00_MoveObjPtr;       
                    src_pos     : tsp00_Int4;
                    destin      : tsp00_MoveObjPtr;       
                    dest_pos    : tsp00_Int4;
                    length      : tsp00_Int4;
                    VAR e       : tgg00_BasisError);
 
        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);
 
&ifdef trace
      ------------------------------ 
 
        FROM
              Test_Procedures : VTA01;
 
        PROCEDURE
              t01int4 (debug : tgg00_Debug;
                    nam      : tsp00_Sname;
                    int      : tsp00_Int4);
 
        PROCEDURE
              t01moveobj  (layer : tgg00_Debug;
                    VAR buf  : tsp00_MoveObj;
                    startpos : tsp00_Int4;
                    endpos   : tsp00_Int4);
&       endif
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
        PROCEDURE
              g02pascii_pos_ebcdic;
 
              tsp00_MoveObj tsp00_C64
 
        PROCEDURE
              g03fdcheck_date;
 
              tsp00_MoveObj tsp00_C64
 
        PROCEDURE
              g03ftcheck_time;
 
              tsp00_MoveObj tsp00_C64
 
        PROCEDURE
              g03ftscheck_timestamp;
 
              tsp00_MoveObj tsp00_C64
 
        PROCEDURE
              g03dchange_format_date;
 
              tsp00_MoveObj tsp00_C64
              tsp00_MoveObj tsp00_C64
 
        PROCEDURE
              g03tchange_format_time;
 
              tsp00_MoveObj tsp00_C64
              tsp00_MoveObj tsp00_C64
 
        PROCEDURE
              g03tschange_format_timestamp;
 
              tsp00_MoveObj tsp00_C64
              tsp00_MoveObj tsp00_C64
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : ThomasA
.sp
.cp 3
Created : 1985-03-01
.sp
.cp 3
.sp
.cp 3
Release :      Date : 1999-02-17
.sp
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Specification:
 
Erkennt Syntax :
.sp
  'SHOW'  'VIEW'
           <table_name>
.sp 3
.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Description:
 
PROCEDURE   a48_s01_view  (acv, a41v) :
.sp 2
.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    :
 
 
(*------------------------------*) 
 
PROCEDURE
      a48get_view_def_string (VAR acv : tak_all_command_glob;
            VAR tabid       : tgg00_Surrogate;
            length_only     : boolean;
            outbuf_size     : tsp00_Int4;
            VAR outbuf      : tsp00_MoveObj;
            VAR viewtextlen : tsp00_Int4);
 
VAR
      next_exist : boolean;
      b_err      : tgg00_BasisError;
      dt_format    : tgg00_DateTimeFormat;
 
      c_map_dt     : RECORD
            CASE boolean OF
                true  :
                    (dtf : tgg00_DateTimeFormat);
                false :
                    (c : tsp00_C1);
                END;
            (*ENDCASE*) 
 
      textpos       : integer;
      textlen       : integer;
      select_offset : integer;
      sysbuf        : tak_sysbufferaddress;
      sysk          : tgg00_SysInfoKey;
      select_only   : boolean;
 
BEGIN
&ifdef trace
t01int4 (ak_sem, 'viewtextlen ', viewtextlen);
t01int4 (ak_sem, 'outbuf_size ', outbuf_size);
&endif
select_only    := viewtextlen > 0;
select_offset  := 0;
sysk           := a01defaultkey;
sysk.stableid  := tabid;
sysk.sentrytyp := cak_eviewtext;
REPEAT
    a10get_sysinfo (acv, sysk, d_release, sysbuf, b_err);
    IF  b_err <> e_ok
    THEN
        a07_b_put_error (acv, b_err, 1)
    ELSE
        WITH sysbuf^.sviewtext DO
            BEGIN
            IF  sysk.slinkage = cak_init_linkage
            THEN
                BEGIN
                c_map_dt.c[1] := chr (vtcontext);
                c_map_dt.c[1] := chr (ord (c_map_dt.c[1]) MOD 10);
                dt_format     := c_map_dt.dtf;
                (* PTS 1112472 E.Z. *)
                IF  dt_format = dtf_was_ansi_now_is_same_as_iso
                THEN
                    dt_format := dtf_iso;
                (*ENDIF*) 
                END;
            (*ENDIF*) 
            textpos := vttabcount * mxak_vttabdef + 1;
            textlen := vttextlength;
            IF  NOT length_only
            THEN
                BEGIN
                IF  select_only AND
                    (sysk.slinkage = cak_init_linkage)
                THEN
                    select_offset := vtselect_pos - textpos;
                (*ENDIF*) 
                IF  select_offset >= textlen
                THEN
                    BEGIN
                    (* SELECT does not start in current buffer *)
                    select_offset := select_offset - textlen;
                    textlen       := 0
                    END
                ELSE
                    BEGIN
                    textlen := vttextlength - select_offset;
                    textpos := textpos      + select_offset
                    END;
                (*ENDIF*) 
                IF  textlen > 0
                THEN
                    IF  viewtextlen + textlen <= outbuf_size
                    THEN
                        g10mv ('VAK48 ',   1,    
                              sizeof(vttbuf), outbuf_size,
                              @vttbuf, textpos,
                              @outbuf, viewtextlen + 1, textlen,
                              acv.a_returncode)
                    (*ENDIF*) 
                (*ENDIF*) 
                END;
            (*ENDIF*) 
            viewtextlen := viewtextlen + textlen;
            next_exist  := vtnextexist;
            a06inc_linkage (sysk.slinkage)
            END
        (*ENDWITH*) 
    (*ENDIF*) 
UNTIL
    (acv.a_returncode <> 0) OR NOT next_exist;
(*ENDREPEAT*) 
&ifdef TRACE
t01moveobj (ak_sem, outbuf, 1, viewtextlen);
&endif
IF  (acv.a_returncode = 0) AND
    NOT select_only
THEN
    BEGIN
    sysk.sentrytyp := cak_eviewdesc;
    sysk.slinkage  := cak_init_linkage;
    REPEAT
        next_exist := false;
        a10get_sysinfo (acv, sysk, d_release, sysbuf, b_err);
        IF  b_err = e_ok
        THEN
            BEGIN
            next_exist := sysbuf^.sviewdesc.vdesc_next;
            ak48date_time_analyze (acv, sysbuf^.sviewdesc, dt_format, length_only,
                  outbuf_size, outbuf, viewtextlen);
            a06inc_linkage (sysk.slinkage)
            END;
        (*ENDIF*) 
    UNTIL
        NOT next_exist
    (*ENDREPEAT*) 
    END
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a48referenced_columns (VAR acv : tak_all_command_glob;
            VAR a41v : tak40_show_glob);
 
VAR
      ok          : boolean;
      show_column : boolean;
      next_exist  : boolean;
      b_err       : tgg00_BasisError;
      col_i       : integer;
      i           : integer;
      coldesckey  : tgg00_SysInfoKey;
      from_ptr    : tak_sysbufferaddress;
      coldescbuf  : tak_sysbufferaddress;
      textbuf     : tak_sysbufferaddress;
      colname     : tsp00_KnlIdentifier;
 
BEGIN
coldesckey           := a41v.a4p_arr.pbasep^.syskey;
coldesckey.sentrytyp := cak_eviewtext;
a10get_sysinfo (acv, coldesckey, d_fix, textbuf, b_err);
IF  b_err = e_ok
THEN
    BEGIN
    coldesckey.sentrytyp := cak_eviewdesc;
    a10get_sysinfo (acv, coldesckey, d_fix, coldescbuf, b_err)
    END;
(*ENDIF*) 
IF  b_err = e_ok
THEN
    BEGIN
    REPEAT
        WITH coldescbuf^.sviewdesc, textbuf^.sviewtext DO
            BEGIN
            i := 1;
            WHILE (i <= vdesc_cnt) AND
                  (acv.a_returncode = 0) DO
                WITH vdescription[ i ] DO
                    BEGIN
                    show_column := false;
                    IF  vextcolno > 0
                    THEN
                        BEGIN
                        WITH a41v.a4p_arr.pbasep^.sbase DO
                            col_i := bextcolindex[vextcolno] +
                                  bfirstindex;
                        (*ENDWITH*) 
                        IF  a41v.a4coln = a01_il_b_identifier
                        THEN
                            show_column := true
                        ELSE
                            BEGIN
                            a061get_colname (a41v.a4p_arr.pbasep^.sbase.
                                  bcolumn[col_i]^, colname);
                            IF  colname = a41v.a4coln
                            THEN
                                show_column := true;
                            (*ENDIF*) 
                            END;
                        (*ENDIF*) 
                        END;
                    (*ENDIF*) 
                    IF  show_column
                    THEN
                        BEGIN
                        a40table_column_to_shbuf (acv, a41v,
                              a41v.a4p_arr.pbasep, col_i);
                        WITH vttab[ vfromtabno ] DO
                            a06_systable_get (acv, d_fix,
                                  vtttableid, from_ptr, true, ok);
                        (*ENDWITH*) 
                        IF  NOT(ok)
                        THEN
                            a07ak_system_error (acv, 48, 1)
                        ELSE
                            BEGIN
                            WITH from_ptr^.sbase DO
                                col_i := bextcolindex[vfromextcolno] +
                                      bfirstindex;
                            (*ENDWITH*) 
                            a40table_column_to_shbuf (acv, a41v,
                                  from_ptr, col_i);
                            IF  from_ptr <> a41v.a4p_arr.pinfop
                            THEN
                                a10rel_sysinfo (from_ptr)
                            (*ENDIF*) 
                            END;
                        (*ENDIF*) 
                        END;
                    (*ENDIF*) 
                    i := i + 1
                    END;
                (*ENDWITH*) 
            (*ENDWHILE*) 
            next_exist := vdesc_next;
            IF  next_exist
            THEN
                BEGIN
                a10rel_sysinfo (coldescbuf);
                a06inc_linkage (coldesckey.slinkage);
                a10get_sysinfo (acv, coldesckey, d_fix, coldescbuf, b_err);
                IF  b_err <> e_ok
                THEN
                    a07_b_put_error (acv, b_err, 1)
                (*ENDIF*) 
                END;
            (*ENDIF*) 
            END
        (*ENDWITH*) 
    UNTIL
        NOT next_exist OR (acv.a_returncode <> 0);
    (*ENDREPEAT*) 
    IF  acv.a_returncode = 0
    THEN
        BEGIN
        a10rel_sysinfo (coldescbuf);
        a10rel_sysinfo (textbuf)
        END;
    (*ENDIF*) 
    END
ELSE
    a07_b_put_error (acv, b_err, 1);
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak48date_time_analyze (VAR acv : tak_all_command_glob;
            VAR viewdesc : tak_viewdescrecord;
            dt_format    : tgg00_DateTimeFormat;
            length_only  : boolean;
            outbuf_size  : tsp00_Int4;
            VAR outbuf   : tsp00_MoveObj;
            VAR buf_len  : tsp00_Int4);
 
VAR
      b_err    : tgg00_BasisError;
      pos      : integer;
      i        : integer;
      len      : integer;
      diff     : integer;
      diff_sum : integer;
      aux      : tsp00_C64;
      aux1     : tsp00_C64;
 
BEGIN
&ifdef trace
t01moveobj (ak_sem, outbuf, 1, buf_len);
&endif
diff_sum := 0;
WITH acv, a_mblock, viewdesc DO
    FOR i := 1 TO vdesc_cnt DO
        WITH vdescription[ i ] DO
            BEGIN
            pos := vn_pos + diff_sum;
            IF  pos > outbuf_size
            THEN
                length_only := true;
&           ifdef trace
            (*ENDIF*) 
            t01int4 (ak_sem, 'vn_pos      ', pos);
            t01int4 (ak_sem, 'vfromtabno  ', vfromtabno);
            t01int4 (ak_sem, 'vdatatype   ', ord(vdatatype));
            t01moveobj (ak_sem, outbuf, pos, 10);
&           endif
            IF  (vdatatype = ddate) OR
                (vdatatype = dtime) OR
                (vdatatype = dtimestamp)
            THEN
                BEGIN
                IF  NOT g01unicode OR length_only
                THEN
                    BEGIN
                    aux  := bsp_c64;
                    aux1 := bsp_c64;
                    CASE vdatatype OF
                        ddate :
                            IF  length_only
                            THEN
                                diff := 2 * a01char_size
                            ELSE
                                BEGIN
                                g03fdcheck_date (outbuf,
                                      aux, pos, 1, vfromtabno,
                                      dt_format, true, b_err);
                                g03dchange_format_date (aux, aux1,
                                      1, 1, a_dt_format, b_err);
                                END;
                            (*ENDIF*) 
                        dtime :
                            IF  length_only
                            THEN
                                diff := 3 * a01char_size
                            ELSE
                                BEGIN
                                g03ftcheck_time (outbuf,
                                      aux, pos, 1, vfromtabno,
                                      dt_format, true, b_err);
                                g03tchange_format_time (aux, aux1,
                                      1, 1, a_dt_format, b_err);
                                END;
                            (*ENDIF*) 
                        dtimestamp :
                            IF  length_only
                            THEN
                                diff := 17 * a01char_size
                            ELSE
                                BEGIN
                                g03ftscheck_timestamp (outbuf,
                                      aux, pos, 1, vfromtabno,
                                      dt_format, a_ak_language, true, b_err);
                                g03tschange_format_timestamp (aux,
                                      aux1,1, 1, a_dt_format,
                                      a_ak_language, b_err);
                                END;
                            (*ENDIF*) 
                        END;
                    (*ENDCASE*) 
                    IF  NOT length_only
                    THEN
                        BEGIN
                        len := mxsp_c64;
                        WHILE aux1[ len ] = bsp_c1 DO
                            len := pred(len);
                        (*ENDWHILE*) 
                        END;
                    (*ENDIF*) 
                    END
                ELSE
                    a40date_time_analyze (acv, vdescription[ i ],
                          dt_format, outbuf, pos, aux1, len);
                (*ENDIF*) 
                IF  NOT length_only
                THEN
                    BEGIN
                    diff := len - vfromtabno;
                    IF  buf_len + diff > outbuf_size
                    THEN
                        BEGIN
&                       ifdef trace
                        t01int4 (ak_sem, 'diff        ', diff);
                        t01int4 (ak_sem, 'buf_len     ', buf_len);
                        t01int4 (ak_sem, 'outbuf_size ', outbuf_size);
&                       endif
                        a07_b_put_error (acv, e_too_long_viewtext, 1)
                        END
                    ELSE
                        BEGIN
                        IF  diff > 0
                        THEN
                            SAPDB_PascalOverlappingMove ('VAK48 ',   2,    
                                  outbuf_size, outbuf_size,
                                  @outbuf, pos, @outbuf, pos + diff,
                                  buf_len - pos + 1,
                                  a_returncode)
                        ELSE
                            IF  diff < 0
                            THEN
                                g10mv ('VAK48 ',   3,    
                                      outbuf_size, outbuf_size,
                                      @outbuf, pos - diff, @outbuf,
                                      pos, buf_len - pos + 1 - diff,
                                      a_returncode);
                            (*ENDIF*) 
                        (*ENDIF*) 
                        g10mv ('VAK48 ',   4,    
                              sizeof(aux1), outbuf_size,
                              @aux1, 1, @outbuf, pos, len,
                              a_returncode);
                        diff_sum := diff_sum + diff
                        END;
                    (*ENDIF*) 
                    END;
                (*ENDIF*) 
                buf_len := buf_len + diff;
&               ifdef trace
                t01moveobj (ak_sem, outbuf, 1, buf_len);
&               endif
                END;
            (*ENDIF*) 
            END;
        (*ENDWITH*) 
    (*ENDFOR*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a48serverdb_show (VAR acv : tak_all_command_glob;
            VAR a41v      : tak40_show_glob;
            show_serverdb : boolean);
 
BEGIN
WITH acv, a41v DO
    BEGIN
    IF  NOT show_serverdb
    THEN (* show participants *)
        a07_b_put_error (acv, e_invalid_command, 1)
    ELSE
        BEGIN
        a4sh_kind := sh_serverdb;
        a40get_catalog_table (acv, a41v);
        a40site (acv, a41v, g01serverdb_ident.svServerdb_gg04,
              g01serverdb_ident.svServernode_gg04);
        END
    (*ENDIF*) 
    END;
(*ENDWITH*) 
END;
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
.PA 
