string not terminated error

Database

string not terminated error

Hi all, 

am getting '3760:string not terminated' error. i am using dynamic resultset for output. it failed at below point.plz suggest 

SET V_STMT1 = 'select status,

SUBSTRING(''0123456789ABCDEF'' FROM ip_lower_int / (16**7) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_lower_int / (16**6) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_lower_int / (16**5) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_lower_int / (16**4) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_lower_int / (16**3) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_lower_int / (16**2) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_lower_int / (16**1) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_lower_int / (16**0) MOD 16 + 1 FOR 1) as ip_lower,

SUBSTRING(''0123456789ABCDEF'' FROM ip_upper_int / (16**7) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_upper_int / (16**6) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_upper_int / (16**5) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_upper_int / (16**4) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_upper_int / (16**3) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_upper_int / (16**2) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_upper_int / (16**1) MOD 16 + 1 FOR 1) ||

  SUBSTRING(''0123456789ABCDEF'' FROM ip_upper_int / (16**0) MOD 16 + 1 FOR 1) as ip_upper,

  total_accts, 

cast(OREPLACE(cast(frd_acct_rt as varchar(5)),''.'','' '') as varchar(24))||IDN_REPLICATE(''0'',4-CHARACTERS(cast(OREPLACE(cast(frd_acct_rt as varchar(5)),''.'','' '') as varchar(24)))) frd_acct_rt,

ip_src, 

block_flg

from vt_ip_db;'

2 REPLIES

Re: string not terminated error

Try SUBSTR instead of SUBSTRING, that might solve your issue.

Teradata Employee

Re: string not terminated error

Is there a semicolon after the last apostrophe as well as before?