If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Fixed text in SQL being truncated

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-05-06, 06:47
janineweyers janineweyers is offline
Registered User
 
Join Date: May 2006
Posts: 21
Question Fixed text in SQL being truncated

Hi

This might be an obvious question to some of you, but I'm stumped and any help would be appreciated! I used to work in SQL Server, and am new to Teradata SQL. I'm not sure if this query is not working because of limitation differences between the two, or if it is a pure SQL problem. (Seeing how I couldn't find a teradata forum, I posted this problem here).

This is an excerpt of a query I'm trying to run in Teradata SQL Assistant:
SELECT
'TYLastRollUpCompWSSI' as WSSISet,
'FcastClosing Stock' as Measure,
sum(ZEROIFNULL(a.CCP_Closing_Stk_SV)) as Amt
FROM VWI0GPP_WKLY_SGRP_RPAS_PLAN a

In the resultset, however, the fixed text 'FcastClosing Stock' is being truncated to just 10 characters (i.e. 'FcastClosi) and the fixed text 'TYLastRollUpCompWSSI' is being truncated to just 20 characters (i.e. 'TYLastRollUpCompW').

It might seem silly that I need this ridiculously long names in the first place, but my resultset needs to conform with what is currently in the table.
Reply With Quote
  #2 (permalink)  
Old 09-05-06, 10:24
janineweyers janineweyers is offline
Registered User
 
Join Date: May 2006
Posts: 21
OK ... I managed to come up with a solution that seems to work: I have used "cast" in the select:

SELECT
cast('TYLastRollUpCompWSSI' as CHAR(30)) as WSSISet,
cast('FcastClosing Stock' AS CHAR(25)) as Measure, .... etc.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On