Counting number of text lines in a character string
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Counting number of text lines in a character... Expand / Collapse
Author
Message
Posted 6/23/2008 7:22:04 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/17/2008 9:37:04 AM
Posts: 3, Visits: 3
Hi, I have got a character string with muliple lines (user presses carriage return). I need to count the number of lines (number of times carraige return) is entered. Does anyone know how to do it.

Manish
Post #11947
Posted 6/25/2008 7:56:38 PM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Forum Members
Last Login: 11/21/2008 10:45:25 PM
Posts: 79, Visits: 98
You should be able to use a recursive query to do the job. Look at this post:

http://www.teradata.com/teradataforum/Topic11452-9-1.aspx

In that example the separator was a ‘,’. You can change that to your line separator character.

If you just want the count then just change the last line of the query from:

select subpart from temp_table;

to

select count(subpart) from temp_table;

good luck.
Post #11964
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 4 ( 4 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 4:05pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.016. 7 queries. Compression Disabled.