.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$VAK03$
.tt 2 $$$
.TT 3 $ElkeZ$AK_syntax_values_tools$2000-03-03$
***********************************************************
.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
.nf
.sp
MODULE  : AK_syntax_values_tools
=========
.sp
Purpose :
.CM *-END-* purpose -------------------------------------
.sp
.cp 3
Define  :
 
        PROCEDURE
              a03_aunsigned_integer (VAR acv : tak_all_command_glob;
                    VAR put_node       : tsp00_Int2;
                    VAR last_node      : tsp00_Int2);
 
        PROCEDURE
              a03_ainteger (VAR acv : tak_all_command_glob;
                    VAR put_node       : tsp00_Int2;
                    VAR last_node      : tsp00_Int2);
 
        PROCEDURE
              a03_avalue_spec (VAR acv  : tak_all_command_glob;
                    null_allowed    : boolean;
                    stamp_allowed   : boolean;
                    default_allowed : boolean;
                    sysdba_allowed  : boolean;
                    VAR put_node    : tsp00_Int2;
                    VAR last_node   : tsp00_Int2);
 
        PROCEDURE
              a03_l_avalue_list (VAR acv : tak_all_command_glob;
                    null_allowed    : boolean;
                    stamp_allowed   : boolean;
                    default_allowed : boolean;
                    sysdba_allowed  : boolean;
                    VAR put_node    : tsp00_Int2;
                    VAR last_node   : tsp00_Int2);
 
        PROCEDURE
              a03_l_aexpression_list (VAR acv : tak_all_command_glob;
                    VAR put_node    : tsp00_Int2;
                    VAR last_node   : tsp00_Int2);
 
        PROCEDURE
              a03_ln_aexpression_list (VAR acv : tak_all_command_glob;
                    VAR put_node    : tsp00_Int2;
                    VAR last_node   : tsp00_Int2);
 
        PROCEDURE
              a03_aliteral (VAR acv     : tak_all_command_glob;
                    VAR put_node  : tsp00_Int2;
                    VAR last_node : tsp00_Int2);
 
        PROCEDURE
              a03_astring_literal (VAR acv : tak_all_command_glob;
                    VAR put_node     : tsp00_Int2;
                    VAR last_node    : tsp00_Int2);
 
        PROCEDURE
              a03_anumeric_literal (VAR acv : tak_all_command_glob;
                    VAR put_node      : tsp00_Int2;
                    VAR last_node     : tsp00_Int2);
 
.CM *-END-* define --------------------------------------
.sp;.cp 3
Use     :
 
        FROM
              Scanner : VAK01;
 
        VAR
              a01kw : tak_keywordtab;
 
        PROCEDURE
              a01_next_symbol (VAR acv : tak_all_command_glob);
 
        PROCEDURE
              a01_force_symbol (VAR acv : tak_all_command_glob;
                    expected_symbol : tak_sc_symbol;
                    VAR node1       : tsp00_Int2;
                    VAR node2       : tsp00_Int2);
 
        PROCEDURE
              a01_put_node (VAR acv  : tak_all_command_glob;
                    VAR curr_n : tsp00_Int2);
 
        PROCEDURE
              a01_call_put (VAR acv : tak_all_command_glob;
                    proc     : tak_procs;
                    subproc  : tsp00_Int2;
                    VAR curr_n : tsp00_Int2);
 
        PROCEDURE
              a01_get_keyword (VAR acv : tak_all_command_glob;
                    VAR index    : integer;
                    VAR reserved : boolean);
 
        FUNCTION
              a01_odbc_end_ok (VAR acv : tak_all_command_glob;
                    partype : tak_odbc_partype) : boolean;
 
        PROCEDURE
              a01_is_odbc_syntax (VAR acv : tak_all_command_glob;
                    VAR partype  : tak_odbc_partype;
                    VAR functype : tak_odbc_functiontype);
 
        FUNCTION
              a01_eqkey (VAR a : tak_keyword;
                    sqlmode    : tsp00_SqlMode;
                    VAR b      : tsp00_MoveObj;
                    VAR scv    : tak_scanner_glob) : boolean;
 
      ------------------------------ 
 
        FROM
              AK_syntax_tools : VAK02;
 
        PROCEDURE
              a02_s_aparameterspec (VAR acv : tak_all_command_glob;
                    VAR put_node      : tsp00_Int2;
                    VAR last_node     : tsp00_Int2);
 
      ------------------------------ 
 
        FROM
              AK_error_handling : VAK07;
 
        PROCEDURE
              a07_error (VAR acv   : tak_all_command_glob;
                    err      : tgg00_BasisError;
                    VAR nod1 : tsp00_Int2;
                    VAR nod2 : tsp00_Int2);
 
      ------------------------------ 
 
        FROM
              AK_error_handling : VAK071;
 
        FUNCTION
              a071_return_code (
                    b_err   : tgg00_BasisError;
                    sqlmode : tsp00_SqlMode) : tsp00_Int2;
 
      ------------------------------ 
 
        FROM
              Where_Part : VAK63;
 
        PROCEDURE
              a63_avalue_expression (VAR acv : tak_all_command_glob;
                    VAR put_node  : tsp00_Int2;
                    VAR last_node : tsp00_Int2);
 
      ------------------------------ 
 
        FROM
              Configuration_Parameter : VGG01;
 
        VAR
              g01glob           : tgg00_KernelGlobals;
 
