1.2k questions

1.4k answers

361 comments

339 users

Categories

Sidebar
0 votes
626 views
by manoj-m-7223 (210 points)
Hello Team

Good Day!

We are trying to find if any updated data happened on a table by comparing LAST_RUN and system date updates by using stored procedure but getting stuck here. Please help to correct me on this if any changes required.

Thank you.

Through Sceduled scripts in Source we are testing below code but getting error message.

var channelcache = channelcache.getValue('LAST_RUN');
var DateTime = qie.doQuery('testsqldb','select DateTime from Patient');
function updatedDatafind(channelcache,DateTime)
{
var fchannelcache=channelcache;
var fDateTime=DateTime;
if (DateTime > channelcache)
{
var updateddata = qie.doQuery('testsqldb','select distinct * from Patient');
return updateddata;
}
else
{ return false;
}
}
qie.debug(updatedDatafind(channelcache,DateTime));
 

And error message getting as below

Error running scheduled script: 'task':
[line: 18] EcmaError: TypeError: Cannot call method "getValue" of undefined

2 Answers

0 votes
The above error references line 18, but there are only 16 lines of code.  Please contact support@qvera.com with the entire code in the scheduled task so we can assist with this issue.
by jon-t-7005 (8.2k points)
0 votes
Looks like the reference to channelCache is mistyped on line 1. It should be channelCache.getValue...

var channelcache = channelCache.getValue('LAST_RUN');
by gary-t-8719 (15.1k points)
by manoj-m-7223 (210 points)
hi Team,
Thanks for quick response. I modified script and ran it again but getting error as defined this in first line
var channelcache = channelCache.getValue('LAST_RUN');


Error running scheduled script: 'task':
[line: 1] EcmaError: TypeError: Cannot call method "getValue" of undefined
by gary-t-8719 (15.1k points)
I would suggest that perhaps the value is not getting set. In your previous code are you setting the value with channelCache.setValue("LAST_RUN", source.getNode("value"));

If this does not work and you would like to call into support we can get on your system and debug the code with you.
by manoj-m-7223 (210 points)
HI Team,
Thanks for your help on this. Please be informed that we have used Stored procedure and its working fine.
As of now we are good.

Regards,
Manoj M
...