User's Manual

198 Appendix D. PDL Syntax
BigDecimal articleID;
options {
WRAP_QUERIES = false;
}
do {
select max(article_id) from articles
} map {
articleID = articles.article_id;
}
}
query UsersGroups {
String firstName;
String lastName;
String groupName;
do{
select *
from users, groups, membership
where users.user_id = membership.member_id
and membership.group_id = groups.group_id
} map {
firstName=users.first_name;
lastName=users.last_name;
groupName=groups.group_name;
}
}
query retrieveArticlesBasedOnAuthor {
BigDecimal authorID;
do {
select article_id
from authors, author_article_map
where authors.author_id = author_article_map.author_id
and lower(last_name) like :lastName || ’%’
} map {
authorID = authors.author_id;
}
}
query retrieveSelectedArticles {
BigDecimal articleID;
String title;
do {
select article_id, title from articles
} map {
articleID = articles.article_id;
title = articles.title;
}
}
query CategoryFamily {
Integer level;
BigDecimal categoryID;
String name;
String description;
Boolean isEnabled;
do {
select l, c.category_id, c.name, c.description, c.enabled_p
from (select level l, related_category_id
from (select related_category_id, category_id
from cat_category_category_map