All Forums Database
samit_9999 37 posts Joined 03/06
31 Mar 2006
Error Using an Alias Name - Is CM a reserved keyword in TeraData

Hi,When i run the following query , i get an error as 3706:Syntax Error: something expected between ',' and the 'cm' keywordSELECT TBL.BENEFIT_PKG,TBL.SOURCEID,TBL.DESCRIPTION,TBL.PD_CL ASS_EFF_DTCM.BENEFIT_PKG CM_PKG_CDFROM(SELECT F.BENEFIT_PKG BENEFIT_PKG,F.SOURCEID SOURCEID,F.DESCRIPTION DESCRIPTION,F.ODS_TRANS_DATE ODS_TRANS_DATE,F.ROW_SEQ_NUM ROW_SEQ_NUM, AL.APPL_PLAN_DSGN_CD APPL_PLAN_DSGN_CD, AL.EDW_PLAN_DSGN_K EDW_PLAN_DSGN_K, AL.PLAN_DSGN_CD PLAN_DSGN_CD, COALESCE(PD.PD_CLASS_BNFT_LEVEL_ID,'0') PD_CLASS_BNFT_LEVEL_ID, COALESCE(PD.PD_CLASS_TIER_TYP_ID,'0') PD_CLASS_TIER_TYP_ID, PD.PLAN_DSGN_DSC PLAN_DSGN_DSC, CAST(PD.SLS_BEG_DT AS CHAR(10)) SLS_BEG_DT,CAST(PD.SLS_END_DT AS CHAR(10)) SLS_END_DT,CAST(PD.PD_CLASS_EFF_DT AS CHAR(10)) PD_CLASS_EFF_DT FROM UA_EDW_DEVL.BENEFIT_PKG_M_FS_IN FLEFT JOIN UA_EDW_DEVL.PD_PLAN_DSGN_AL ALON F.BENEFIT_PKG = AL.APPL_PLAN_DSGN_CDAND AL.SRC_CD = 'CM'LEFT JOIN UA_EDW_DEVL.PD_PLAN_DSGN PDON AL.EDW_PLAN_DSGN_K = PD.EDW_PLAN_DSGN_KAND PD.EDW_EFF_END_DT = '9999-12-31') TBLLEFT JOIN EDWSRCVIEW.BENEFIT_PKG_M_CM_MR CMON TBL.BENEFIT_PKG = CM.BENEFIT_PKGORDER BY TBL.BENEFIT_PKGHowever when i change the alias name from "CM" to "FS" as LEFT JOIN EDWSRCVIEW.BENEFIT_PKG_M_CM_MR FSthe query works fine.What can be the problem?

dnoeth 4628 posts Joined 11/04
02 Apr 2006

Hi Sam,CM is an abbreviation for CREATE MACRO, so it's a keyword.You'll find a list of all keywords in:SQL Reference: FundamentalsAppendix B: Restricted Words for V2R6.1Dieter

Dieter

You must sign in to leave a comment.