Toad World® Forums

CLOB fields


#1

Hi
It is impossible to save text value from clob field(clob editor) to file. Size of clob looks strange.

Thank you
Artem
image005.jpeg


#2

Sorry I forgot to say build#1381

Thank you
Artem


#3

Hi Artem,

This issue with saving large clob object has been fixed in our internal build. What strange about the clob size?

Gwen


#4

has returned 163824

Thank you
Artem

SELECT sum(lengthb(text)) FROM dba_source where name = ‘STANDARD’ and owner = ‘SYS’

Hi Gwen!

Result of query SELECT dbms_metadata.get_ddl(‘PACKAGE’,‘STANDARD’,‘SYS’) FROM dualwas in example above. I think it is too large size of Oracle stored package.

For example query ****

Message was edited by: Artem


#5

Hi Artem,

I asked Roman about this and here is his answer:“It’s probably because the CLOB uses Unicode to represent characters, i.e. each character takes 2 bytes.”. It doesn’t cause any trouble, does it?

Gwen


#6

Hi Gwen
My query above calculates size in bytes(not in chars). In this case size should have approximate value

It can differs but difference is very big :frowning:

Thank you
Artem


#7

Hi Artem,

My understanding is that dba_source view keeps the source in ANSI format, while dbms_metadata produces CLOBs in Unicode, therefore the size doubles (each 1 byte character becomes 2 bytes). I assure you, it’s not on our side.

Regards,
Roman


#8

Hi Roman
I have tried to check lob size via SQLNavigator 5.5… It show 162377 bytes. That means that issue is in Navigator.
Is it enough for fix this code defect?

BTW any latin char uses 1 byte in Unicode

Thank you
Artem


#9

I have attached screenshot.
ClobView.jpeg


#10

Hi Artem,

It actually depends on what coding is used. With UTF-8, indeed, latin characters take only 1 byte, but other languages will take 2 or more. We use UCS-16 for processing, therefore each character always takes 2 bytes.

Now, my question is, if we didn’t show the CLOB size in bytes, would it make life easier for you?

Cheers,
Roman


#11

Hi Roman
It is good question :))), but there are a lot of small incorrect details what force to think that Nav6 is not serious product :(. You are absolutely right I use db with UTF-8.
If we call beet as chocolate it will not became a chocolate :slight_smile:

I think it is better to have no info about size instead of incorrect size :slight_smile:

Thank you
Artem


#12

Hi Artem,

If we report the number of characters instead of bytes, would you be happy?

Regards,
Roman


#13

Hi Roman!
Now it looks good

Thank you