Kirix Support Forums

Check to see if records exists

Please post any help questions, requests or other feedback here.

Check to see if records exists

Postby abenitez77 on Mon Mar 26, 2012 1:22 pm

I am checking to see if a record exists in a table, if not I will add a record with values. I am doing this check below to see if it exists and When it does not exist, I get the error msg below:

error msg:
Script Runtime Error: Term 'rstChk.hasNext' does not evaluate to a function.

Code:
var rstChk = db.execute("select ProjectsID,ProjectName,ClientName,AuditYear,ToolName,SQLServer,SQLDBName,SQLTableName FROM tblv_ProjectDetail WHERE ClientName = '" + MyClient + "' AND AuditYear = '" + MyAuditYear + "' AND ProjectName = '" + ProjectName + "' AND ToolName = 'STRATA' and SQLServer = '" + ServerName.getText() + "' AND SQLDBName = '" + DataBaseName.getText() + "' AND SQLTableName = '" + TableName.getText() + "'");

if (rstChk.hasNext())
{
alert("Table ' " + TableName.getText() + "' in " + ServerName.getText() + "/" + DataBaseName.getText() + " already exists in the Project");
return;
}
abenitez77
Registered User
 
Posts: 143
Joined: Fri Jan 21, 2011 12:42 pm

Return to Strata Help & Feedback