Database access functions
91
Database access functions
Database access functions let you query a database. For the collection of functions that manage a
database connection, see
“Database connection functions” on page 78
.
The following list describes some of the arguments that are common to the functions that are
available:
•
Most database access functions use a connection name as an argument. You can see a
list of valid connection names in the Connection Manager, or you can use the
MMDB.getConnectionList()
function to get a list of all the connection
names programmatically.
•
Stored procedures often require parameters. There are two ways of specifying parameter values
for database access functions. First, you can provide an array of parameter values
(
paramValuesArray)
. If you specify only parameter values, the values need to be in the
sequence in which the stored procedure requires the parameters. Second, you specify parameter
values to provide an array of parameter names (
paramNameArray
). You can use the
MMDB.getSPParamsAsString()
function to get the parameters of the stored procedure. If you
provide parameter names, the values that you specify in
paramValuesArray
must be in the
sequence of the parameter names that you specify in
paramNameArray
.
MMDB.getColumnAndTypeList()
Availability
Dreamweaver UltraDev 1.
Description
This function gets a list of columns and their types from an executed SQL
SELECT
statement.
Arguments
connName, statement
•
The
connName
argument is a connection name that is specified in the Connection Manager. It
identifies the connection string that Dreamweaver should use to make a database connection
to a live data source.
•
The
statement
argument is the SQL
SELECT
statement to execute.
Returns
An array of strings that represents a list of columns (and their types) that match the
SELECT
statement, or an error if the SQL statement is invalid or the connection cannot be made.
Example
The code
var columnArray = MMDB.getColumnAndTypeList("EmpDB","Select * from
Employees")
returns the following array of strings:
columnArray[0] = "EmpName"
columnArray[1] = "varchar"
columnArray[2] = "EmpFirstName"
columnArray[3] = "varchar"
columnArray[4] = "Age"
columnArray[5] = "integer"
000_DW_API_Print.book Page 91 Wednesday, August 20, 2003 9:14 AM
Содержание DREAMWEAVER MX 2004
Страница 1: ...Dreamweaver API Reference...
Страница 24: ...24 Contents...
Страница 32: ......
Страница 70: ...70 Chapter 5 Fireworks Integration...
Страница 76: ...76 Chapter 6 Flash Integration...
Страница 116: ...116 Chapter 9 The JavaBeans API...
Страница 140: ......
Страница 152: ...152 Chapter 11 Application...
Страница 218: ...218 Chapter 12 Workspace...
Страница 248: ...248 Chapter 13 Site...
Страница 292: ...292 Chapter 14 Document...
Страница 378: ...378 Chapter 17 Design...
Страница 430: ...430 Chapter 18 Code...
Страница 486: ...486 Index...