Previous Topic: List/Query MethodsNext Topic: doQuery


doSelect

The following parameters apply to the doSelect method:

Parameter

Type

Description

SID

Integer

Identifies the session retrieved from logging in.

objectType

String

Identifies the object type (factory) to query.

whereClause

String

(Optional) Identifies the where clause for the query.

maxRows

Integer

Indicates the maximum number of rows to return. Specify -1 to return all rows.

Note: Regardless of the integer specified, CA SDM will return a maximum of 250 rows per call.

attributes

String[]

Identifies the attribute list for which to fetch values. Dotted-attributes are permitted. If this field is blank, all value-based attributes are returned. These attributes cannot be defined as LOCAL in the majic definition file. LOCAL attributes are temporal; they have no database storage.

Description

Performs an SQL-like select on a specified object table. Supply one or more attributes you want fetched from the objects that match the supplied where clause.

Returns

A sequence of <UDSObject> elements. The following format applies:

<UDSObjectList>
<UDSObject>
 <Handle>
 <Attributes>
<AttributeNameA>
<AttributeValueA0>
<AttributeValueA1>
<AttributeNameB>
<AttributeValueB0>
…

XML Element

Type

Description

<UDSObject>

N/A

Specifies the standard UDSObject element containing the handle and requested attribute values.

<UDSObjectList>

Sequence

Contains a <Handle> element and an <Attributes> sequence.

For example, if the method used is the following:

String[] myArray = [“last_name”, “first_name”]
doSelect(mySID, “cnt”, “last_name LIKE ‘J%’”, 2, myArray)

The return could be the following:

<UDSObjectList>
<UDSObject>
<Handle>cnt:555A043EDDB36D4F97524F2496B35E75</Handle>
<Attributes>
<AttributeName>last_name</AttributeName>
<AttributeValue>Johnson</AttributeValue>
<AttributeName>first_name</AttributeName>
<AttributeValue>Carol</AttributeValue>
</Attributes>
</UDSObject>
<UDSObject>
<Handle>cnt:555A043EDDB36D4F97524F2496B35E76</Handle>
<Attributes>
<AttributeName>last_name</AttributeName>
<AttributeValue>Jones</AttributeValue>
<AttributeName>first_name</AttributeName>
<AttributeValue>Ron</AttributeValue>
</Attributes>
</UDSObject>
</UDSObjectList>