on 09-30-2014 9:50 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.