Caché MultiValue Query Language - InterSystems Documentation

Caché MultiValue Query Language - InterSystems Documentation

Caché MultiValue QueryLanguage (CMQL) ReferenceVersion 2010.117 February 2010InterSystems Corporation 1 Memorial Drive Cambridge MA 02142

About This BookThis book provides reference material for CMQL (Caché MultiValue Query Language). CMQL is the Caché MultiValueimplementation of an SQL-like query language for MultiValue data.This book contains the following sections:••There is also a detailed Table of Contents.Other related topics in the Caché documentation set are:• Using the MultiValue Features of Caché• Operational Differences between MultiValue and Caché• The Caché MultiValue SpoolerFor general information, see Using InterSystems Documentation.Caché MultiValue Query Language (CMQL) Reference 1

CMQL CommandsCaché MultiValue Query Language (CMQL) Reference 3

CMQL CommandsBSELECTSelects data into a list using attribute contents.BSELECT file field attributeArgumentsfilefieldattributeA MultiValue file.A field name.An attribute of a field.DescriptionThe BSELECT command selects the data specified in the query. If a selected item is multi-valued, BSELECT returnsmultiple list entries for the attribute, separating values and subvalues into separate list entries. If a selected item is singlevalued,BSELECT returns one list entry for the attribute, replacing @VM and @SVM delimiters with blank spaces. If anattribute is empty, BSELECT returns a list item with an empty ID; if a value is empty, BSELECT ignores it.This is similar to a SELECT SAVING statement. The distinction is that BSELECT defaults to NONULLS.ExampleThe following MultiValue Basic program returns four records when A1 is multivalued:OPEN 'VOC' TO VOC ELSE ABORTWRITE 'A':@VM:'':@VM:@VM:'B' ON VOC,'TESTITEM1'WRITE '' ON VOC,'TESTITEM2'WRITE 'C' ON VOC,'TESTITEM3'EXECUTE "BSELECT VOC 'TESTITEM1''TESTITEM2''TESTITEM3' A1"LOOP WHILE READNEXT ID DOCRT OCONV(ID,'MX0C')REPEATThe four records returned are 41 ('A'), then no records returned for the empty values, then 42 ('B') from TESTITEM1, 00from TESTITEM2, and 43 ('C') from TESTITEM3.See Also• COUNT command• LIST command• LIST.ITEM command• SELECT command• SORT command4 Caché MultiValue Query Language (CMQL) Reference

More magazines by this user
Similar magazines