Using SQL Code activity

Avatar

Avatar

marcinkacz

Avatar

marcinkacz

marcinkacz

17-07-2020

Hi,
How I can use the output of SQL Code activity in a following JS activity?

 

sqlCodeActivityWkf.PNG

I'm typing below code in SQL activity:
SELECT max(iId) FROM CusTestDataSchema

 

What should I type in JS to receive SQL's output? vars.output doesn't work here.

 

Thanks,

Marcin

View Entire Topic

Avatar

Avatar

wodnicki

MVP

Avatar

wodnicki

MVP

wodnicki
MVP

21-07-2020

Hi,

 

Use queryDef where possible, otherwise use a js activity with sqlGet* or the DBEngine class.

 

E.g.:

var cnx = application.getConnection();
try {
  var res = cnx.query('select sysdate from dual');
  for each (var row in res) logInfo(row[0]);
}
finally {
  cnx.dispose();
}

 

Thanks,

-Jon