Hi All,
Please add your suggestions here:
how to print log info of querydef from linked table:
============
logInfo("1st querydef " +CONSUMER.sConsumerLink.@SRCC_CON_ID);
==================================
my example:
<select>
<node expr="[sConsumerLink/@SRCC_CON_ID]" alias="@SRCC_CON_ID"/>
var ndQueryConsumer = queryBDerivedConsumer.ExecuteQuery();
if ( ndQueryConsumer.BDERIVEDCONSUMER.length() > 0 )
{
for each ( var CONSUMER in ndQueryConsumer.BDERIVEDCONSUMER ) {
logInfo("1st querydef " +CONSUMER.sConsumerLink.@SRCC_CON_ID);
==========
note : i tried this also but no luck:
logInfo("1st querydef " +CONSUMER.@SRCC_CON_ID);
==========
Views
Replies
Total Likes
post the whole queryDef code.
var queryOptinBDerivedConsumer = xtk.queryDef.create(
1st querydef
var queryOptinBDerivedConsumer = xtk.queryDef.create(
<queryDef distinct="true" schema="elc:BDERIVEDCONSUMER" operation="select">
<select>
<node expr="@DCNS_ID"/>
<node expr="[sConsumer/@SRCC_CON_ID]" alias="@SRCC_CON_ID"/>
//addin fields
<node expr="[BEMEDIA-DCNS_ID/@EMDA_ADDRESS]" alias="@EMDA_ADDRESS"/>
</select>
<where>
<condition boolOperator="AND" expr="@DCNS_BESTRECORD_TOCH_ID <> 0"/>
</where>
<orderBy>
<node expr="@DCNS_ID" sort="1"/>
</orderBy>
. </queryDef>
);
var ndQueryOptinBDerivedConsumer = queryOptinBDerivedConsumer.ExecuteQuery();
if ( ndQueryOptinBDerivedConsumer.BDERIVEDCONSUMER.length() > 0 )
{
for each ( var CONSUMER in ndQueryOptinBDerivedConsumer.BDERIVEDCONSUMER ) {
logInfo("1st querydef CONID " +CONSUMER.@SRCC_CON_ID);
gETTINg OUT PUT AS :
output:1st querydef CONID
BUT NEED VALUES FROM FIELDS
PLEASE HELP
Post the whole code, look at the below links for reference.
var myXML =
<queryDef schema="nms:recipient" operation="select">
<select>
<node expr="@firstName"/>
<node expr="@lastName"/>
</select>
</queryDef>
var query = xtk.queryDef.create(myXML)
var res = query.ExecuteQuery()
for each (var rcp in res.recipient)
logInfo(rcp.@firstName + " " + rcp.@lastName)
https://blog.floriancourgey.com/2018/08/use-querydef-the-database-toolkit-in-adobe-campaign
https://experienceleague.adobe.com/developer/campaign-api/api/sm-queryDef-ExecuteQuery.html
https://technowide.net/2017/05/19/iterating-custom-functions-record/
Just do the following
var xml = <queryDef distinct="true" schema="elc:BDERIVEDCONSUMER" operation="select">
<select>
<node expr="@DCNS_ID"/>
<node expr="[sConsumer/@SRCC_CON_ID]" alias="@SRCC_CON_ID"/>
<node expr="[BEMEDIA-DCNS_ID/@EMDA_ADDRESS]" alias="@EMDA_ADDRESS"/>
</select>
<where>
<condition expr="@DCNS_BESTRECORD_TOCH_ID <> 0"/>
</where>
<orderBy>
<node expr="@DCNS_ID" sort="1"/>
</orderBy>
</queryDef>
var queryOBDC = xtk.queryDef.create(xml)
var resOBDC = queryOBDC.ExecuteQuery()
for each (var c in resOBDC) {
logInfo(c.@DCNS_ID);
logInfo(c.@SRCC_CON_ID);
logInfo(c.@EMDA_ADDRESS):
}
I WANT TO DO LOgINFO FOR both these columns ,,can u please help
<node expr="[sConsumer/@SRCC_CON_ID]" alias="@SRCC_CON_ID"/> <node expr="[BEMEDIA-DCNS_ID/@EMDA_ADDRESS]" alias="@EMDA_ADDRESS"/>
<node expr="[sConsumer/@SRCC_CON_ID]" alias="@SRCC_CON_ID"/> <node expr="[BEMEDIA-DCNS_ID/@EMDA_ADDRESS]" alias="@EMDA_ADDRESS"/>
how to do loginfO for these 2columns that are linked to these tables
Doesnt the following work?
logInfo(c.@SRCC_CON_ID); logInfo(c.@EMDA_ADDRESS):
it didnt work
tried this also
nothin eetin printed--I am reallys tuck in this part,,cn u please help
Check the link between your schema and the other schema's, can you post an ERD diagram with cardinalities, also from the below; are you sure the link NAME is [sConsumer/.....], if you click on your schema -->configure list... are you able to see the fields from the other schema? post a screenshot
<node expr="[sConsumer/@SRCC_CON_ID]" alias="@SRCC_CON_ID"/>
<node expr="[BEMEDIA-DCNS_ID/@EMDA_ADDRESS]" alias="@EMDA_ADDRESS"/>