| THE META-HTML LANGUAGE REFERENCE MANUAL

| [TOC] |

## Manual Page Viewer

Name: ODBC::DATABASE-SAVE-PACKAGE

Section: Odbc Database Operators

Synopsis:

`<odbc::database-save-package DBVAR KEY PACKAGE [KEYNAME=FIELDNAME] [TABLE=TABLENAME]>`

Description:

Save the variables in PACKAGE associated with the value KEY in column KEYNAME in the table TABLENAME of the database referenced by DBVAR.

This only saves variables which have names matching existing table fields. 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.

`` is implemented to first attempt to do a SQL INSERT into the table, and if that fails to try a UPDATE query, with KEYNAME = KEY.

Example: Say we want to save some information about employee Kate Mulgrew, in a table of employees, which has a primary key field named "id", and we want to save this record with id=103:

    <p>
    <p>
     <set-var baz::name="Kate Mulgrew" baz::age=45 baz::salary=34000
        baz::dept=travel><p>
      <set-var result=<odbc::database-save-package mydb 103 baz
    					       table=employees keyname=id>>

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 V1.4 Copyright © 1995, 1996, Brian J. Fox, 1996, 1997 Universal Access Inc.
Found a bug? Send mail to bug-manual@metahtml.com