Changing region source SQL based on condition

I have a reports region which displays the results from some SQL. Depending on the value of a page variable I need to run a different bit of SQL to get my results. At the moment I'm using 5 different regions and displaying the appropriate one and hiding the others, depending on the value of the page variable.
It's a bit messy and I'm looking for a better way to do it. Is it possible to use a single region and change the SQL used as the region source after checking my page variable? e.g. something like this for the region source:
IF :report_type = 1 THEN
SELECT col1, col2, col3 from table1;
ELSEIF :report_type = 2 THEN
SELECT col1, col2, col3 from table2;
ELSEIF :report_type = 2 THEN
SELECT col1, col2, col3 from table3;
END IF;..or something similar?
Or is there an even easier way of doing this?

Hello,
Actually, as long as you're willing to live with some limitations, you can indeed do that with an interactive report.
A while ago, I blogged about using pipelined functions with respective to generic charting -
http://jes.blogs.shellprompt.net/2006/05/25/generic-charting-in-application-express/
Using the same technique you can create a pipelined function which returns each of your different resultsets.
The key limitation is of course that you need to return the same columns each time (in your example you are always returning 3 columns, it is just the table name that changes, so perhaps it might still be an acceptable solution to you).
John.
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

Similar Messages

  • Change OmniPortlet Source SQL Query at RunTime

    Hi All
    Can we change OmniPortet's source SQL query at run time, for example, add or remove a condition, while the output fields remain same but the records (rows returned) are updated based on the added/removed condition.
    Thanks in advance.

    Hi All
    I found solution to this problem myself, and it goes like this.
    We cannot change the query of OmniPortlet at run time, rather we can create a procedure which executes different queries based on passed parameters and return the resultset using REF CURSOR. I used SYS_REF_CURSOR for the same.
    Regards

  • Problem with SQL query region source containing OLAP clauses

    Hi team,
    I believe I found a bug when HTMLDB validates the SQL Query in a report region.
    My query includes an ORDER BY clause within a windowing function and HTMLDB refuses to accept the source owing to the presence of the ORDER BY and the column heading sort preference.
    Clearly the order-by in a window function has little to do with the column heading sort, but this error prevents me from updating the conditional display item in the page definition.
    Note also that the page was imported smoothly from the 1.5 version, so probably the region source is not checked at that time, but only when you update it "manually".
    So, in the end, if I don't change anything the page works because the sql query is assumed to be correct but unfortunately I need to change the condition and I cannot.
    The problem shows up in page 126 of app 21670, SQL query region.
    Bye,
    Flavio
    PS: may be I can work around this by using the pl/sql function returning the sql query.

    Flavio,
    We're aware of this problem. For now, your workaround is described in this thread:
    HTMLDB 1.6 and "order by" in analytic functions
    Sergio

  • Region source (PL/SQL function body returning SQL query)

    Hi, guys.
    Here is what i try to do:
    Create a region of type SQL Query (PL/SQL function body returning SQL query). In the source area i tried to put this:
    DECLARE
    v_new VARCHAR2(10);
    v_SQL varchar2(32000);
    BEGIN
    v_new := :P102_HDN_NEW;
    -- htp.p(v_new);
    IF v_new = 'N-Set' THEN
    v_SQL := 'select ' ||
    ELSIF v_new = 'Y-Set' THEN
    v_SQL := 'select ' ||
    END IF;
    RETURN v_SQL;
    END;
    And here is the reply from APEX:
    1 error has occurred
    Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. The query can not be parsed, the cursor is not yet open or a function returning a SQL query returned without a value.
    Now.
    1. Variable is set with the right value.
    2. Each statement (separately) returns SQL that works with no problems
    3. Problem occures if i try to put IF statement around the SQL creation.
    4. If i select "Use Generic Column Names (parse query at runtime only)" instead of "Use Query-Specific Column Names and Validate Query" then the script returns SQL properly, however report's column names are set to Col1, Col2,Col3 ......
    Thnks in advence
    Mike

    OK. Here is enire statement:
    DECLARE
    v_new VARCHAR2(10);
    v_SQL varchar2(32000);
    BEGIN
    v_new := :P102_HDN_NEW;
    htp.p(v_new);
    IF v_new = 'N-Set' THEN
    v_SQL := 'select ' ||
    'APEX_ITEM.DISPLAY_AND_SAVE(10,c.sdescr) descr, ' ||
    'APEX_ITEM.DISPLAY_AND_SAVE(12,DECODE(ld.level,''All'', ''All Categories'',ld.level)) level, ' ||
    'apex_item.checkbox(1, ld.opt_in_auto_flag, decode(ld.opt_in_auto_flag,NULL,''disabled'',''Y'',''checked'')) auto_in, ' ||
    'apex_item.checkbox(2, ld.opt_in_manual_flag, decode(ld.opt_in_manual_flag,NULL,''disabled'',''Y'',''checked'')) manual_in, ' ||
    'apex_item.checkbox(3, ld.opt_out_auto_flag, decode(ld.opt_out_auto_flag,NULL,''disabled'',''Y'',''checked'')) auto_out, ' ||
    'apex_item.checkbox(4, ld.opt_out_manual_flag, decode(ld.opt_out_manual_flag,NULL,''disabled'',''Y'',''checked'')) manual_out, ' ||
    'DECODE(c.code, ''NMBR'', NULL,''Change to '' || DECODE(ld.level,''All'',''Categories'',''All Categories'')) link_change, ' ||
    'APEX_ITEM.DISPLAY_AND_SAVE(11,c.code) code ' ||
    'from ' ||
    'tbl1 c, ' ||
    'tbl2 ld ' ||
    'where c.code = ld.code ' ||
    'and c.type = ''TYPE1'' ' ||
    'and c.active = ''Y'' ' ||
    'order by c.sorting ';
    ELSIF v_new = 'Y-Set' THEN
    v_SQL := 'select ' ||
    'APEX_ITEM.DISPLAY_AND_SAVE(10,c.sdescr) descr, ' ||
    'APEX_ITEM.DISPLAY_AND_SAVE(12,''All Categories'') level, ' ||
    'apex_item.checkbox(1, c.option_1, decode(c.option_1,NULL,''disabled'',''Y'',''checked'')) auto_in, ' ||
    'apex_item.checkbox(2, c.option_3, decode(c.option_3,NULL,''disabled'',''Y'',''checked'')) manual_in, ' ||
    'apex_item.checkbox(3, c.option_2, decode(c.option_2,NULL,''disabled'',''Y'',''checked'')) auto_out, ' ||
    'apex_item.checkbox(4, c.option_4, decode(c.option_4,NULL,''disabled'',''Y'',''checked'')) manual_out, ' ||
    'DECODE(c.code, ''AAA'', NULL,''Options by AAA'') link_change, ' ||
    'APEX_ITEM.DISPLAY_AND_SAVE(11,c.code) code ' ||
    'from ' ||
    'tbl1 c ' ||
    'where 1 = 1 ' ||
    'and c.type = ''TYPE1'' ' ||
    'and c.active = ''Y'' ' ||
    'order by c.sorting ';
    END IF;
    RETURN v_SQL;
    END;
    If i put just this
    DECLARE
    v_new VARCHAR2(10);
    v_SQL varchar2(32000);
    BEGIN
    v_new := :P102_HDN_NEW;
    htp.p(v_new);
    v_SQL := 'select ' ||
    'APEX_ITEM.DISPLAY_AND_SAVE(10,c.sdescr) descr, ' ||
    'APEX_ITEM.DISPLAY_AND_SAVE(12,DECODE(ld.level,''All'', ''All Categories'',ld.level)) level, ' ||
    'apex_item.checkbox(1, ld.opt_in_auto_flag, decode(ld.opt_in_auto_flag,NULL,''disabled'',''Y'',''checked'')) auto_in, ' ||
    'apex_item.checkbox(2, ld.opt_in_manual_flag, decode(ld.opt_in_manual_flag,NULL,''disabled'',''Y'',''checked'')) manual_in, ' ||
    'apex_item.checkbox(3, ld.opt_out_auto_flag, decode(ld.opt_out_auto_flag,NULL,''disabled'',''Y'',''checked'')) auto_out, ' ||
    'apex_item.checkbox(4, ld.opt_out_manual_flag, decode(ld.opt_out_manual_flag,NULL,''disabled'',''Y'',''checked'')) manual_out, ' ||
    'DECODE(c.code, ''NMBR'', NULL,''Change to '' || DECODE(ld.level,''All'',''Categories'',''All Categories'')) link_change, ' ||
    'APEX_ITEM.DISPLAY_AND_SAVE(11,c.code) code ' ||
    'from ' ||
    'tbl1 c, ' ||
    'tbl2 ld ' ||
    'where c.code = ld.code ' ||
    'and c.type = ''TYPE1'' ' ||
    'and c.active = ''Y'' ' ||
    'order by c.sorting ';
    RETURN v_SQL;
    END;
    it works fune...

  • Modifying sql query in "region source" depending on hidden parameter?

    Hi,
    Is there a way to run 2 sql queries in "region source" depending on the hidden parameter passed? In other words, if I want to show all employees "select * from emp" when clicking on a "total" link as opposed to "select * from emp where dept=:xxx" when clicking on a dept link, how does the "region source" account for another sql statement?
    thanks.

    My understanding is that based on the link you click on in some page (PX) , it will go to a page (PY) that has a report in it and a hidden item with som passed value.
    If that is correct then do the following in PY:
    select * from emp
    where dept=:xxx
    or
    :PY_PASSED_VALUE = 'total'this will show ALL records in emp if the passed value is total , i.e you clicked on the totals link and passed 'total' to the hidden item in PY : PY_PASSED_VALUE
    but it will show only specific dept records otherwise.
    Hope this helps,
    Sam

  • Get SQL Query from the Region Source

    Hi,
    The below query gives me the region source code,
    SELECT region_source into p_sql_stmt
    FROM apex_application_page_regions
    WHERE region_id = 01129836282 AND
    page_id = 54 AND
    application_id = 215;
    Initially I use to have only the SQL region source code as mentioned below , So using the above query i use to pass the sql code to p_sql_stmt
    SELECT PROJECT_ID,EMPLOYEE_ID,EFFECTIVE_DATE FROM AR_V_ADDRESS_HISTORY WHERE PROJECT_ID = :P51_PROJECT_ID
    Now the changes what i did in the page region source is i am using a PLSQL return query which is mentioned below
    declare
    qry varchar2(32000);
    begin
    qry := ' SELECT PROJECT_ID,EMPLOYEE_ID,EFFECTIVE_DATE';
    for c1 in ( SELECT * FROM AR_ADDRESS_TYPE)
    loop
    qry := qry ||
    ' , GET_ADDRESS_LINE_1(PROJECT_ID,EMPLOYEE_ID,' || c1.address_type_id || ' ,TO_DATE(EFFECTIVE_DATE)) "' || c1.name ||'_ADDRESS_TYPE_1"';
    qry := qry ||
    ' , GET_ADDRESS_LINE_1(PROJECT_ID,EMPLOYEE_ID,' || c1.address_type_id || ' ,TO_DATE(EFFECTIVE_DATE)) "' || c1.name ||'_ADDRESS_TYPE_2"';
    end loop;
    qry := qry || ' FROM AR_V_ADDRESS_HISTORY
    WHERE
    PROJECT_ID = :P51_PROJECT_ID ';
    return(qry);
    end;
    If i execute the above code in the with dbms_output.put_line in the SQL developer or TOAD it prints the sql query which i wanted, Since i am using this in a apex page i need to get the SQL code from the apex page.
    Can any one please suggest me how to get this sql code using the above plsql code.
    Please suggest me in this issue
    Thanks
    Sudhir

    One way to get the sql statement is
    Create a global variable in the package spec where your function returns sql statement and assign the final sql statement to the package spec variable before the return.
    Write a wrapper function to return the stored sql statement value.
    Example code below:
    create or replace package xx_test_pkg as
    g_sql_stmt CLOB;
    function get_sql() return clob;
    function get_stored_val() return clob;
    end;
    create or replace body package xx_test_pkg as
    function get_sql return clob ..
    v_sqlstmt clob;
    begin
    v_sqlstmt := 'select * from emp';
    -- assign to global variable before returning the value
    g_sql_stmt := v_sqlstmt;
    return v_sqlstmt;
    end;
    function get_stored_val() ....
    begin
    return g_sql_stmnt;
    end;
    end;

  • Dynamically assigning variables based on condition in pl/sql

    I have a script which takes 6 input parameters but based on input 1 parameters 2 to 6 will be assigned to different variables. but the condition is not being checked during variable assignment phase. even if table_update is 'P' para,mater 2 is getting assigned to tariff_group instead of offer_id. Is there any way to solve this problem so that variables get assigned based on condition.
    table_update := '&1';
    if(table_update = 'T')
    THEN
         tariff_group := '&2';
         gf_version := &3;
         tariff_table_name := '&4';
         flag := '&5';
         if(no_rows_tariff(tariff_table_name, gf_version, tariff_group))
         THEN
              if(flag = 'I')
              THEN
                   tariff_column_name := column_tariff(tariff_table_name);
              ELSIF(flag = 'R')
              THEN
                   max_gf_tariff(tariff_table_name, gf_version, tariff_group);
              ELSE
                   DBMS_OUTPUT.PUT_LINE('Please enter correct option for update I- Insert R-Rollback');
              END IF;
         END IF;
    ELSIF(table_update = 'P')
    THEN
         offer_id := &2;
         gf_version := &3;
         promotion_table_name := '&4';
         flag := '&5';

    Although you do not say what your problem is, I suspect that it si something like this:
    SQL> !cat t.sql
    DECLARE
       table_update         VARCHAR2(1);
       tariff_group         VARCHAR2(3);
       gf_version           NUMBER;
       tariff_table_name    VARCHAR2(5);
       offer_id             NUMBER;
       promotion_table_name VARCHAR2(5);
       flag                 VARCHAR2(1);
    BEGIN
       table_update := '&1';
       IF table_update = 'T' THEN
          tariff_group := '&2';
          gf_version := &3;
          tariff_table_name := '&4';
          flag := '&5';
       ELSIF table_update = 'P' THEN
          offer_id := &2;
          gf_version := &3;
          promotion_table_name := '&4';
          flag := '&5';
       END IF;
       DBMS_OUTPUT.Put_Line ('TableUpdate: '||table_update);
       DBMS_OUTPUT.Put_Line ('TariffGroup: '||tariff_group);
       DBMS_OUTPUT.Put_Line ('GfVersion: '||gf_version);
       DBMS_OUTPUT.Put_Line ('Tarifftable: '||tariff_table_name);
       DBMS_OUTPUT.Put_Line ('OfferID: '||offer_id);
       DBMS_OUTPUT.Put_Line ('PromoTable: '||promotion_table_name);
    END;
    SQL> @t T TG1 1 TTN1 F
    old  10:    table_update := '&1';
    new  10:    table_update := 'T';
    old  12:       tariff_group := '&2';
    new  12:       tariff_group := 'TG1';
    old  13:       gf_version := &3;
    new  13:       gf_version := 1;
    old  14:       tariff_table_name := '&4';
    new  14:       tariff_table_name := 'TTN1';
    old  15:       flag := '&5';
    new  15:       flag := 'F';
    old  17:       offer_id := &2;
    new  17:       offer_id := TG1;
    old  18:       gf_version := &3;
    new  18:       gf_version := 1;
    old  19:       promotion_table_name := '&4';
    new  19:       promotion_table_name := 'TTN1';
    old  20:       flag := '&5';
    new  20:       flag := 'F';
          offer_id := TG1;
    ERROR at line 17:
    ORA-06550: line 17, column 19:
    PLS-00201: identifier 'TG1' must be declared
    ORA-06550: line 17, column 7:
    PL/SQL: Statement ignoredAs you can see, the initial assignments for compilation purposes are done prior to actually running the code, and the assignment to offer_id is failing.
    If I change offer_id to a varchar and quote the &2, then the compilation assignemnt works, and the actual logic of the script works:
    SQL> !cat t.sql
    DECLARE
       table_update         VARCHAR2(1);
       tariff_group         VARCHAR2(3);
       gf_version           NUMBER;
       tariff_table_name    VARCHAR2(5);
    offer_id VARCHAR2(3);
       promotion_table_name VARCHAR2(5);
       flag                 VARCHAR2(1);
    BEGIN
       table_update := '&1';
       IF table_update = 'T' THEN
          tariff_group := '&2';
          gf_version := &3;
          tariff_table_name := '&4';
          flag := '&5';
       ELSIF table_update = 'P' THEN
    offer_id := '&2';
          gf_version := &3;
          promotion_table_name := '&4';
          flag := '&5';
       END IF;
       DBMS_OUTPUT.Put_Line ('TableUpdate: '||table_update);
       DBMS_OUTPUT.Put_Line ('TariffGroup: '||tariff_group);
       DBMS_OUTPUT.Put_Line ('GfVersion: '||gf_version);
       DBMS_OUTPUT.Put_Line ('Tarifftable: '||tariff_table_name);
       DBMS_OUTPUT.Put_Line ('OfferID: '||offer_id);
       DBMS_OUTPUT.Put_Line ('PromoTable: '||promotion_table_name);
    END;
    SQL> @t T TG1 1 TTN1 F
    30  /
    old  10:    table_update := '&1';
    new  10:    table_update := 'T';
    old  12:       tariff_group := '&2';
    new  12:       tariff_group := 'TG1';
    old  13:       gf_version := &3;
    new  13:       gf_version := 1;
    old  14:       tariff_table_name := '&4';
    new  14:       tariff_table_name := 'TTN1';
    old  15:       flag := '&5';
    new  15:       flag := 'F';
    old  17:       offer_id := '&2';
    new  17:       offer_id := 'TG1';
    old  18:       gf_version := &3;
    new  18:       gf_version := 1;
    old  19:       promotion_table_name := '&4';
    new  19:       promotion_table_name := 'TTN1';
    old  20:       flag := '&5';
    new  20:       flag := 'F';
    TableUpdate: T
    TariffGroup: TG1
    GfVersion: 1
    Tarifftable: TTN1
    OfferID:
    PromoTable:John

  • SQL report region source to call a pl/sql function using DB link

    Hi - I have a pl/sql function fn_dbtype(id NUMBER) defined in database X. The pl/sql function executes couple DML statements and returns a string (a SELECT query). I am able to call this function using SQL Plus (Connected to Database X) as below and it works fine:
    declare
    vSQL VARCHAR2(100);
    begin
    vSQL := fn_dbtype(1);
    end;
    The DML operations completed fine and vSQL contains the "Select" query now.
    In APEX:
    I am trying to create a SQL report in APEX using SQL query(PL/SQL function returning a sql statement) option. I am trying to figure out what to put in the region source so that the output of the "Select" query is displayed in the report.
    Moreover APEX is hosted in a different database instance. So I would need to call this pl/sql function using a DB Link.
    Please let me know what I need to put in the region source to execute the pl/sql function which returns the "Select" query thereby displaying the query output in the report. Thanks.
    Edited by: user709584 on Mar 19, 2009 2:32 PM
    Edited by: user709584 on Mar 19, 2009 2:34 PM

    try something like this:
    return fn_dbtype(1)@dblink;

  • Changed source address based on destination IP

    Hello,
    Suppose I had the following configuration in an IOS router
    interface <interface type/number>
     ip address 1.1.1.3 255.255.255.0 secondary
     ip address 1.1.1.2 255.255.255.0
    ip route 0.0.0.0 0.0.0.0 1.1.1.1
    access-list standard INTERNET_BOUND_ACL
     permit <lan subnet-id> <lan wildcard>
    ip nat inside source list INTERNET_BOUND_ACL interface <interface type/number> overload
    I need to change the source inside global IP address based on the destination outside global IP address.
    Example: I need our source IP to be 1.1.1.3 when I ping 8.8.8.8
    How would i accomplish this?

    Hi,
    You would need to use two NAT pools and two different ACLs to separate your internal clients depending on the destination they want to communicate with, and to subsequently NAT them using a selected NAT pool. For example:
    ip access-list extended NAT_2
      permit ip <LAN Network> <Wildcard> <DestinationX> <WildcardX>
    ip access-list extended NAT_3
      permit ip <LAN Network> <Wildcard> <DestinationY> <WildcardY>
    ip nat pool NATPOOL_2 1.1.1.2 1.1.1.2 netmask 255.255.255.0
    ip nat pool NATPOOL_3 1.1.1.3 1.1.1.3 netmask 255.255.255.0
    ip nat inside source list NAT_2 pool NATPOOL_2 overload
    ip nat inside source list NAT_3 pool NATPOOL_3 overload
    Exactly one of the ACLs should actually contain an entry saying
    permit ip <LAN Network> <Wildcard> any
    to make sure that the internal network gets translated to some of the two public addresses even if itt does not communicate with any specific destination IP.
    Do you believe this could be a workable solution for you?
    Best regards,
    Peter

  • Change a region source url to include P2_TRACTNO

    Hi all,
    I have an html region in which I am referencing a map. My region source is as follows:
    <iframe id="mframe" src="http://nwo26.nwo.usace.army.mil:7778/gis/g6imxgsc.navmaponly.map?p_unique_id=J-920&map=garr&p_layers=garr_tracts&p_layer=garr_tracts
    " scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:600; display:block; height:500;"></iframe>
    J-920 is a tract number.
    I am wanting to dynamically insert my P2_TRACTNO item in place of the J-920 of the p_unique_id=J-920 part of the URL listed above.
    How can I modify the code to change
    p_unique_id= my P2_TRACTNO item?
    Thanks,
    Kirk

    Hi,
    You can include:
    &P2_TRACTNO.wherever you want the value to appear on the page. So:
    src="http://nwo26.nwo.usace.army.mil:7778/gis/g6imxgsc.navmaponly.map?p_unique_id=&P2_TRACTNO.&amp;map=garr.......etc
    {code}
    Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • PL/SQL Region Source

    Hello,
    I'm trying to link my region source code to a select list button. I've created this PL|SQL anonymous block :
    DECLARE
    query varchar2(32767);     -- query
    where varchar2(4000);      -- where clause
    boolean varchar2(1) := 'N';      -- identifies if where clause exists
    BEGIN
    query := ' SELECT "ID", '||
         '      "PROVINCE", '||
         '      "SOIL_CODE", '||
         '      "MODIFIER", '||
         '      "LU", '||
         '      "LAYER_NO", '||
         '     "UDEPTH", '||
         ' "LDEPTH", '||
         '     "HZN_LIT", '||
         '     "HZN_MAS", '||
         '     "HZN_SUF", '||
         '     "HZN_MOD", '||
         '     "COFRAG", '||
         '     "DOMSAND", '||
         '     "VFSAND", '||
         '     "TSAND", '||
         '     "TSILT", '||
         '     "TCLAY", '||
         '     "ORGCARB", '||
         '     "PHCA", '||
         '     "PH2", '||
         '     "BASE", '||
         '     "CEC", '||
         '     "KSAT", '||
         '     "KP0", '||
         '     "KP10", '||
         '     "KP33", '||
         '     "KP1500", '||
         '     "BD", '||
         '     "EC", '||
         '     "CACO3", '||
         '     "VONPOST", '||
         '     "WOOD", '||
         '     "SOILTYPE"'||
         ' FROM "#OWNER#"."SLF_CANADA" ';
    IF :P6_LANDUSE_QUERY = '1'
         THEN
         where := 'LU = "A"';
         boolean := 'Y';
    END IF;
    IF :P6_LANDUSE_QUERY = '2'
         THEN
         where := 'LU = "N"';
         boolean := 'Y';
    END IF;
    IF boolean = 'Y'
         THEN
         query := query || ' WHERE '|| where;
    END IF;
    RETURN query;
    END;
    The region type is set to SQL Query (PL|SQL function returning query). Then I run the application I receive this error:
    ORA-06550: line 4, column 1: PLS-00103: Encountered the symbol "WHERE" when expecting one of the following: begin function package pragma procedure subtype type use form current cursor ORA-06550: line 5, column 1: PLS-00103: Encountered the symbol "BOOLEAN" ORA-06550: line 47, column 2: PLS-00103: Encountered the symbol "WHERE" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return
    I've tried many other approaches but I'm at my wits end. Any suggestions?
    Thanks in advance,
    Patrick
    Message was edited by:
    Patrick_Rollin

    Patrick - I'd avoid using reserved words like BOOLEAN and WHERE as variable names.
    Scott

  • Change the source for a media player based on selection from a list.

    All of this is referring to my public facing website in Office 365.
    I put the following code in a content editor web part:
    <audio controls>
      <source src="http://someserver/somefile.mp3" type="audio/mpeg">
    </audio>
    This works just fine. 
    What I want to do, is display a table below this which is a list of mp3's. when the user clicks on one of them the audio plays in the <audio controls>. 
    In other words, I want to change the source of the above player when I click on a link elsewhere in the page.
    Thank you
    Joe Fager

    What you'll need to do is have a javascript onclick/onchange event in the dropdown that runs a set of code that will reset the audio control with the new source. That can be done with jQuery.
    Andy Wessendorf SharePoint Developer II | Rackspace [email protected]

  • PL/SQL based report headings throw ORA-06502

    I have a report that presents a view containing over 500 columns. This is data generated by an ETL process (for a data mining app), and the view's column names are dynamically defined each time the data are compiled. I've got scrolling set up within the region and the report works fine (all ~500 columns) with headings based on Column Names. However since column names change, I must use the Region Source option to 'Use Generic Column Names (parse query at runtime only)' and define Headings Type as PL/SQL. I've written a function to build the ':' delimited field list from the data dictionary and it all works just fine for a small number of columns (i.e., when the view is defined as only a few fields). When I try the complete data (~500 columns), the report region shows "ORA-06502: PL/SQL: numeric or value error: character string buffer too small". I've confirmed (in sql*plus) that the function returning the ':' delimited field list works fine. Anyone know if there a limit to the number of columns that HTMLDB can handle for dynamic headings? Or a workaround??

    Thanks for the reply. Couple of follow up questions...
    1) Is there a workaround to generate dynamic (run-time) headings that exceed the 4000 char limit?
    2) Page 1 of my app runs an PL/SQL process. One of the results of the process is a redefinition of my view's column names. Page 2 reports the view (~500 fields). Instead of PL/SQL function-based column headings, can either Page 1 or Page 2 directly update Page 2's report "static" column headings behind the scenes as some sort of page process?

  • Report region with sql query

    Hi
    I have a report region with sql query. There are two regions in page. On top of page, user enters data and after that second region show enterd data which is report region
    based on sql query.
    Now,when this page is opned, as user had not entered any thing, report region shows "no data found" message. Is it possible to remove that message or
    may i conditionally disaply report region i.e if data is inserted then only report region is dispalyed.
    Thanks

    >
    i was trying with select count(1) in expression.
    >
    Just for your info, COUNT() (without any grouping obviously) with always return 1 row. If there are no result for the query then 1 row will be returned with a value of zero - so there are results returned.
    Secondly, why were you using COUNT(1) rather than COUNT(*)? That is is faster is a very common misconception and not true. If you need to know how many rows have been returned, use COUNT(*). If you need to take nulls into account (ie. not include them in your count) then use COUNT(column_name) and name the column that you are interested in specifically.
    Cheers
    Ben

  • Is There A Character Limit to Region Source?

    I created a PL/SQL Dynamic Content region. I was in the process of adding PL/SQL code to region source and every thing was working fine when I started getting the following error when ever I press the Apply Changes button:
    1 error has occurred
    ORA-06550: line 609, column 1: PLS-00103: Encountered the symbol "END" when expecting one of the following: * & = - + ; < / > at in is mod remainder not rem <> or != or ~= >= <= <> and or like LIKE2_ LIKE4_ LIKEC_ between || member SUBMULTISET_ The symbol ";" was substituted for "END" to continue.
    I cannot find anything wrong with the PL/SQL code. I did notice however, that if I remove enough lines of code the error message goes away. Is there some limit to the number of lines or number of characters the region source can hold?? If so is there some way to increase this limit? Thanks for the help.

    I understand what you are saying. I looked up mod_plsql and understand this is a limitation of the Oracle HTTP web server. But is there a way to configure the web server so it can handle more data? I find it hard to belive that people are not writting a lot longer PL/SQL code than I am.

Maybe you are looking for