------------------------------------------------------- lines 5-106 of file: python/dismod_at/modify_command.py ------------------------------------------------------- # {xrst_begin modify_command} # {xrst_spell # exp # } # {xrst_comment_ch #} # # Modify a Column of an Sqlite Database # ##################################### # # Deprecated # ********** # This command was deprecated on 2021-12-05. # # Syntax # ****** # # As Program # ========== # # | ``dismod-at`` *database* ``modify`` \\ # | |tab| *table_name* *column_name* *row_expression* *value_expression* \\ # | |tab| *statement_one* *statement_two* ... # # As Python Function # ================== # ``dismod_at.modify_command`` ( *database* , *arg_list* ) # # See Also # ******** # It is simpler to use the :ref:`set_command-name` when it is # it is capable of making a change. # # Warning # ******* # You can change any value in the database using the modify command. # It is suggested that you re-run the :ref:`init_command-name` , # unless you are certain that the set of # :ref:`model_variables-name` was not affected by this change. # # log table # ********* # This command uses :ref:`python_log_command-name` to enter # begin and end markers in the database log table. # # arg_list # ******** # This is a list of strings containing the arguments in the # program syntax. To be specific, # *arg_list* [0] is *table_name* , # *arg_list* [1] is *column_name* , # e.t.c. # # database # ******** # Is the file name corresponding to the Sqlite database. # # table_name # ********** # Is the name of the table in the database that is modified. # # column_name # *********** # Is the name of the column in the table that is modified. # # row_expression # ************** # This is a python expression that evaluates to # ``True`` or ``False`` . # Only rows where the expression is ``True`` are modified. # # value_expression # **************** # This is a python expression that specifies the value to be placed in the # specified column when the row expression is ``True`` . # # Expressions # *********** # For each row, an expression can reference the value in a column using # the corresponding column name. In other words, for each column, a variable # with the column name is set to the value in that column. # # statements # ********** # There may be zero or more python statements at the end of the # command line. Each one is executed before the expressions are evaluated. # For example, one of the statements might be # :: # # from math import exp # # This would make the function ``exp`` ( *x* ) available for use # in *row_expression* and *value_expression* . # # {xrst_toc_hidden # example/get_started/modify_command.py # } # Example # ******* # The file :ref:`modify_command.py-name` contains an example and test # using this command. # # {xrst_end modify_command}