THE META-HTML LANGUAGE REFERENCE MANUAL

[TOC]

Manual Page Viewer

Name: SQL::PACKAGE-TO-TABLE

Section: Generic Sql Interface


Synopsis:

    <sql::package-to-table DBVAR PACKAGE TABLE &key [METHOD]

Description:

    Save the variables in PACKAGE in the table TABLE of the database referenced by DBVAR.

    This only saves variables which have names matching existing table column names. Package prefixes are stripped from the variables, and the symbol name is used as the column name to store the data. Symbol names and column names are treated in a case-insensitive manner.

    If you don't specify a METHOD, then the implementation first attempts to do an SQL UPDATE on TABLE if, and only if, there is a record in the table already that exactly matches the primary keys in the data in PACKAGE. Otherwise, an INSERT statement is used. If METHOD is specified, then only that method is tried.

    Both the INSERT and UPDATE attempts use the primary keys of the table in a WHERE clause in order to ensure the uniquness of this record. If you want a sloppier update, please see sql::database-save-package.

    If a variable in the package you are saving corresponds to a column with a numeric field type, and the value of the variable is the empty string, the system will attempt to store a NULL value into this field of the record. If the table does not support NULL values on that column, the operation will fail.

Edit Pointer
Function Index
Variable Index
Variable Editor


The META-HTML Reference Manual V2.0 Copyright © 1995, 1998, Brian J. Fox
Found a bug? Send mail to bug-manual@metahtml.org