KEMBAR78
MKF Tool Help | PDF | Table (Database) | String (Computer Science)
0% found this document useful (0 votes)
578 views6 pages

MKF Tool Help

This document provides a summary of commands for the MKF_tool database tool. It describes commands for getting help, selecting rows from tables, joining tables, describing tables, setting parameters, and more. Commands can accept table names, conditions, expressions and other parameters as described.

Uploaded by

Rob Goetz
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
578 views6 pages

MKF Tool Help

This document provides a summary of commands for the MKF_tool database tool. It describes commands for getting help, selecting rows from tables, joining tables, describing tables, setting parameters, and more. Commands can accept table names, conditions, expressions and other parameters as described.

Uploaded by

Rob Goetz
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 6

<MKF_tool>?

In the command descriptions which follow, items in angle brackets ("<>") should be replaced with the appropriate value, items in square brackets ("[]") are optional, and items which should be typed as is are listed in upper case. All commands are case insensitive, therefore any keyword or MKF item name may be entered in either upper or lower case. Keywords listed in upper case may be abbreviated by specifying the initial character(s) of the keyword. Long commands may be broken up into multiple lines by suffixing all lines except the last with the backslash ("\") character. Alternatively long commands may just be typed in as a single long line. The maximum command length is 2000 characters Commands are: HELP [<command>] Prints out help information. If <command> is specified, prints help for the indicated command, otherwise prints out help for all commands SELECT <table_name> <key_cond> [WHERE <expression>] [SHOWING <item_list>;] Prints out rows in the data base COUNT <table_name> <key_cond> [WHERE <expression>] 'CR' = line, 'space' = page, 'p' = paging off, 'x' / 'q' = exit Prints out a count of the number of selected rows TRANOPS <operations_per_transaction> Sets the number of operations per MKF transaction in the delete and update commands. Setting this value low can prevent overflowing the before image partition. Setting this value high can allow an entire command to be done in one transaction, thus guaranteeing that either all or none of the change is made. The default is 100 Note: Transactions do not span commands, and therefore an "end transaction" is done at the end of each command regardless of the setting of this parameter. HARDCOPY [<filename>] Sends program output to a file. If the <filename> is present on the command, a file of the specified name is created, and all output sent to the screen is also send to this file. If <filename> is not present on the screen, the previous output file is closed (if any). HEADERS Toggles whether headers are written to the output device. Useful when generating files of data with no column headers or other non-data items JOIN <table1> TO <table2> AS <table3> BY [<item1>] <item2> Joins tables 1 and 2, creating virtual table 3. Each row in table 3 consists of a row in table 1 combined with a row of table 2. If <item1> is not specified, <item2> is a column which must exist in both tables, and must have the same type. If <item1> is specified,

<item1> is a column in table 1, and <item2> is a column in <table2> in table 2, and both columns must be of the same type and have the same size. Note that this command does not change any data in the data base. It only allows viewing the data of tables 1 and 2 in a new manner. Any operation may be done on the virtual table, including select, delete, update, and insert. If a row exists in table 1 but not in table 2 (or vice versa), attempts to select, delete or update that row using the virtual table will fail to locate it, and attempts to insert it will get a duplicates error. Restrictions: When accessing table 3, the keys in table 2 other than <item2> will not be usable, and will appear as ordinary data items. <item1> and <item2> must be the name of a non-group key. Example: When you run this program with no parameters, the following command is implicitly executed: "join surf_stat_info to surf_dyn_info as surf_info by surface_id" This join allows the execution of a select command such as: "select surf_info surface_id > 0 where family_id = 1 and num_act_docs = 0" Note that the above command wouldn't be possible without the 'join' command, because "family_id" is in table "surf_stat_info", but "num_act_docs" is in table "surf_dyn_info". NOTE: When performing a command, e.g., 'select', on a virtual table: In 'where' expressions and 'showing' lists, you may need to qualify the name of a column with the name of the real table it belongs to, in order to disambiguate a column with the same name in two different real tables joined into the virtual table. For example, you may need to type 'docs.doc_id' . Also, if the same real table is is incorporated into the virtual table more than once, you may need to qualify the real table name with the real table occurrence number. The first occurrence of the real table is number one. For example, 'docs[1].doc_id' . By default, column names that aren't qualified by their real table name refer to the first real table in the virtual table that contains the column. By default, the real table occurrence number is one. TERMOFFdescrib Turns off terminal output, which may be desirable if writing large amounts of data to an output file via the HARDCOPY command TERMON Turns the terminal back on after being shut off with TERMOFF DESCRIBE [<table_name>]

Describes the items in the indicated table. If no table name is given, gives names (but not descriptions) of all tables <MKF_tool>describe csm_used_space csm_caches write_request batch_stat_hdr batch_ixdir batch_ixval batch_ctl print_options print_svcs batch_data print_reqopt family_disk surf_stat_info cluster_map od_stats surf_locator remote_family lib_surfaces COMPUTE <expression> Prints out the value of the expression given. In addition to constants, expression may include variable names from the previously selected record. !<shell_cmd> Executes the specified shell command ^<old_pattern>^<new_pattern> Executes the command formed by replacing <old_pattern> with <new_pattern> in the previous command. "^^" repeats the last command unchanged. "^" prints the last command, but does not execute it. <table_name> = the name of a table, or '.' to mean last table referenced. <key_cond> -or<key_cond> -or<key_cond> = [<key_const> <op>] <key_name> <op> <key_const> = * = <key_name> in <filename> A <key_cond> of '*' means all columns in table using the first defined key where the key value is >= zero. The '<key_name> in <filename>' format is used when the key values are list of constants in the file '<filename>', one constant per line. <key_const> = <exp>[:<key_const>] (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0)** (permanent_db0) (permanent_db0) (permanent_db0) (permanent_db0) (permanent_db0) (permanent_db0) (permanent_db0) csm_free_space csm_temp_id bkg_request batch_dyn_hdr batch_image batch_doc print_requests print_docs batch_folder batch_hdr (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0) (transient_db0)**

surf_dyn_info (permanent_db0) docs (permanent_db0) scalar_numbers (permanent_db0) annotations (permanent_db0) family_locator (permanent_db0) surface_activity(permanent_db0) surf_info (permanent_db0)**

One <exp> must exist in the <key_const> for each of the key. Key components are items in a group and elements in any array except an ascii array. arrays count as one <exp>, and do not need to be as <char>:<char>:<char>... <exp> = Same as <expression> except uses only constants.

component key, Ascii entered

<expression> = A mathematical expression. Operators are: + * % | and ! < = != add multiply modulo bitwise 'or' logical 'and' logical 'not' less than equal unequal / & ~ or > >= <= subtract divide bitwise 'and' ones complement logical 'or' greater than greater than or equal to less than or equal to

Parenthesis are allowed to override precedence of operators. Operands are: 1. MKF column names: 1.a. <column-name> This form is sufficient for columns of real tables. 1.b. <real-table-name> . <column-name> This form may be needed for columns of virtual tables when there is a column with the same name in two or more of the real tables that were joined together. (Virtual tables are created by the 'join' command.) 1.c. <real-table-name> [ occurrence ] . <column-name> This form may be needed for columns of virtual tables when the same real table has been joined into the virtual table more than once. The value of 'occurrence' is a decimal integer that indicates the occurrence of the real table. The first (leftmost) occurrence is number one. 2. String constants 3. Character constants 4. Hexadecimal constants 5. Decimal constants 6. The character '*' MKF column names must be typed as declared in the DDL. No abbreviations are allowed, but names are case insensitive. MKF column names which are non-ascii arrays must be subscripted with '[<expression>]'. MKF column names which are ascii arrays may or may not be subscripted. Ascii arrays which aren't subscripted may only be compared against string constants or other ascii arrays. Columns of type MKF_item_date are defined to be either integers or date strings in the format "yyyy/mm/dd". Columns of type MKF_item_datetime are also defined to be integers or date/time strings in the format "yyyy/mm/dd hh:mm:ss". String constants are surrounded with double quotes, and

any pair of double quotes will be treated as a single quote within the string. Character constants are any character surrounded by single quotes. Only one character is allowed between the quotes, and it may be the quote character itself. Hexadecimal constants must be preceded with '0x'; all constants not preceded with '0x' are assumed to be decimal. The operand '*' is used to denote a null MKF column, and may be used in expressions of the form "<MKF_column> = *" or "<MKF_column> != *". The expression will have the value TRUE or FALSE depending on whether the MKF column is null or not. Note: If an MKF column is null and it's used in any expression other than the two given above, the MKF column will have the value zero. <item_list> = <item_name> [<item_list>] The <item_list> indicates which columns in the row to display. <item_name> = The MKF DDL name of a column in a table (for virtual tables created by the 'join' command, the column name may be qualfied by the real table name, e.g., 'docs.doc_id', or the column name may be qualified by the real table name and the real table's occurrence within the virtual table, e.g., 'docs[1].doc_id', where the first occurrence is number one), or the functions 'min', 'max', 'sum', and 'avg' followed by the (possibly qualfied) column name surrounded by parentheses. The functions give the minimum, maximum, sum, and average of the designated column for all rows selected. For the average function, null columns in selected rows are ignored and do not change the average. Examples (using the docs table in the default MKF permanent database): 1. 'se docs *' Selects all rows of docs with a doc_id key (first key of the record) and displays them. 2. 'se docs doc_id = 2000000000' Displays the row with document id 2000000000. Note that this command only looks at one row in the database, and will finish in less than one second. However, the command: 'se docs * where doc_id = 2000000000' is grossly inefficient because it searches all the rows in the docs table for the one with doc_id 2000000000, and this form may take hours to execute!

3. 'se docs 100000 < doc_id < 100101 where surface_id_1 = 3000' Checks 100 rows where surface_id_1 = 3000. 4. 'se docs orig_doc > 5036:100000 showing surface_id_1 offset_1; where surface_id_1 > 0' Finds rows where orig_ssn/orig_doc is greater than 5036/100000 and surface_id_1 > 0, and displays only the surface_id_1 and offset_1 fields. <MKF_tool>

You might also like