cancel
Showing results for 
Search instead for 
Did you mean: 

Error coming for CE_CALC Plan operator

pavneet_rana
Active Participant
0 Kudos

Hi to all,

I am using CE_CALC Operator, code is below, but i am getting error.

/********* Begin Procedure Script ************/

BEGIN

TV = CE_COLUMN_TABLE("YTABLE");

TV1 = CE_PROJECTION(:TV, [ "PART", "SITE1"  ,

       

        CE_CALC( ' IF ( "PART" = "A","X","Y" ) '  ,   NVARCHAR(2)) AS  "TXT" ] );

     

END;

/********* End Procedure Script ************/

Error: Error creating procedure;Attribute not found in column table: A: line 9 col 9 (at pos 337) at ptime/query/checker/proc_check_cefunc.cc:707

But "PART" Field have entry "A" in table "YTABLE".

please let met me know where is error ?.

Regards

Pavneet Rana

Accepted Solutions (1)

Accepted Solutions (1)

lbreddemann
Active Contributor
0 Kudos

Hi Pavneet,

the mistake here is due to the user-unfriendly combination of syntax-highlighting (not existent) and the unfortunate syntax itself.

You *want* to set column "TXT" based on what's in column "PART".

And here's the problem. If you compare to "A" (double quotes") you refer to column A.

But you *want* to compare to the value 'A' (single quotes).

Likewise with the output values - single quotes refer to the literals, double quotes to column names.

- Lars

pavneet_rana
Active Participant
0 Kudos

Thanks for reply,

Yes i corrected the code, its working fine.

/********* Begin Procedure Script ************/

BEGIN

TV = CE_COLUMN_TABLE("YTABLE");

TV1 = CE_PROJECTION(:TV, [ "PART", "SITE1"  ,

      

        CE_CALC( ' IF ( "PART" = ' 'A' ',' 'X' ',' 'Y' ' ) '  ,   NVARCHAR(2)) AS  "TXT" ] );

    

END;

/********* End Procedure Script ************/



Regards

Pavneet Rana

Answers (0)