RuleAPI:Procedural commands/Database/SelectRow

From FlexRule Wiki
Jump to: navigation, search

Summary

This command selects one or more records from a database table. The return value from the database will be one or multiple rows (i.e., an array of rows). Each row will have a GetValue (string name) method that can be accessed to read the value of the columns of the row; otherwise, its indexer can be used.

Parameters

  1. command
    1. Description: The Select command
    2. Mandatory: Yes
    3. Type: String
  2. return
    1. Description: Name of the variable in which the row will be stored
    2. Mandatory: Yes
    3. Type: String
  3. storedProcedure
    1. Description: Determines whether the command should execute a stored procedure in the database
    2. Mandatory: No
    3. Type: Boolean (true/false)
  4. multi
    1. Description: Indicates whether the Select command will return multiple rows
    2. Mandatory: No
    3. Type: Boolean (true/false)
  5. expando
    1. Description: Indicates whether the Select result will be return as a single/list of ExpandoObject
    2. Mandatory: No
    3. Type: Boolean (true/false)
  6. dynamicSQL
    1. Description: True when the 'command' is going to be evaluated against the current execution context, otherwise false.
    2. Mandatory: No
    3. Type: Boolean (true/false)

Internal Commands

Param

This command sends a Break command to the execution flow iterating inside a Do command.

Sample

  1. <Database connection-ref="cnn" type="MsAccess">
  2.   <SelectRow command="select * from person where id = @id" multi="true" return="list">
  3.     <Param name="id" type="System.Int32" value="1"/>
  4.   </SelectRow>
  5. </Database>
  6. <Var name="name" value='(list[0]).GetValue("FName")' process="true"/>