beautypg.com

Mmdb.getspparamsasstring(), Mmdb.gettables() – Adobe Dreamweaver API Reference CS5 User Manual

Page 79

background image

74

DREAMWEAVER API REFERENCE

The database API

Last updated 8/27/2013

Example
The following example retrieves the parameter objects for the specified procedure and creates a tooltip for each object
using its properties.

var paramNameObjs = MMDB.getSPParameters(connName,procName);

for (i = 0; i < paramNameObjs.length; i++)
{

var paramObj = paramNameObjs[i];
var tooltiptext = paramObj.datatype;
tooltiptext+=" ";
tooltiptext+=GetDirString(paramObj.directiontype);

}

MMDB.getSPParamsAsString()

Availability
Dreamweaver UltraDev 1.

Description
This function gets a comma-delimited string that contains the list of parameters that the stored procedure takes.

Arguments
connName, procName

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 procName argument is the name of the stored procedure.

Returns
A comma-delimited string that contains the list of parameters that the stored procedure requires. The parameters’
names, direction, and data type are included, separated by semicolons (;).

Example
The code

MMDB.getSPParamsAsString ("EmpDB","getNewEmployeesMakingAtLeast")

can return a string of

form name

startDate;direction:in;datatype:date, salary;direction:in;datatype:integer

.

In this example, the stored procedure,

getNewEmployeesMakingAtLeast

, has two parameters:

startDate

and

Salary

. For

startDate

, the direction is

in

and the data type is

date

. For

salary

, the direction is

in

and the data type

is

date

.

MMDB.getTables()

Availability
Dreamweaver UltraDev 1.

Description
This function gets a list of all the tables that are defined for the specified database. Each table object has three
properties:

table

,

schema

, and

catalog

.