Sidebar

Getting error as we are trying to get the updated data in a table in Database

0 votes
369 views
asked May 18, 2021 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.
answered May 18, 2021 by jon-t-7005 (7,590 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');
answered May 18, 2021 by gary-t-8719 (14,860 points)
commented May 20, 2021 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
commented May 21, 2021 by gary-t-8719 (14,860 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.
commented May 23, 2021 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
...