Skip to main content
Level 2
Mar 26, 2018 5:54 PM UTC

xtk session write temp table

Update not working when adding data to temp table and Js is not throwing any error but it is updating any tow. Any suggestions

var schemaName = vars.targetSchema.substring(vars.targetSchema.indexOf(":") + 1);

logInfo("Schem name = " +schemaName);

var formatString = function(str) {
   
       blah blah blah..........................
   

    return str;
}

var query = xtk.queryDef.create(
         <queryDef schema={vars.targetSchema} operation="select">
          <select>
            <node expr="@Label"/>
            <node expr="@FullName"/>
            <node expr="@lineNum"/>
          </select>
         </queryDef>);
  
var resultSet = query.ExecuteQuery();
for each (var row in resultSet.enrich5)
{
//instance.vars.Label=formatString(row.@Label);
//logInfo(formatString(resultSet.enrich5.@Label));
xtk.session.Write(<query _operation="update" _key="@lineNum" Label= {formatString(row.@Label)}  xtkschema="temp:enrich5"/>);

}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

5 replies

Level 2
Mar 26, 2018 6:22 PM UTC

typo it is not updating any row,

Translate
Level 2
Mar 26, 2018 11:00 PM UTC

Hi

Here is working code that I have; maybe this will help:

     xtk.session.Write(&lt;query xtkschema="temp:query" _key="@id" id={id} email={email} status={status} status_description={status_description} date={date} /&gt;)

Let me know if that works.

Dan

Translate
Level 2
Mar 27, 2018 2:44 AM UTC

It's not working. Can you please let me why there is no reference of querydef variable or operation=update in the above code.

Translate
Kapil_Sharma_
Adobe Employee
Adobe Employee
Mar 27, 2018 7:26 AM UTC

Hi Srikanth,

Instead of using the xtk.Session.Write, you can use the below statement to update the TempSchema :

sqlExec("update "+vars.tableName +" set abc='0' where bcd="+123);

Let me know if this works.

Regards,

Kapil

Translate
Level 4
Jun 27, 2020 12:52 AM UTC

@kapil_sharma_  is this for ACS for ACC?

@srikanthr646926 @daniell35335226 

 

I am looking for help on ACS

 

Translate