Click here to Skip to main content
15,881,092 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Can we convert a clob variable to varchar2 using vc++ in oracle database?
Posted

1 solution

You can convert the first 4000 bytes (depending on version) of the CLOB to varchar2 using PL/SQL.

This link provides some solutions (in PL/SQL) http://stackoverflow.com/questions/12860526/how-to-convert-clob-to-varchar2-inside-oracle-pl-sql[^]

I presume you are already using VC++ to interact with your oracle database so just call the sql as you would any other, or set up a function/procedure to do it and call that from your project

--------
[EDIT]
I have since found an example where a CLOB has been split into a collection of varchar2 which might be more helpful than my original answer. https://community.oracle.com/thread/2438977[^]
 
Share this answer
 
v2
Comments
VidyasagarSTGM 22-Jan-15 7:35am    
I have a clob containing 6672 bytes
CHill60 22-Jan-15 8:12am    
Then you can't convert it to a varchar2 - max size of a varchar2 is 4000 bytes reference[^]
VidyasagarSTGM 22-Jan-15 8:14am    
Ok.. Thank you very much...
CHill60 22-Jan-15 8:49am    
See my updated solution which I think will help
VidyasagarSTGM 23-Jan-15 0:01am    
Sure I will check on it... Thanks....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900