REPLACE VIEW Failed 3706: Syntax error: expected something between the word 'ROLLOUT_REGION_IDENTIFIER' and ','

Database

REPLACE VIEW Failed 3706: Syntax error: expected something between the word 'ROLLOUT_REGION_IDENTIFIER' and ','

Hi all,

Hoping someone may be able to assist me in understanding why this case statement will work when in a SELECT query but not in a REPLACE View query. 

 (case 

  when service_type = 'Wireless' then SUBSTRING (ROLLOUT_REGION_IDENTIFIER,1,15) 

  when service_type = 'FTTB-Copper' then SUBSTRING (ROLLOUT_REGION_IDENTIFIER,1,7)

  when service_type = 'Brownfields Fibre' then rollout_region_identifier

  when service_type = 'Greenfields Fibre' then rollout_region_identifier

  when service_type = 'FTTN-Copper' then rollout_region_identifier 

  else rollout_region_identifier end) AS rollout_region_identifier,

Thanks in advance

Teradata newbiew

2 REPLIES
Teradata Employee

Re: REPLACE VIEW Failed 3706: Syntax error: expected something between the word 'ROLLOUT_REGION_IDENTIFIER' and ','

Could you show the full script for the REPLACE VIEW? It looks like a syntax error

Junior Supporter

Re: REPLACE VIEW Failed 3706: Syntax error: expected something between the word 'ROLLOUT_REGION_IDENTIFIER' and ','

Hi.

You are using the SUBSTR syntax with the SUBSTRING function.

You must use :

SUBSTRING(ROLLOUT_REGION_IDENTIFIER FROM 1 FOR 15)

or

SUBSTR(ROLLOUT_REGION_IDENTIFIER, 1, 15)

HTH.

Cheers.

Carlos.