Casting int to char & concatenating
Posted in 2000
Topics: Stored Procedures & SPL
Hello mighty ones! I need to create an SPL function that takes an integer as an input, then convert it into a string. For instance, all values below 100 would become "D00" to "D99", all values from 100 to 199 would become "E00" to "E99" and so forth. I believe I am casting my initial integer results correctly into characters by passing the integer values into a "convert_to_char" function that returns characters. However, when I try to concatenate my "D" or "E" with the "01" or "85", etc., I'm stumped. I can't find anything in the manuals about concatenating strings in SPL. Can anyone give me some guidance. Thanks so much. Regards, Troy Peterson
Isn't let r_string = string1 || string2; what you need? Nebojsa On Sat, 16 Sep 2000 04:27:43 GMT, "Troy Peterson" <tp096255@gte.net> wrote: >Hello mighty ones! I need to create an SPL function that takes an integer >as an input, then convert it into a string. For instance, all values below >100 would become "D00" to "D99", all values from 100 to 199 would become >"E00" to "E99" and so forth. > >I believe I am casting my initial integer results correctly into characters >by passing the integer values into a "convert_to_char" function that returns >characters. However, when I try to concatenate my "D" or "E" with the "01" >or "85", etc., I'm stumped. I can't find anything in the manuals about >concatenating strings in SPL. > >Can anyone give me some guidance. Thanks so much. > >Regards, > >Troy Peterson >