FunctionPackage: dbi.mysqlToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version

sql

Arguments: command &key db names full-names convert blob float

The (required) command should be a string giving a valid sql command for MySQL. It need not end in a semicolon. The keyword arguments are:

The function runs command. If command returns row results, sql returns one or two values:

  1. a list of row values. Each row value is a list of column values.
  2. a list of column names (if the names argument is true). (See also mysql-fields, which when applied to the current database object returns a list of field descriptors.)

If command is something that affects rows in the table but doesn't return any values (like an insert or update command) then sql returns nil and (mysql-affected-rows db) will return how many rows were affected (see mysql-affected-rows).

Note on float conversions

Data is transmitted from the database as strings. Numbers are transmitted with strings like "-123.12" or "12.0". Converting "12.0" to the integer 12 is usually preferrable to converting it to the floating point number 12.0, so conversion is done to an integer when possible.

When the conversion is done to a float, as must be done for a number like "-123.12", the type of float (single or double) created is determined as follows:

  1. If the column whose value is being converted has type float then the resulting value is a Lisp integer or a single-float value.
  2. If the column whose value is being converted has type double then the resulting value is a Lisp integer or a double-float value.
  3. If the column whose value is being converted has type decimal then the resulting value is a Lisp integer or a double-float value. A decimal value is a fixed point number (e.g. decimal(13,2) is a 13 digit number with two digits to the right of the decimal point.)

See mysql.htm for information on the Allegro MySQL facility.


Copyright (c) 1998-2016, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.1 page.
Created 2010.1.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2.
8.1 version