Created
September 4, 2012 23:53
-
-
Save mhulse/3628229 to your computer and use it in GitHub Desktop.
Caché DTI ContentPublisher: Tested in 7.6, 7.7.X: Get category/subcategory name...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<csp:comment>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</csp:comment> | |
<csp:comment> | |
/// @param: Category/subcategory id. Required. | |
/// @return: Category/subcategory name. | |
</csp:comment> | |
<script language="cache" method="catName" arguments='id:%String=""' returntype="%String" procedureblock="1"> | |
//---------------------------------- | |
// Initialize: | |
//---------------------------------- | |
set return = "" | |
if ($length(id)) { | |
//---------------------------------- | |
// Subcategory? | |
//---------------------------------- | |
&sql(select subCategoryName into :return from dbo.SubCategory SC where sc.subCategoryId = :id) | |
if (( ' $length(return)) || (return = "-") || ($zconvert(return, "U") = "NONE")) { | |
//---------------------------------- | |
// Category? | |
//---------------------------------- | |
&sql(select categoryName into :return from dbo.Category C where C.categoryId = :id) | |
} | |
} | |
//---------------------------------- | |
// Return: | |
//---------------------------------- | |
quit return | |
</script> | |
<csp:comment>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</csp:comment> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment