Skip to content
Snippets Groups Projects
code.js 476 B
import("system.db");
import("system.result");
import("Sql_lib");

var relId, country, cond;
cond = new SqlCondition();

cond.andPrepareVars("RELATION.RELATIONID", "$param.RelId_param");
//TODO: this should happen by 1:1 links instead of manually requesting the data by a select
country = db.cell(cond.buildSelect("select ADDRESS.COUNTRY from ADDRESS "
            + "join RELATION on RELATION.ADDRESS_ID = ADDRESS.ADDRESSID "));
if (country != "") 
    result.string(country);