AcuODBC User's Guide
Version 6.0

5.3.3 INSERT Command

Use the SQL command INSERT to add one or more rows to an existing table, and, depending on the configuration of the DSN, to insert records into your Vision data files.


    INSERT INTO <table-name> [(<field-list>)]   
    VALUES (<values-list>)   


<table-name> is the name of the table into which you want to insert rows.

<field-list> is an optional list of fields to which you want to assign values. This list must be written according to the following syntax:

    <field-name> [,<field-name>] ...   

Omitting this list specifies all the fields of the table, using the same order as they are defined.

<values-list> is a list of literals. The values of these literals are assigned to the fields specified in <field-list>, according to the order in which they are listed. For this reason, the number of elements of both the lists must be equal. At the same time, the value of the literal must be compliant with the type of field (alphabetic, numeric, etc.).

<values-list> has the following format:

    <literal> [,<literal>]  ...   


Enter the following command to add a patient to the "pets" table:

    INSERT INTO pets (Patient_ID, Patient_name, Animal_type,   
       Breed, Treatment, Owner_ID)   
    VALUES ('525', 'Brandy', 'Dog', 'Golden Retriever', '1',   

The table now has an additional row.

Note: If a data source is designated as read-only and the data is linked, users cannot insert rows into the table or records into the data file. Read Only is the default setting. To enable users to insert rows in the table and records in the data file, clear the Read Only check box on the Advanced tab of the AcuODBC Configuration property sheet (or the AcuODBC Server Configuration property sheet if this is a remote DSN).

Acucorp, Inc.
Voice: (800) 262-6585 (U.S.A. and Canada)
Voice: (858) 689-4500
Fax: (858) 689-4550

Please share your comments on this manual
or on any Acucorp documentation with the
Acucorp Communications Department.
1988-2003 Acucorp, Inc.
All rights reserved.