An Example of Debugging NOTE_ORD_VIEW PSQL Expression Evaluation Error

An Example of Debugging NOTE_ORD_VIEW PSQL Expression Evaluation Error

Q - When I try to access the NOTE_ORD_VIEW in the PSQL control center, I get this error: "[LNA][Pervasive][ODBC Engine Interface]Expression evaluation error."  See sample screen below.


It does not display any results, but it does display the create statement for the view.

A - "Expression Evaluation Error" typically points to a data issue. After spending some time investigating your data, we found that the cause of the error is due to some garbage records in the NOTE.BTR table. To find these garbage records, you can go to Global Setup -> Utilities -> Print or Purge Orphan Amigos, then choose the following parameters: 

    Type of Amigo to Purge N
    Master File CPORDHDR
    Purge? N 

Then you will get a list of orphan CPORDHDR notes as in the screen below:


The three records that caused the problem are the ones that have the reference number = "00test." We presume these three records are left over from your FedEx person when he/she did the integration test with Elliott.

Why would these three records would be an issue? The SQL statement we used to create this view is as follows:
    Create View NOTE_ORD_VIEW As
    Select NOTES.*, CPORDHDR.* From NOTES, CPORDHDR
    Where NOTE_FILE_NAME = 'CPORDHDR'
    And ORDER_NO = CONVERT(SUBSTRING(NOTE_FILE_REF_NO,1,6),SQL_NUMERIC);

We need to convert the NOTE's reference field to a numeric format in order to join with CPORDHDR's ORDER_NO. Otherwise, you will get an error on data type mismatch. As the PSQL engine tries to convert these records' reference fields from a string value to numeric, it can't do it because "00test" is not numeric, and hence you get the referenced error.

You can resolve this problem by running the "Print or Purge Orphan Amigos" utility above, and answer "Y" to "Purge?"  After that, you will be able to run this view without the error. 




    • Related Articles

    • Btrieve Error Codes 001 - 199

      MicroKernel (Btrieve) Database Engine Status Codes This section describes status codes that the MicroKernel returns. All status codes are provided in 3-digit formats since the search on this website cannot search 1 or 2-digit words correctly. That is ...
    • Btrieve Error Codes 3100 - 3199

      Network Services Layer Status Codes The following status codes originate from the Pervasive Network Services Layer (PNSL). 3103: Server name not found by Pervasive Network Services Layer The search for a target server name was unable to resolve an ...
    • Configure PSQL Server Memory Usage

      Version: Any Release Date: 12/17/2021 Q - Can you tell us why PSQL process is taking up so much memory? Is there anything we can do? See sample screen below: A - PSQL server by default can take up about 60ish% of the server memory. This is ...
    • An Example of DDF Files in DATA Folder Causing Report Desk or Power Search Issue

      Release Date: 03/14/2025 Version: 8.6 & Up Q - When I tried to print a UDR report (i.e., AP Distribution History Report) from company # 98, I got the following error message: Cannot find definition of table APDSTHST in DDFs. You probably are using ...
    • Btrieve Error Codes 3000 - 3099

      MicroKernel Router Status Codes This section lists the status codes you can receive from the MicroKernel router, which receives requests from the Btrieve requesters and routes them to the correct version of the MicroKernel. 3000: The MicroKernel ...