Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
SELECT * FROM MXP.MXP_MONITOR WHERE ID = ?

Wiki Markup
The question mark {{?}} is a placeholder for the value within the prepared statement. The value will be inserted by the JDBC driver when the prepared statement is being executed. MIB Explorer sets the value for the statement by replacing the {{@VALUE\[ID\]}} reference with the {{?}} in the statement and setting the statements first parameter value to the value of ID (for example 2).

Tag

Description

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="68f2f5da5d2e4aa6-272d9700-42974ce7-811aacb0-4f1435e2672d840095a104ef"><ac:plain-text-body><![CDATA[

@VALUE[<param>]

Replace the tag by
]]></ac:plain-text-body></ac:structured-macro>
Example:? in the statement and set the value of the prepared parameter to the value of the MIB Explorer variable with name <param>.

Code Block
SELECT ID FROM MXP.MXP_MONITOR WHERE NAME = @VALUE\[NAME\]

will be rendered to

Code Block
SELECT ID FROM MXP.MXP_MONITOR WHERE NAME = ?

where ? is assigned with the value of the MIB Explorer variable NAME when the statement is being executed.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ec139b05cbb4a810-4e6f0a33-44c94b31-b45cad2e-a611b62dbb5017aca3f17456"><ac:plain-text-body><![CDATA[

@INSERT[<param>]

Replace the tag by the value of MIB Explorer variable with name <param>
]]></ac:plain-text-body></ac:structured-macro>
Example:

Code Block
SELECT ID FROM MXP.MXP_MONITOR WHERE NAME = '@INSERT[NAME]'

will be rendered to

Code Block
SELECT ID FROM MXP.MXP_MONITOR WHERE NAME = 'MyMonitor'

if the variable NAME has the string value MyMonitor.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="358e4776a705dfd0-32f623d4-456c4edb-beaeab04-a58c18d368b8985215850e10"><ac:plain-text-body><![CDATA[

@USE[<statementName>]

Replace the tag with the rendered content of the statement with name <statementName> of the same context.
]]></ac:plain-text-body></ac:structured-macro>
Example:

Code Block
<statement name="select.id"> \\
SELECT ID \\
</statement> \\
<statement name="select.monitor.id.by.name"> \\
@USE[select.id] FROM MXP.MXP_MONITOR WHERE NAME = @VALUE[NAME] \\
</statement>

will be rendered to

Code Block
SELECT ID FROM MXP.MXP_MONITOR WHERE NAME = 'MyMonitor'

if the variable NAME has the string value MyMonitor.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="17c29c53d2ca41b8-3c5dcc50-4b784f16-8873bb6f-f015c863d1a763cfd0f6fc54"><ac:plain-text-body><![CDATA[

@IF[<stmt>,<test>,<value>,..]

Replace the tag with the statement with name <stmt> if the condition <test> is true for the MIB Explorer variable references <value1> through <valueN>.
]]></ac:plain-text-body></ac:structured-macro>
Example:

Code Block
<statement name="monitor.dataset.by.id"> \\
SELECT * FROM MXP.MXP_MONITORDATASET WHERE MONITOR_ID = @VALUE\[ID\] \\
@IF\[and.nameOrDataType,not-null,NAME,DATATYPE\] \\
ORDER BY MONITOR_ID,DATATYPE \\
</statement> \\
<statement name="and.nameOrDataType"> \\
AND (NAME = @VALUE\[NAME\] OR DATATYPE = @VALUE\[DATATYPE\]) \\
</statement>

will be rendered to

Code Block
SELECT * FROM MXP.MXP_MONITORDATASET WHERE MONITOR_ID = ? AND (NAME = ? OR DATATYPE = ?) ORDER BY MONITOR_ID,DATATYPE

if the MIB Explorer variables NAME and DATATYPE are not null.

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="80defe92f8cabaa1-2651718c-45034377-b34686ae-163890d5ad2a96b5a6c46547"><ac:plain-text-body><![CDATA[

@IFELSE[<stmtTrue>, <stmtFalse>,<test>, <value>..]

Replace the tag with the statement with name <stmtTrue> if the condition <test> is true for the MIB Explorer variable references <value1> through <valueN>. Otherwise, replace the tag with the statement with name <stmtFalse>.
]]></ac:plain-text-body></ac:structured-macro>
Example:

Code Block
<statement name="monitor.dataset.by.id"> \\
SELECT * FROM MXP.MXP_MONITORDATASET WHERE MONITOR_ID = @VALUE\[ID\] \\
@IFELSE\[dataTypeNotNull,dataTypeNull,not-null,DATATYPE\] \\
</statement> \\
<statement name="dataTypeNull"> \\
AND DATATYPE IS NULL \\
</statement> \\
<statement name="dataTypeNotNull"> \\
AND DATATYPE IS NOT NULL \\
</statement>

will be rendered to

Code Block
SELECT * FROM MXP.MXP_MONITORDATASET WHERE MONITOR_ID = ? AND DATATYPE IS NOT NULL

if the MIB Explorer variables DATATYPE is not null. Otherwise, the statement would be rendered as:

Code Block
SELECT * FROM MXP.MXP_MONITORDATASET WHERE MONITOR_ID = ? AND DATATYPE IS NULL


...