TAstaClientDataSet.Params


 

Applies to
TAstaClientDataSet

 

Declaration
property Params: TAstaParamList;

 

Description
The Params property holds parameter information and can be populated a number of different ways.
AstaParamLists are fully streamable and are used extensively in the ASTA messaging system.

1. With paramaterized queries eg. Select * from Customer where custid = :CustomerNumber. :CustomerNumber will be extracted as a parameter

2. With stored procedures. When used this way the Params property will self populate as defined by the database.

3. With ExecSQLWithParams(S: string) to allow for insert statements that include binary or memo fields to be executed.

4. For use in general messaging using a TAstaClientSocket and TAstaServerSocket.

5. With ExecSQL.

 

Params are used in many different ways: with SQL that you provide, with stored procedures or to send values to Server Methods or Providers. They were designed to work just like the Delphi TQuery Params. The TAstaParamList is also an important part of the Asta Messaging feature as TAstaParamLists are fully streamable and can contain any kind of datatypes including datasets or other TAstaParamLists.

 

Here is an SQL example:

Select * from Customer where CustNo = :CustomerNumber

 

The colon ":" is the token that the Params property keys off of to populate the parameter list.

 

 

Note: To allow ASTA to populate a parameterized query you must input the data type for each parameter.

If you set the SQL to Select * from Customer, then set Active to True and then change the query to the above parameterized query, ASTA would be able to correctly run a query as it already had some field information. It knew that CustNo was a type ftInteger. If you initially write a parameterized query, click on the Params Property Editor and set the data type to the correct value, whenever the SQL statement is changed, ASTA checks to see if any colons exist in the new SQL statement and internally calls Prepare to create the parameters. The default data type at this point for each parameter is ftString and the parameter type is set to ptInput.

 



ASTA Overview TAstaClientDataSet.MetaDataRequest TAstaClientDataSet.RowsToReturn