.CM *-END-* use -----------------------------------------
.sp;.cp 3
Synonym :
 
.CM *-END-* synonym -------------------------------------
.sp;.cp 3
Author  : ElkeZ
.sp
.cp 3
Created : 1985-01-21
.sp
.cp 3
.sp
.cp 3
Release :      Date : 2000-03-03
.sp
***********************************************************
.sp
.cp 10
.fo
.oc _/1
Specification:
 
.nf
PROCEDURE a03_aunsigned_integer:
.sp 1
Erkennt Syntax :
.sp 1
<unsigned_integer> ::=
  <*unsigned_integer>;
.sp 4
PROCEDURE  a03_avalue_spec:
.sp 1
Erkennt Syntax :
.sp 1
<value_spec> ::=
      <literal>
    / <parameter_spec>
    / 'NULL'
    / 'DATE'
    / 'TIME'
    / 'USER'
    / 'USERGROUP'
    / 'STAMP';
.sp 4
PROCEDURE  a03_e_avalue_expression:
.sp 1
Erkennt Syntax :
.sp 1
<value_expression> ::=
      <term> (* ( '+' / '-' ) <term> *);
 
                   <term> ::=
                     <factor> (* ( '*' / '/' ) <factor> *);
 
                   <factor> ::=
                     [  '+' / '-'  ] <primary>;
 
                   <primary> ::=
                     <value_spec>
                   / <column_spec>
                   / <function_spec>
                   / '(' <value_expression> ')';
 
.sp 4
PROCEDURE  a03_l_avalue_list:
.sp 1
Erkennt Syntax :
.sp 1
<value_list> ::=
    <value_spec> (* ',' <value_spec> *);
.sp 4
PROCEDURE  a03_aliteral:
.sp 1
Erkennt Syntax :
.sp 1
<literal> ::=
      <string_literal>
    / <numeric_literal>;
.sp 2
.CM *-END-* specification -------------------------------
.sp 2
***********************************************************
.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    :
 
 
(*------------------------------*) 
 
PROCEDURE
      a03_l_aexpression_list (VAR acv : tak_all_command_glob;
            VAR put_node    : tsp00_Int2;
            VAR last_node   : tsp00_Int2);
 
VAR
      i_node : tsp00_Int2;
 
