QueryWhereStatementFormat

Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.

SalString QueryWhereStatementFormat( SalString lsMessage )

QueryWhereStmtFormat formats a where statement. This method is called from the query dialog to format the actual where statement from user input in the query dialog.

Parameters

Name Description
SalString lsMessage Attributes to build the where statement from. Supplied format should be of packed cMessage type.
ITEM - A PackArrayUnit ( CHAR_US delimited ) string of all included column names.
VALUE - A PackArrayUnit ( CHAR_US delimited ) string of all values to be processed.
ALIAS - Optional attribute that can be used in situations where the DbColumnName should be substituted with a column alias in the completed where statement. Syntax should be COLUMN;ALIAS
CASE - This attribute specifies if the query should be case sensitive or not. Valid values are 'true' or 'false'. This attribute is optional and will be defaulted to true.
 

Returns

The created where statement or 'NoQuery' if the method fails to process the message in any way.

Comments

If a DbColumn specified as an attribute is not found in the current datasource. The return value will be 'NoQuery'. The item and value attributes are CHAR_US separated attribute strings. Use public methods PackArrayUnit and UnpackStringUnit.

Example

add new C# coding sample

Set sItemArray[0] = 'COMPANY_ID'
Set sItemArray[1] = 'ORDER_NO'
Set sValueArray[0] = '01'
Set sValueArray[1] = '1000'
...
Call Msg.AddAttribute( 'ALIAS','COMPANY_ID;SITE' );
Call Msg.AddAttribute( 'ITEM',PackArrayUnit( strNULL, 
sItemArray );
Call Msg.AddAttribute( 'VALUE', PackArrayUnit( strNULL,
sValueArray );
Call QueryWhereStmtFormat( Msg.Pack( ) )

This will result in a where statement like 
SITE = '01' AND ORDER_NO = '1000'