Search these areas:
Help
Support Forums
Product Info



-Introduction
-DataWeb: What's New
-Creating an Application
-The DataWeb Designer
-Application Management
-Data Tables
-Data Tables
-Views
-Templates
-Components
-Data Analysis
-Members
-Security
-Importing
-Exporting
-FTP
-JavaScript
-Object Model
-Full-Text Search
-Domain and Email Hosting
-HotBlock Modules
-Account Management
-Glossary
-New Responsive UI Module





DataWeb Help
Support Forums
Tutorial
Script Library
Knowledge Base

Home > Support

Support Forum



Problem with Resultset syntax
steveh asked:
I am trying to get a resultset of all of all records where a particular field is NULL.  I keep getting the error below:

Unhandled Exception: Error (Table.Errors.Exception) occurred in '/wsTree/Scripts/MenuString.ws' at line 167 -- An exception occurred while trying to select records from table 'taxa'. 
This exception may be thrown if the table cannot be found
or if the user does not have the necessary permissions.

Additional Information: [SQL Error]Syntax error converting the varchar value 'undefined' to a column of data type int.

My resultset code is the following:

    var rs = Resultset(tbl, fldArr[4], fldArr[6] + " is null", fldArr[3]);

The strange thing is, this code works when applied to some tables, but fails (gives the above error) on others.
Any suggestions?
thanks
 
  dougl responded:
  IS NULL should work.

Try logging the values of your variables just before the rs call.

script.log( "fldArr[4]", fldArr[4] );
script.log( "fldArr[6]", fldArr[6] );
script.log( "fldArr[3]", fldArr[3] );

I would guess that one of these array elements is undefined, and not the name of a field as you expect.
 
  steveh responded:
  All three (fldArr[4], fldArr[6], and fldArr[3]) have values, and they are all really the names of fields in the data table (tbl)....  
  dougl responded:
  Are you sure it's the filter? Try a process of elimination:

First check this:
var rs = Resultset(tbl, fldArr[4], fldArr[6] + " is null");

then:
var rs = Resultset(tbl, "rowid", fldArr[6] + " is null", fldArr[3]);

then:
var rs = Resultset(tbl, fldArr[4], "rowid is null", fldArr[3]);
 
  steveh responded:
  I am getting exactly the same error for all three of the above tests...

I have also checked the data table, and all three fields are integer fields...
 
  dougl responded:
  Can you post the results of your script.log() tests?  
  steveh responded:
  Thanks all...
It turned out to be problem with the content of the data table itself.
Got it fixed.
 
  steveh responded:
  DataWeb considers this issue closed.
If you have additional questions or comments about this issue, please open it again.
If you have questions about a different topic please open a new support question.

Thanks,
DataWeb Support
 
  Please Log On
or create your own DataWeb Account.
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
DataWeb, 720 North 10th Street, A #145, Renton, Washington 98057 *425-583-5970* Fax 484-770-4706* Email Us