EPUB | CHM | PDF

TPSQLStoredProc.Methods.ParamByName

Top Previous Next

Accesses parameter information based on a specified parameter name.

Syntax:

function ParamByName(const Value: String): TParam;

Description:

Call ParamByName to return parameter information for a specific parameter based on its name. Value is the name of the parameter for which to retrieve information. Typically ParamByName is used to set an input parameter's value at runtime.

Many "internal" stored procedures in PostgreSQL server have no names for their parameters. If you call Prepare, unnamed parameters will be named as "argX" in Params property, where X is the ordinal number of parameter in function declaration.

Example:

The following command line assigns the value "Jane Smith" as the value for the parameter named Contact:

StoredProc1.ParamByName('Contact').AsString := 'Jane Smith';

See also: Params