Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

BTEQ syntax with CAST embedded in SUBSTRING function - forum topic by totototototo

$
0
0

Hi,
I am trying to achieve something that seem trivial enough but so far all my attempts failed. I have a BTEQ session called from a Shell script, what I try to do is to create a string with a "some blanks" the size of this blank section is determined by a shell variable) 
So what i have is : 
 
SELECT
<...> ||  SUBSTRING(CAST('' as CHAR(${MAX_SPC_NB})  ) , 1, ${SPC_NB}  ) | || <...>
FROM
 
Where MAX_SPC_NB > SPC_NB and both are determined on the fly (Can't harcode any of them) 
 
The error i get : 

             ' || SUBSTRING(CAST('' AS  CHAR(8192)) , 1, 256  ) || '

                                                                               $

 *** Failure 3706 Syntax error: expected something between ')' and ','.

 

 

The same query called from SQLAssistant is working fine btw. 

 

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>