How to update your Adobe Campaign database without using queryDef?

adobe-campaign-query-def-7

The queryDef method is one of the most commonly used methods in Adobe Campaign. It allows us to execute SQL queries against the database.

Now, suppose you are given an Adobe Campaign implementation. One of the instructions in the project requirement document is that you cannot use queryDef method to update your underlying campaign database.

This article provides techniques that let’s you modify the Adobe Campaign database without using queryDef method.

The 4 methods that I have implemented in my previous projects are given below.

Using sqlExec()

/*
Author: Prajwal Shetty
Version: 2.6
Function: Update using sqlExec and EscapeData 
NL.SQL.escape(data) to escape a parameter that can be used in an SQL query. This function automatically places the expression between simple quotation marks. This function is defined in the NL.SQL package. 
*/

var strEmail = 'prajwalshetty202@gmail.com'
var strSql = "UPDATE NmsRecipient SET sEmail=" +NL.SQL.escape(strEmail)+ " WHERE iRecipientId = 187696";

var dataUP = Using delivery.load()(strSql)

logInfo("UPDATE NmsRecipientt ->" + dataUP)
adobe-campaign-query-def-3

Using recipient.load()

var recipient = nms.recipient.load("122553")
recipient.firstName = "Prajwal"
recipient.save()
adobe-campaign-query-def-1

Using recipient.create() + XML

var recipient = nms.recipient.create(
  <recipient 
    email = "prajwalshetty202@gmail.com" 
    lastName = "Shetty" 
    firstName = "Prajwal"/>)

recipient.save()
adobe-campaign-query-def-2

Using recipient.create() + JavaScript

var recipient = nms.recipient.create()
recipient.email = "prajwalshetty202@gmail.com" 
recipient.lastName = "Shetty" 
recipient.firstName = "Prajwal"
recipient.save()
adobe-campaign-query-def-4

Hope this helps.

error: Content is protected !!