BEGIN
WITH acv, a_scv DO
    IF  a_returncode = 0
    THEN
        BEGIN
        a01_call_put (acv, a64, cak_x_value_expression, put_node);
        last_node := put_node;
        a63_avalue_expression (acv, a_ap_tree^[ last_node ].n_lo_level,
              i_node);
        WHILE sc_symb = s_comma DO
            BEGIN
            a01_next_symbol (acv);
            a01_call_put (acv, a64, cak_x_value_expression,
                  a_ap_tree^[ last_node ].n_sa_level);
            last_node := a_ap_tree^[ last_node ].n_sa_level;
            a63_avalue_expression (acv, a_ap_tree^[ last_node ].n_lo_level,
                  i_node);
            END
        (*ENDWHILE*) 
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a03_ln_aexpression_list (VAR acv : tak_all_command_glob;
            VAR put_node    : tsp00_Int2;
            VAR last_node   : tsp00_Int2);
 
VAR
      i_node : tsp00_Int2;
 
BEGIN
WITH acv, a_scv DO
    IF  a_returncode = 0
    THEN
        BEGIN
        a01_call_put (acv, a64, cak_x_value_expression, put_node);
        last_node := put_node;
        IF  sc_symb = s_identifier
        THEN
            IF  a01_eqkey (a01kw[ cak_i_null ], a_sqlmode,
                a_cmd_part^.sp1p_buf, a_scv)
            THEN
                BEGIN
                sc_symb := s_null;
                a01_put_node (acv,
                      a_ap_tree^[ last_node ].n_lo_level);
                a01_next_symbol (acv);
                END
            ELSE
                a63_avalue_expression (acv, a_ap_tree^[ last_node ].n_lo_level,
                      i_node)
            (*ENDIF*) 
        ELSE
            a63_avalue_expression (acv, a_ap_tree^[ last_node ].n_lo_level,
                  i_node);
        (*ENDIF*) 
        WHILE sc_symb = s_comma DO
            BEGIN
            a01_next_symbol (acv);
            a01_call_put (acv, a64, cak_x_value_expression,
                  a_ap_tree^[ last_node ].n_sa_level);
            last_node := a_ap_tree^[ last_node ].n_sa_level;
            IF  sc_symb = s_identifier
            THEN
                IF  a01_eqkey (a01kw[ cak_i_null], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    BEGIN
                    sc_symb := s_null;
                    a01_put_node (acv,
                          a_ap_tree^[ last_node ].n_lo_level);
                    a01_next_symbol (acv);
                    END
                ELSE
                    a63_avalue_expression (acv,
                          a_ap_tree^[ last_node ].n_lo_level, i_node)
                (*ENDIF*) 
            ELSE
                a63_avalue_expression (acv, a_ap_tree^[ last_node ].n_lo_level,
                      i_node);
            (*ENDIF*) 
            END
        (*ENDWHILE*) 
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a03_ainteger (VAR acv : tak_all_command_glob;
            VAR put_node       : tsp00_Int2;
            VAR last_node      : tsp00_Int2);
 
VAR
      mult : integer;
 
BEGIN
IF  acv.a_returncode = 0
THEN
    BEGIN
    mult := 1;
    IF  acv.a_scv.sc_symb = s_plus
    THEN
        a01_next_symbol (acv)
    ELSE
        IF  acv.a_scv.sc_symb = s_minus
        THEN
            BEGIN
            mult := -1;
            a01_next_symbol (acv)
            END;
        (*ENDIF*) 
    (*ENDIF*) 
    a03_anumeric_literal (acv, put_node, last_node);
    IF  acv.a_returncode = 0
    THEN
        acv.a_ap_tree^[ put_node ].n_pos :=
              acv.a_ap_tree^[ put_node ].n_pos * mult
    (*ENDIF*) 
    END;
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a03_aunsigned_integer (VAR acv : tak_all_command_glob;
            VAR put_node       : tsp00_Int2;
            VAR last_node      : tsp00_Int2);
 
BEGIN
IF  acv.a_returncode = 0
THEN
    BEGIN
    IF  acv.a_scv.sc_symb = s_plus
    THEN
        a01_next_symbol (acv);
    (*ENDIF*) 
    IF  acv.a_returncode = 0
    THEN
        a03_anumeric_literal (acv, put_node, last_node);
    (*ENDIF*) 
    IF  acv.a_returncode = a071_return_code (e_missing_number, acv.a_sqlmode)
    THEN
        BEGIN
        acv.a_returncode := 0;
        a07_error (acv, e_missing_integer, put_node, last_node)
        END;
    (*ENDIF*) 
    END
(*ENDIF*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a03_l_avalue_list (VAR acv : tak_all_command_glob;
            null_allowed    : boolean;
            stamp_allowed   : boolean;
            default_allowed : boolean;
            sysdba_allowed  : boolean;
            VAR put_node    : tsp00_Int2;
            VAR last_node   : tsp00_Int2);
 
BEGIN
WITH acv, a_scv DO
    IF  a_returncode = 0
    THEN
        BEGIN
        a03_avalue_spec (acv, null_allowed, stamp_allowed,
              default_allowed, sysdba_allowed,
              put_node, last_node);
        WHILE sc_symb = s_comma DO
            BEGIN
            a01_next_symbol (acv);
            a03_avalue_spec (acv, null_allowed, stamp_allowed,
                  default_allowed, sysdba_allowed,
                  a_ap_tree^[ last_node ].n_sa_level, last_node);
            END
        (*ENDWHILE*) 
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(* PTS 1111797 E.Z. *)
(*------------------------------*) 
 
PROCEDURE
      a03_avalue_spec (VAR acv  : tak_all_command_glob;
            null_allowed    : boolean;
            stamp_allowed   : boolean;
            default_allowed : boolean;
            sysdba_allowed  : boolean;
            VAR put_node    : tsp00_Int2;
            VAR last_node   : tsp00_Int2);
 
VAR
      current_found : boolean;
      kw_index      : integer;
      res_kw        : boolean;
      scvh          : tak_scanner_glob;
      m_symb        : tak_sc_symbol;
      found_symb    : tak_sc_symbol;
      odbc_partype  : tak_odbc_partype;
      odbc_functype : tak_odbc_functiontype;
 
BEGIN
WITH acv, a_scv DO
    IF  a_returncode = 0
    THEN
        BEGIN
        odbc_partype := no_odbc;
        odbc_functype := odbc_nothing;
        IF  (a_comp_type = at_odbc) OR (a_comp_type = at_jdbc)
        THEN
            BEGIN
            a01_is_odbc_syntax (acv, odbc_partype, odbc_functype);
            IF  (odbc_partype <> no_odbc) AND
                (odbc_functype in [odbc_fn, odbc_d, odbc_t, odbc_ts])
            THEN
                a01_next_symbol (acv);
            (*ENDIF*) 
            END;
        (*ENDIF*) 
        CASE sc_symb OF
            s_parameter_name :
                IF  (a_ex_kind <> only_parsing) AND
                    (* PTS 1111575 E.Z. *)
                    (a_ex_kind <> only_syntax)  AND
                    (NOT a_intern_explain)
                THEN
                    a07_error (acv, e_parameter_not_allowed,
                          put_node, last_node)
                ELSE
                    a02_s_aparameterspec (acv, put_node, last_node);
                (*ENDIF*) 
            s_byte_string, s_string_literal :
                a03_astring_literal (acv, put_node, last_node);
            s_unsigned_integer, s_fixed_point_literal,
            s_floating_point_literal :
                a03_anumeric_literal (acv, put_node, last_node);
            s_plus, s_minus :
                ak03aplus_minus (acv, put_node, last_node);
            s_identifier :
                BEGIN
                current_found:= false;
                IF  a01_eqkey (a01kw[ cak_i_current ], a_sqlmode,
                    a_cmd_part^.sp1p_buf, a_scv)
                THEN
                    IF  a_sqlmode = sqlm_db2
                    THEN
                        BEGIN
                        current_found:= true;
                        a01_next_symbol(acv);
                        END
                    ELSE
                        a07_error (acv, e_missing_keyword, put_node, last_node);
                    (*ENDIF*) 
                (*ENDIF*) 
                a01_get_keyword (acv, kw_index, res_kw);
                IF  a_returncode = 0
                THEN
                    CASE kw_index OF
                        cak_i_date, cak_i_time, cak_i_timezone :
                            BEGIN
                            (* PTS 1000313 E.Z. *)
                            (* PTS 1105820 E.Z. *)
                            IF  ((a_sqlmode = sqlm_internal)           OR
                                (
                                (a_sqlmode = sqlm_oracle)        AND
                                ((a_comp_type = at_odbc) OR (a_comp_type = at_jdbc))
                                )                                    OR
                                ((a_sqlmode = sqlm_db2) AND current_found))
                            THEN
                                BEGIN
                                CASE kw_index OF
                                    cak_i_date :
                                        sc_symb := s_date;
                                    cak_i_time :
                                        sc_symb := s_time;
                                    cak_i_timezone :
                                        sc_symb := s_timezone;
                                    END;
                                (*ENDCASE*) 
                                a01_put_node (acv, put_node);
                                a01_next_symbol (acv);
                                last_node := put_node;
                                END
                            ELSE
                                a07_error (acv, e_missing_keyword,
                                      put_node, last_node);
                            (*ENDIF*) 
                            END;
                        cak_i_curdate, cak_i_curtime :
                            BEGIN
                            (* PTS 1000313 E.Z. *)
                            (* PTS 1105820 E.Z. *)
                            IF  (a_sqlmode = sqlm_internal)           OR
                                (
                                (a_sqlmode = sqlm_oracle)        AND
                                ((a_comp_type = at_odbc) OR (a_comp_type = at_jdbc))
                                )
                            THEN
                                BEGIN
                                CASE kw_index OF
                                    cak_i_curdate :
                                        sc_symb := s_date;
                                    cak_i_curtime :
                                        sc_symb := s_time;
                                    END;
                                (*ENDCASE*) 
                                a01_put_node (acv, put_node);
                                a01_next_symbol (acv);
                                last_node := put_node;
                                a01_force_symbol (acv, s_leftpar,
                                      put_node, last_node);
                                a01_force_symbol (acv, s_rightpar,
                                      put_node, last_node);
                                END
                            ELSE
                                a07_error (acv, e_missing_keyword,
                                      put_node, last_node);
                            (*ENDIF*) 
                            END;
                        cak_i_now :
                            BEGIN
                            sc_symb := s_now;
                            a01_put_node (acv, put_node);
                            a01_next_symbol (acv);
                            last_node := put_node;
                            a01_force_symbol (acv, s_leftpar,
                                  put_node, last_node);
                            a01_force_symbol (acv, s_rightpar,
                                  put_node, last_node);
                            END;
                        cak_i_timestamp, cak_i_sysdate :
                            BEGIN
                            sc_symb := s_timestamp;
                            a01_put_node (acv, put_node);
                            a01_next_symbol (acv);
                            last_node := put_node;
                            END;
                        (* PTS 1116174 E.Z. *)
                        cak_i_utcdate :
                            BEGIN
                            sc_symb := s_utcdate;
                            a01_put_node (acv, put_node);
                            a01_next_symbol (acv);
                            last_node := put_node;
                            END;
                        (* PTS 1109925 E.Z. *)
                        cak_i_utcdiff :
                            BEGIN
                            sc_symb := s_utcdiff;
                            a01_put_node (acv, put_node);
                            a01_next_symbol (acv);
                            last_node := put_node;
                            END;
                        cak_i_sqlid :
                            IF  ((a_sqlmode = sqlm_db2) AND
                                current_found)
                            THEN
                                BEGIN
                                sc_symb := s_user;
                                a01_put_node (acv, put_node);
                                a_ap_tree^[ put_node ].n_length :=
                                      kw_index;
                                a01_next_symbol (acv);
                                last_node := put_node;
                                END
                            ELSE
                                a07_error (acv, e_missing_keyword,
                                      put_node, last_node);
                            (*ENDIF*) 
                        cak_i_pi :
                            BEGIN
                            sc_symb := s_pi;
                            a01_put_node (acv, put_node);
                            a_ap_tree^[ put_node ].n_length :=
                                  kw_index;
                            a01_next_symbol (acv);
                            last_node := put_node;
                            END;
                        cak_i_uid, cak_i_user, cak_i_usergroup, cak_i_current_schema,
                        cak_i_database :
                            BEGIN
                            CASE kw_index OF
                                cak_i_uid :
                                    sc_symb := s_uid;
                                cak_i_user :
                                    sc_symb := s_user;
                                cak_i_usergroup :
                                    sc_symb := s_usergroup;
                                cak_i_current_schema :
                                    sc_symb := s_current_schema;
                                cak_i_database :
                                    sc_symb := s_database;
                                END;
                            (*ENDCASE*) 
                            a01_put_node (acv, put_node);
                            a_ap_tree^[ put_node ].n_length :=
                                  kw_index;
                            a01_next_symbol (acv);
                            last_node := put_node;
                            END;
                        (* PTS 1111797 E.Z. *)
                        cak_i_sysdba :
                            IF  sysdba_allowed
                            THEN
                                BEGIN
                                sc_symb := s_sysdba;
                                a01_put_node (acv, put_node);
                                a_ap_tree^[ put_node ].n_length :=
                                      kw_index;
                                a01_next_symbol (acv);
                                last_node := put_node;
                                END
                            ELSE
                                a07_error (acv, e_missing_value_spec,
                                      put_node, last_node);
                            (*ENDIF*) 
                        cak_i_null :
                            IF  (null_allowed AND NOT current_found)
                            THEN
                                BEGIN
                                sc_symb := s_null;
                                a01_put_node (acv, put_node);
                                a01_next_symbol (acv);
                                last_node := put_node;
                                END
                            ELSE
                                a07_error (acv, e_missing_value_spec,
                                      put_node, last_node);
                            (*ENDIF*) 
                        cak_i_true :
                            BEGIN
                            sc_symb := s_true;
                            a01_put_node (acv, put_node);
                            a01_next_symbol (acv);
                            last_node := put_node;
                            END;
                        cak_i_false :
                            BEGIN
                            sc_symb := s_false;
                            a01_put_node (acv, put_node);
                            a01_next_symbol (acv);
                            last_node := put_node;
                            END;
                        cak_i_stamp :
                            IF  (stamp_allowed AND NOT current_found)
                            THEN
                                BEGIN
                                sc_symb := s_stamp;
                                a01_put_node (acv, put_node);
                                a01_next_symbol (acv);
                                last_node := put_node;
                                END
                            ELSE
                                a07_error (acv, e_missing_value_spec,
                                      put_node, last_node);
                            (*ENDIF*) 
                        cak_i_transaction :
                            IF  NOT current_found
                            THEN
                                BEGIN
                                sc_symb := s_transaction;
                                a01_put_node (acv, put_node);
                                a01_next_symbol (acv);
                                last_node := put_node;
                                END
                            ELSE
                                a07_error (acv, e_missing_value_spec,
                                      put_node, last_node);
                            (*ENDIF*) 
                        cak_i_default :
                            IF  ((a_sqlmode = sqlm_internal) AND
                                default_allowed AND NOT current_found)
                            THEN
                                BEGIN
                                sc_symb := s_default;
                                a01_put_node (acv, put_node);
                                a01_next_symbol (acv);
                                last_node := put_node;
                                END
                            ELSE
                                a07_error (acv, e_missing_value_spec,
                                      put_node, last_node);
                            (*ENDIF*) 
                        cak_i_degree :
                            IF  ((a_sqlmode = sqlm_db2) AND
                                current_found)
                            THEN
                                BEGIN
                                sc_symb := s_degree;
                                a01_put_node (acv, put_node);
                                a01_next_symbol (acv);
                                last_node := put_node;
                                END
                            ELSE
                                a07_error (acv, e_missing_keyword,
                                      put_node, last_node);
                            (*ENDIF*) 
                        OTHERWISE
                            IF  a_sqlmode in [sqlm_internal, sqlm_oracle]
                            THEN
                                BEGIN
                                found_symb := s_unknown;
                                m_symb     := s_unknown;
                                scvh := a_scv;
                                a01_next_symbol (acv);
                                IF  sc_symb <> s_point
                                THEN
                                    BEGIN
                                    a_scv := scvh;
                                    a07_error (acv, e_missing_value_spec,
                                          put_node, last_node)
                                    END
                                ELSE
                                    BEGIN
                                    a01_next_symbol (acv);
                                    IF  a01_eqkey (a01kw[ cak_i_nextval ], a_sqlmode,
                                        a_cmd_part^.sp1p_buf, a_scv)
                                    THEN
                                        BEGIN
                                        found_symb := s_nextval;
                                        m_symb := s_tablename
                                        END
                                    ELSE
                                        IF  a01_eqkey (a01kw[ cak_i_currval ],
                                            a_sqlmode,
                                            a_cmd_part^.sp1p_buf, a_scv)
                                        THEN
                                            BEGIN
                                            found_symb := s_currval;
                                            m_symb := s_tablename
                                            END
                                        ELSE
                                            IF  sc_symb <> s_identifier
                                            THEN
                                                a07_error (acv, e_missing_value_spec,
                                                      put_node, last_node)
                                            ELSE
                                                BEGIN
                                                a01_next_symbol (acv);
                                                IF  sc_symb <> s_point
                                                THEN
                                                    a07_error (acv, e_missing_value_spec,
                                                       put_node, last_node)
                                                ELSE
                                                    BEGIN
                                                    a01_next_symbol (acv);
                                                    IF  a01_eqkey (a01kw[ cak_i_nextval ],
                                                     a_sqlmode,
                                                     a_cmd_part^.sp1p_buf,
                                                     a_scv)
                                                    THEN
                                                     BEGIN
                                                     found_symb := s_nextval;
                                                     m_symb := s_authid
                                                     END
                                                    ELSE
                                                     IF  a01_eqkey (a01kw[ cak_i_currval ],
                                                      a_sqlmode,
                                                      a_cmd_part^.sp1p_buf,
                                                      a_scv)
                                                     THEN
                                                      BEGIN
                                                      found_symb := s_currval;
                                                      m_symb := s_authid
                                                      END
                                                     (* PTS 1116987 E.Z. *)
                                                     ELSE
                                                      BEGIN
                                                      a_scv := scvh;
                                                      a07_error (acv, e_missing_value_spec,
                                                         put_node, last_node)
                                                      END
                                                     (*ENDIF*) 
                                                    (*ENDIF*) 
                                                    END
                                                (*ENDIF*) 
                                                END
                                            (*ENDIF*) 
                                        (*ENDIF*) 
                                    (*ENDIF*) 
                                    END;
                                (*ENDIF*) 
                                IF  a_returncode = 0
                                THEN
                                    BEGIN
                                    a_scv := scvh;
                                    sc_symb := found_symb;
                                    a01_put_node (acv, put_node);
                                    sc_symb := m_symb;
                                    a01_put_node (acv, last_node);
                                    a_ap_tree^[ put_node ].n_lo_level := last_node;
                                    IF  m_symb = s_authid
                                    THEN
                                        BEGIN
                                        a01_next_symbol (acv);
                                        a01_next_symbol (acv);
                                        sc_symb := s_sequence;
                                        a01_put_node (acv, a_ap_tree^[ last_node ].n_sa_level);
                                        END;
                                    (*ENDIF*) 
                                    a01_next_symbol (acv);
                                    a01_next_symbol (acv);
                                    a01_next_symbol (acv);
                                    last_node := put_node
                                    END
                                (*ENDIF*) 
                                END
                            ELSE
                                a07_error (acv, e_missing_value_spec,
                                      put_node, last_node);
                            (*ENDIF*) 
                        END;
                    (*ENDCASE*) 
                (*ENDIF*) 
                END;
            OTHERWISE
                a07_error (acv, e_missing_value_spec,
                      put_node, last_node);
            END;
        (*ENDCASE*) 
        IF  ((a_comp_type = at_odbc) OR (a_comp_type = at_jdbc))
            AND (odbc_partype <> no_odbc)
        THEN
            IF  NOT a01_odbc_end_ok (acv, odbc_partype)
            THEN
                a07_error (acv, e_missing_keyword,
                      put_node, last_node)
            ELSE
                BEGIN
                CASE odbc_functype OF
                    odbc_d :
                        a_ap_tree^[ put_node ].n_datatype := ddate;
                    odbc_t :
                        a_ap_tree^[ put_node ].n_datatype := dtime;
                    odbc_ts :
                        a_ap_tree^[ put_node ].n_datatype := dtimestamp;
                    OTHERWISE :
                        a_ap_tree^[ put_node ].n_datatype := dunknown;
                    END;
                (*ENDCASE*) 
                a01_next_symbol (acv);
                END;
            (*ENDIF*) 
        (*ENDIF*) 
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a03_aliteral (VAR acv     : tak_all_command_glob;
            VAR put_node  : tsp00_Int2;
            VAR last_node : tsp00_Int2);
 
BEGIN
WITH acv, a_scv DO
    IF  a_returncode = 0
    THEN
        CASE sc_symb OF
            s_byte_string, s_string_literal :
                a03_astring_literal (acv, put_node, last_node);
            s_unsigned_integer, s_fixed_point_literal,
            s_floating_point_literal :
                a03_anumeric_literal (acv, put_node, last_node);
            s_plus, s_minus :
                ak03aplus_minus (acv, put_node, last_node);
            s_true, s_false :
                ak03atrue_false (acv, put_node, last_node);
            OTHERWISE
                a07_error (acv, e_missing_constant, put_node, last_node);
            END;
        (*ENDCASE*) 
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a03_astring_literal (VAR acv : tak_all_command_glob;
            VAR put_node     : tsp00_Int2;
            VAR last_node    : tsp00_Int2);
 
BEGIN
WITH acv, a_scv DO
    IF  a_returncode = 0
    THEN
        BEGIN
        IF  ((sc_symb = s_byte_string) OR
            (sc_symb = s_string_literal))
            AND (sc_sylength >= 0)
        THEN
            BEGIN
            a01_put_node (acv, put_node);
            last_node := put_node;
            a01_next_symbol (acv);
            END
        ELSE
            a07_error (acv, e_missing_string_literal, put_node, last_node)
        (*ENDIF*) 
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      a03_anumeric_literal (VAR acv : tak_all_command_glob;
            VAR put_node      : tsp00_Int2;
            VAR last_node     : tsp00_Int2);
 
BEGIN
WITH acv, a_scv DO
    IF  a_returncode = 0
    THEN
        BEGIN
        IF  (sc_symb = s_unsigned_integer) OR
            (sc_symb = s_fixed_point_literal) OR
            (sc_symb = s_floating_point_literal)
        THEN
            BEGIN
            a01_put_node (acv, put_node);
            last_node := put_node;
            a01_next_symbol (acv);
            END
        ELSE
            a07_error (acv, e_missing_number, put_node, last_node)
        (*ENDIF*) 
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak03aplus_minus  (VAR acv : tak_all_command_glob;
            VAR put_node  : tsp00_Int2;
            VAR last_node : tsp00_Int2);
 
VAR
      curr_n : tsp00_Int2;
      last_n : tsp00_Int2;
 
BEGIN
WITH acv, a_scv DO
    IF  a_returncode = 0
    THEN
        BEGIN
        a01_put_node (acv, curr_n);
        put_node  := curr_n;
        last_node := curr_n;
        a01_next_symbol (acv);
        a03_anumeric_literal (acv, a_ap_tree^[ curr_n ].n_lo_level,
              last_n);
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
(*------------------------------*) 
 
PROCEDURE
      ak03atrue_false  (VAR acv : tak_all_command_glob;
            VAR put_node  : tsp00_Int2;
            VAR last_node : tsp00_Int2);
 
BEGIN
WITH acv, a_scv DO
    IF  a_returncode = 0
    THEN
        BEGIN
        a01_put_node (acv, put_node);
        last_node := put_node;
        a01_next_symbol (acv);
        END;
    (*ENDIF*) 
(*ENDWITH*) 
END;
 
.CM *-END-* code ----------------------------------------
.SP 2 
***********************************************************
.PA 
