Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : SIMPLESELECT

SIMPLESELECT
Processes a selection string into a format that can be used by the FORALLA tool. (C)
Invocation
CALL SIMPLESELECT(selection)
 
Usage Notes
The syntax for selection is <field name><relational operator><expression>. For valid expressions, refer to the TIBCO Object Service Broker Programming in Rules manual.
The local variable SEL_STR must be declared by the calling rule. It contains the processed selection string in a format suitable for use in FORALLA. SEL_STR must be reinitialized to the empty string between calls of SIMPLESELECT.

Exceptions
 
Example
The following example:
1.
Takes an Author supplied by the user and calls SIMPLESELECT to build a selection string for TABLES WHERE AUTHOR = value.
2.
3.

 
QUERY_AUTHOR(AUTH);
_LOCAL SEL_STR, IN_TBL, MSG, COUNT;
_ ---------------------------------------------------------------------------
_ -------------------------------------------------------------+-------------
_ IN_TBL = ’TABLES’; | 1
_ CALL SIMPLESELECT(’AUTHOR = ’ || QUOTE(AUTH)); | 2
_ CALL FORALLA(IN_TBL, ’’, SEL_STR, ’’); | 3
_ UNTIL TABLEEND: | 4
_ COUNT = COUNT + 1; |
_ CALL MSGLOG(TABLES.NAME); |
_ CALL FORALLB(IN_TBL); |
_ END; |
_ CALL FORALLE(IN_TBL); | 5
_ CALL ENDMSG(COUNT || ’ TABLES FOUND WITH AUTHOR ’ || AUTH) | 6
_ ; |
_ ---------------------------------------------------------------------------
_ ON SYNTAX_ERROR:
_ CALL ENDMSG(MSG);
_ ON TABLEEND:
_ CALL FORALLE(IN_TBL);
_ CALL ENDMSG(’NO TABLES FOUND WITH AUTHOR ’ || AUTH);

 
 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved