How to Truncate data in Oracle
Moderators: chulett, rschirm, roy
How to Truncate data in Oracle
We have recently changed our database to 10g and now I am getting an error message:
extServiceRequest..Transformer_1: ORA-12899: value too large for column "SBLMART_DATA"."EXT_S_SRV_REQ"."DESC_TEXT" (actual: 302, maximum: 255)
Is there a function to trucate this data to a maximum length of 255? This is just a description field so we do not want this to be and longer than 255 and if it is then we just want to truncate the remaining data.
extServiceRequest..Transformer_1: ORA-12899: value too large for column "SBLMART_DATA"."EXT_S_SRV_REQ"."DESC_TEXT" (actual: 302, maximum: 255)
Is there a function to trucate this data to a maximum length of 255? This is just a description field so we do not want this to be and longer than 255 and if it is then we just want to truncate the remaining data.
If you already have a transform stage, just use "In.DESC_TEXT[1,255]" or "LEFT(In.DESC_TEXT,255)". If you have a modify stage you'll need different syntax, which I can't recall off the top of my head.
Or use the ORACLE "substr" DML command.
Or use the ORACLE "substr" DML command.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 1735
- Joined: Thu Mar 01, 2007 5:44 am
- Location: Troy, MI
Do you have an NLS installation and how are your Oracle columns defined - by character or by byte?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
You're already doing that with your substring notation of [1,255] - that limits it to 255 characters. Your problem is those 255 characters need more than 255 bytes to hold them. Any chance of getting the target table altered? All it takes is a simple MODIFY statement for the column in question and you can do it with the existing data there, i.e. the table does not have to be empty for this.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers