wood burning stoves 2.0*
The moose likes JDBC and the fly likes How to get the first 255 characters? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to get the first 255 characters?" Watch "How to get the first 255 characters?" New topic
Author

How to get the first 255 characters?

lu v thuan
Ranch Hand

Joined: Oct 25, 2001
Posts: 32
Hi friends!
I hava a column type containning more than 1000 characters in Oracle. I would like to get the first 255 characters in this column. Could any one pls tell me the way?
Thanks in advanced
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

if column1 is 1000 characters and you only want 255:
select substr(column1, 1, 255) from table
Jamie
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to get the first 255 characters?