How to check byte length of data?
Moderators: chulett, rschirm, roy
How to check byte length of data?
Got the dreaded 'ORA-12899 value too large for column' error because somehow a two character field got some multi-byte crappola in it and it won't fit in an Oracle VARCHAR2 field defined as 2 bytes rather than characters.
Is there an expedient way to check the byte length of a string? May need to end up making this check in multiple fields in 20+ million records, hence the need for speed.
Is there an expedient way to check the byte length of a string? May need to end up making this check in multiple fields in 20+ million records, hence the need for speed.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Craig - we had to put in a BASIC transform stage in order to figure out byte lengths, basically we had to parse a very long string into multiple Oracle strings and they could contain multibyte data and the BASIC ByteLen() was our first choice. I think we've now replaced that with a BuildOp because the BASIC transform stage caused sporadic production hangups.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
This I can't even get to compile. Depending on the output data type it either complains about an "Invalid conversion requested from a string to a raw" or "from an int32 to a raw".ray.wurlod wrote:How about Len(StringToRaw(InLink.TheString)) ?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 20
- Joined: Mon Dec 19, 2005 10:00 pm
- Location: UK
Hi Craig,chulett wrote:This I can't even get to compile. Depending on the output data type it either complains about an "Invalid conversion requested from a string to a raw" or "from an int32 to a raw".ray.wurlod wrote:How about Len(StringToRaw(InLink.TheString)) ?
Have you managed to find the solution for this please?
My requirement is to supress multi byte characters from loading to Oracle.
Thanks.
-
- Premium Member
- Posts: 20
- Joined: Mon Dec 19, 2005 10:00 pm
- Location: UK
I am trying to load around 200 million records to Oracle db, but some records seem to contain multi byte characters due to which Oracle load is failing.chulett wrote:
Tell us what you mean by needing to "suppress" multi-byte characters.
I don't want the job to abend, instead I want to capture all those such records and continue with the rest of the records.
So I am trying to identify these records before the Oracle stage, for example in a transformer but so far failed to do so.
Any ideas please?
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 20
- Joined: Mon Dec 19, 2005 10:00 pm
- Location: UK
If you can not think ALTER DATABASE CHARACTER SET then this link may educate/help you to write a routine to handle Multibyte Characters.
would be happy to see any working solution here.. :D
would be happy to see any working solution here.. :D
Accept that some days you're the pigeon and some days you're the statue.