This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Relativity - Error when querying a table

Hello, I created a table using Relativty and one column seems to break my queries. 

In Relativity's Query Builder, depending of the data I access, it returns a certain number of rows before it tthrows an error, like Table MyTable: Rows Processed = 4, Error Count =1.

Querying with another tool (QTODBC), I get an intermittent error, which means that sometimes, it works, sometimes I get the following error:

<eb1>Numeric item contains nonnumeric characters (column MyColumn)

State: S1000; Native: -4084; Origin: [Micro Focus][Relativity][CRDM]</eb1>

The column is defined as a Smallint in Relativity, and as a PIC 9 in Cobol.

Side note: The previous field in the table is a COMP and may have some invalid data.

Is there a workaround to that error?

Thank you!

Tags:

  • 0

    Hi - I donot know if you are still facing problem but you can define filter to remove invalid rows. Or convert column type as char.

  • Verified Answer

    +1

    Sorry I missed this when it first appeared.


    Go to the File definition for this file.  (I am using the Legacy Designer.) 

    Using the f(x) button add the IsNumeric function to the file definition, and then add the numeric Pic 9 data-item (named MyItem for this discussion) to the function as its argument.  Save changes.

    Select the IsNumeric function item you have just defined and add an 88 condition-item on that, for example named MyItem-is-bad with a value of 0 (zero).  (IsNumeric returns 1 if numeric, 0 if not.)  Save changes.

    Go to the NullValue field for the MyItem data-item, and select the MyItem-is-bad.  Save changes.

    Finally go to the Table definition.  Expand to detail mode.  Select the column MyColumn, and click the Is Nullable check box.  Save changes.

    Now invalid numeric data in that particular COBOL data item will produce a SQL NULL.  


    Further to Swapnil's suggestion, if you simply want to throw away the entire row if there is non-numeric data in that item, use the 88 condition-item created above to add a filter to the table definition (AND NOT MyItem-is-bad).


    There is also a setting on the data source that can tell the Relativity SQL engine to produce NULL on all invalid numerics that do not appear in record keys.  In my opinion it is better to use my first suggestion to address individual issues of non-numeric data, rather than use the data source setting.  But if you have a lot of bad data in many fields, then this setting may be useful.