String Data, Right Truncation MS Sql Server

General discussion forum about all databases other than SqlBase.
FRBhote
India
Posts: 2177
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

String Data, Right Truncation MS Sql Server

Post by FRBhote » 06 Apr 2011, 14:11

In TD 2.1, I am accessing a lot of variables. In SqlTalk, the last variable does not show and in TD I get the error
String Data, Right Truncation
. What can I do to get all the data?

In the attached screenshot, CITY_SEBI_RATE does not show in SqlTalk.
RightTrunc.JPG
You do not have the required permissions to view the files attached to this post.

Jeff Luther

Re: String Data, Right Truncation MS Sql Server

Post by Jeff Luther » 08 Apr 2011, 00:10

How about at least providing the SQL query so we can see the entire SQL statement to find out how long that SELECT <columns> string is, both in terms of # of columns as well as length of the string. Copy/paste of the query here could be helpful!

Mike Vandine

Re: String Data, Right Truncation MS Sql Server

Post by Mike Vandine » 08 Apr 2011, 01:04

Hi Feroz,

"It's broken' doesn't give us much to go on. *Please* give us some helpful information to help you solve your problems.

Best regards,

Mike

FRBhote
India
Posts: 2177
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: String Data, Right Truncation MS Sql Server

Post by FRBhote » 08 Apr 2011, 06:11

It is very funny, but in the statement, I changed the position of the predicates and it worked! TD no longer gave that error.

I changed:

P_CODE = :sPartyCode AND CITY_CODE = :sCityCode AND
to :

CITY_CODE = :sCityCode AND P_CODE = :sPartyCode AND

The original statement was:

SELECT '3', P_CAT, P_BKG_CAT, P_GRADE, P_TTAX_RATE, P_TTAX_RATE_BSE, P_TTAX_RATE_OPT, P_ST_RATE, P_ROUND_OFF, P_CF_RO, P_BKG_STRIKE, P_TR_FO, P_SLAB_BKG, P_ST_PREV_RATE,
P_ST_DATE, P_CONTRACT_BKG, UBKG_BKG, UBKG_PERC, P_DATE, P_ZERO_BKG_DAYS, P_ZERO_BKG_DATE, UBKG_MKT, CITY_TYPE, P_NET_CTCL, P_DOB, CITY_SEBI_RATE/100
FROM SYSADM.PARTY, SYSADM.SCRIPS, SYSADM.UBKG, SYSADM.CENTRE
WHERE P_CODE = :sPartyCode AND CITY_CODE = :sCityCode AND
CO_UNDERLYING = UBKG_UNDERLYING(+) AND 'ALL' = UBKG_PARTY(+) AND ( UBKG_MKT(+) = :sMktType OR UBKG_MKT IS NULL ) AND CO_CODE = :sCoCode AND
( UBKG_BOUGHT_SOLD = :sType OR UBKG_BOUGHT_SOLD IS NULL )

UNION
SELECT '2', P_CAT, P_BKG_CAT, P_GRADE, P_TTAX_RATE, P_TTAX_RATE_BSE, P_TTAX_RATE_OPT, P_ST_RATE, P_ROUND_OFF, P_CF_RO, P_BKG_STRIKE, P_TR_FO, P_SLAB_BKG, P_ST_PREV_RATE,
P_ST_DATE, P_CONTRACT_BKG, UBKG_BKG, UBKG_PERC, P_DATE, P_ZERO_BKG_DAYS, P_ZERO_BKG_DATE, UBKG_MKT, CITY_TYPE, P_NET_CTCL, P_DOB, CITY_SEBI_RATE/100
FROM SYSADM.PARTY, SYSADM.SCRIPS, SYSADM.UBKG, SYSADM.CENTRE
WHERE P_CODE = :sPartyCode AND CITY_CODE = :sCityCode AND UBKG_MKT = :sMktType AND
CO_UNDERLYING = UBKG_UNDERLYING AND :sPartyCode = UBKG_PARTY AND CO_CODE = :sCoCode AND
( UBKG_BOUGHT_SOLD = :sType OR UBKG_BOUGHT_SOLD IS NULL )
UNION

SELECT '1', P_CAT, P_BKG_CAT, P_GRADE, P_TTAX_RATE, P_TTAX_RATE_BSE, P_TTAX_RATE_OPT, P_ST_RATE, P_ROUND_OFF, P_CF_RO, P_BKG_STRIKE, P_TR_FO, P_SLAB_BKG, P_ST_PREV_RATE,
P_ST_DATE, P_CONTRACT_BKG, UBKG_BKG, UBKG_PERC, P_DATE, P_ZERO_BKG_DAYS, P_ZERO_BKG_DATE, UBKG_MKT, CITY_TYPE, P_NET_CTCL, P_DOB, CITY_SEBI_RATE/100
FROM SYSADM.PARTY, SYSADM.SCRIPS, SYSADM.UBKG, SYSADM.CENTRE
WHERE P_CODE = :sPartyCode AND CITY_CODE = :sCityCode AND UBKG_MKT = :sMktType AND
CO_DESC = UBKG_UNDERLYING AND P_CODE = UBKG_PARTY AND CO_CODE = :sCoCode AND
( UBKG_BOUGHT_SOLD = :sType OR UBKG_BOUGHT_SOLD IS NULL )

INTO :sBull, :strCat, :nBkgCat, :nGrade, :nPartyOther, :nBseOther, :nOptOther, :nPartySTax, :nPartyRoundOff, :nPartyCfRoundOff, :nPartyStrikeBkg, :nPartyTransFo, :nSlabBkg, :nPartySTaxOld,
:dtPartySTax, :nBkgContract, :nUnderlyingRate, :nUnderlyingPerc, :dtIntroDate, :nZeroBkgDays, :dtZeroBkgDate, :sUnderlyingMkt, :sStyle, :nNetCtcl, :dtDOB, :nSebiStamp
ORDER BY 1

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests