Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » array in htf.anchor2
array in htf.anchor2 [message #478039] Tue, 05 October 2010 16:10 Go to next message
Messages: 178
Registered: April 2007
Senior Member
oracle Database 11g Enterprise Edition Release - 64bit Production
PL/SQL Release - Production
"CORE Production"


Is it possible to have array in the parameter list ?
htp.tableData(htf.anchor2('wcl_events_form?p_event_id=28&p_record_counter=1&p_form_nav_type=new&p_event_arr='||l_events_arr,'Code Events',cattributes=>'CLASS=arial9navy',ctarget=>'new'));

Gives this error:
Error(4857,32): PLS-00306: wrong number or types of arguments in call to '||'


Re: array in htf.anchor2 [message #480564 is a reply to message #478039] Mon, 25 October 2010 13:58 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
htf.anchor2 has no magic in it - it just calls builds a string that eventually gets printed as part of the html you generate.
function anchor2(curl       in varchar2,
                ctext       in varchar2 character set any_cs,
                cname       in varchar2 character set any_cs DEFAULT NULL,
                ctarget     in varchar2 DEFAULT NULL,
                cattributes in varchar2 DEFAULT NULL)
                return varchar2 character set ctext%charset is
    curl_cname_null EXCEPTION;
    l_str varchar2(32767);
    if curl is NULL and cname is NULL then
        l_str := '<!-- ERROR in anchor2 usage, curl and cname cannot be NULL --><A NAME=" "';
        if ctext is not null then
            l_str := l_str||'> '||ctext||' </A';
        end if;
        l_str := l_str||'>';
        return l_str;
    end if;

    if curl is NULL then
        l_str := '<A NAME="'||cname||'"';
        if ctext is not null then
            l_str := l_str||'> '||ctext||' </A';
        end if;
        l_str := l_str||'>';
        l_str := '<A HREF="'||curl||'"';
        if cname is not null then
            l_str := l_str||' NAME="'||cname||'"';
        end if;
        if ctarget is not null then
            l_str := l_str||' TARGET="'||ctarget||'"';
        end if;
        if cattributes is not null then
            l_str := l_str||' '||cattributes;
        end if;
        l_str := l_str||'>'||ctext||'</A>';
    end if;
    return l_str;

you can manually build the URL up in any way you want and avoid htf.anchor2 - or based on the code shown, you can figure out what to pass in the produce the URL you want.
Previous Topic: Column names to a listbox
Next Topic: Application Express & Oracle HTTP Server Authentication
Goto Forum:

Current Time: Wed Apr 24 11:39:35 CDT 2024