IBM Support

Content Manager OnDemand defined macros in SQL

Question & Answer


Question

How can I write SQL statements to include current object values like Application Group Name or user ID?

Cause

Content Manager OnDemand provides macros that can be used in SQL statements (including the query restriction) to allow the macro to be substituted by the appropriate value.

Answer

The new macros are:
 

Name Description
$ODUSERID The user ID that is logged on to Content Manager OnDemand
$ODALIAS The user alias defined for the user ID that is logged on to Content Manager OnDemand
$ODAGNAME The application group name
$ODAGID The application group internal identifier

 


The substitution does not include any necessary quotes for the macro, therefore you must ensure that you properly quote the macro (if required).

For example:

ODTBL.ag_field in (SELECT <column1> FROM <customer_table> where userid = '$ODUSERID')

if the user logs onto Content Manager OnDemand as USER1, the SQL becomes:

ODTBL.account in (SELECT value FROM AAA1 where userid = 'USER1')

Example for System i:

ODTBL.ACCTNO IN ( SELECT ACCOUNT FROM QGPL.SECTEST WHERE USERNAME = '$ODUSERID')

 

[{"Product":{"code":"SSEPCD","label":"Content Manager OnDemand for Multiplatforms"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Server","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF025","label":"Platform Independent"},{"code":"PF033","label":"Windows"}],"Version":"9.0","Edition":"All Editions","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 November 2018

UID

swg21611495