All Forums Database
SGIT 8 posts Joined 08/16
31 Aug 2016
Single vs double quotes

Hello, in the following code , if i replace the single quotes arounf 'credit card' with double quotes, it looks for a column with name 'credit card' . can some one throw some light on how teradata interprets double and single quotes


when appl_for_prod_typ = '30' then  'CreditCard'

when appl_for_prod_typ in ('12','13') then  'Homeline Plan'

when appl_for_prod_typ = '41' then  'Overdraft'

when appl_for_prod_typ = '20' and APPL_FOR_SPCFC_SRVC_TYP = '06' then  'Royal Credit Line - Non Equity'

when APPL_FOR_SPCFC_SRVC_TYP in ('01','02') then  'Personal Loan'

when (appl_for_spcfc_srvc_typ = '09' and appl_for_purps_typ = 'DE') then 'Credit Card Limit Increase'

when (appl_for_prod_typ = '21' and APPL_FOR_SPCFC_SRVC_TYP = '06') then 'RCL Non Equity Limit Increase'

end as product,

dnoeth 4628 posts Joined 11/04
31 Aug 2016

It's working as expected by Standard SQL (and similar in most DBMSes):
Single quotes oare string delimiters.
Double quotes are used for identifiers like column & table names. But in Teradata double quoted identifiers are not case sensitive (this is a deviation from Standard SQL)


You must sign in to leave a comment.