Needing help with CONVERT(CHAR(11))

I need to convert an output(l_line_body_note) to a string and limit the string to a length of 128 characters. I have tried using the Convert to string character and everything i can think of.All help would be greatly appreciated.

l_line_body_Note := '<Notes>' ||'GIA Notice Event '||pc_log_rec.notice_id||': '|| pc_log_rec.pc_comments || '</Notes>';

[383 byte] By [chris71654a] at [2007-11-26 15:15:18]
# 1

> I need to convert an output(l_line_body_note) to a

> string and limit the string to a length of 128

> characters. I have tried using the Convert to string

> character and everything i can think of.All help

> would be greatly appreciated.

>

> l_line_body_Note := '<Notes>' ||'GIA Notice Event

> '||pc_log_rec.notice_id||': '||

> pc_log_rec.pc_comments || '</Notes>';

I believe you are using PL/SQL appending. In jave you can use '+' instead of the '||'.

String l_line_body_Note = "<Notes>"

+ "GIA Notice Event"

+ pc_log_rec.notice_id + ": "

+ pc_log_rec.pc_comments

+ "</Notes>";

If you are actually after a PL/SQL answer then I suggest you don't post in a java forum.

Ted.

ted_trippina at 2007-7-8 9:07:00 > top of Java-index,Java Essentials,New To Java...
# 2

> I need to convert an output(l_line_body_note) to a

> string and limit the string to a length of 128

> characters. I have tried using the Convert to string

> character and everything i can think of.All help

> would be greatly appreciated.

>

> l_line_body_Note := '<Notes>' ||'GIA Notice Event

> '||pc_log_rec.notice_id||': '||

> pc_log_rec.pc_comments || '</Notes>';

This looks like Oracle PL/SQL not Java, correct?

If it is PL/SQL then see the RTRIM() function.

Message was edited by:

jbish

jbisha at 2007-7-8 9:07:00 > top of Java-index,Java Essentials,New To Java...
# 3
Regarding the " ... string to a length of 128 characters"In Oracle PL/SQL use substr(my_string,x,y)In Java use myString.substring(x,y)
abillconsla at 2007-7-8 9:07:00 > top of Java-index,Java Essentials,New To Java...
# 4
> Regarding the " ... string to a length of 128> characters"> > In Oracle PL/SQL use substr(my_string,x,y)> In Java use myString.substring(x,y)In my post I suggested RTRIM() from PL/SQL, that should have been RPAD().
jbisha at 2007-7-8 9:07:00 > top of Java-index,Java Essentials,New To Java...
# 5

> > Regarding the " ... string to a length of 128

> > characters"

> >

> > In Oracle PL/SQL use substr(my_string,x,y)

> > In Java use myString.substring(x,y)

>

> In my post I suggested RTRIM() from PL/SQL, that

> should have been RPAD().

If I did not know if it could be either too long or short, rpad is the better choice.

abillconsla at 2007-7-8 9:07:00 > top of Java-index,Java Essentials,New To Java...