Hi folks!
I am still quite new to pl/sql, so I would like to ask you for a better solution to my task, than my current one: (Havn't found anything appropriate yet after searching.)
From a select-statement in a for-loop I am generating html-code (for APEX) for a navigation-list.
So now I could do it like the following:
declare html_string varchar2(32767);
begin
for i in (select fieldA from tableA)
loop
html_string := html_string || 'some html literals' || i.fieldA || 'more html literals';
end loop:
return html_string;
end;
Now I know from Java and C# that this kind of string concatation creates a hugh overhead, hence you use the datatype StringBuilder, which sort of works like a dynamic array-pointer and far more performance effective.
I have thought about a cursor type, but I think this is not really the solution, because in the end I'd have to convert the entire cursor into a varchar2 - is this possible?
Is there a better way in pl/sql than my above example?
Thanks and greets,
tobi