Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# queryUsingPrimaryKeys()

Use the `queryUsingPrimaryKeys()` function to query the database using primary keys.

Syntax

    Concept[] queryUsingPrimaryKeys(String conceptURI, SimpleEvent pKeyEvent, boolean queryChildren)

Here `conceptURI` is the URI of the concept type, `pKeyEvent` is a simple event that contains primary key values to be used. Properties must match primary key properties in the result concept. If `queryChildren boolean` is set to true, concept properties are recursively queried. The function returns an array of result concepts.

## Example

    Database.setCurrentConnection("/SharedResources/ibmi");
    Database.beginTransaction();
      EventsNew.ADBTEST1.TABLE_REFRING event = Event.createEvent("xslt://{{/EventsNew/ADBTEST1/TABLE_REFRING}}<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xsl:stylesheet xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" version=\"1.0\" exclude-result-prefixes=\"xsl xsd\">\n    <xsl:output method=\"xml\"/>\n    <xsl:template match=\"/\">\n        <createEvent>\n            <event>\n                <ID2>\n                    <xsl:value-of select=\"10\"/>\n                </ID2>\n            </event>\n        </createEvent>\n    </xsl:template>\n</xsl:stylesheet>");
    Concepts.ADBTEST1.TABLE_REFRING [] parent = Database.queryUsingPrimaryKeys("/Concepts/ADBTEST1/TABLE_REFRING",event,true);
    for(int k = 0 ; k < parent@length ; k++ ) {
       System.debugOut(Instance.serializeUsingDefaults(parent[k]));
    }
    Database.unsetConnection();

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.