Pass a value from a PL/SQL function to a javascript (html header) ? ?

Hey Guys,
Have a question regarding how to pass a value from a PL/SQL function to a javascript in the HTML Header.
I have created a PL/SQL function in my database, which does looping.
The reason for this is:  On my apex page when the user selects a code, it should display(or highlight buttons) the different project id's present for that particular code.
example= code 1
has project id's = 5, 6, 7
code 2
has project id's = 7,8
Thank you for your Help or Suggestions
Jesh
The PL/SQL function :
CREATE OR REPLACE FUNCTION contact_details(ACT_CODE1 IN NUMBER) RETURN VARCHAR2 IS
Project_codes varchar2(10);
CURSOR contact_cur IS
SELECT ACT_CODE,PROJECT_ID
FROM ACTASQ.ASQ_CONTACT where ACT_CODE = ACT_CODE1;
currec contact_cur%rowtype;
NAME: contact_details
PURPOSE:
REVISIONS:
Ver Date Author Description
1.0 6/25/2009 1. Created this function.
BEGIN
FOR currec in contact_cur LOOP
     dbms_output.put_line(currec.PROJECT_ID || '|');
     Project_codes := currec.PROJECT_ID|| '|' ||Project_codes;
END LOOP;
RETURN Project_codes;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
-- Consider logging the error and then re-raise
RAISE;
END contact_details;
/

Jesh:
I have made the following modifications to your app to get it to work as I thing you need it to.
1) Changed the source for the HTML Buttons Region(note use of id vs name for the Buttons)
<script>
function hilitebtn(val) {
//gray buttons
$x('graduate').style.backgroundColor='gray'
$x('distance').style.backgroundColor='gray'
$x('career').style.backgroundColor='gray'
$x('photo').style.backgroundColor='gray'
//AJAX call to get project-ids
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=GETPROJECTS',0);
get.addParam('x01',val)
gReturn = get.get();
var arr=gReturn.split(':');  //dump into array
get = null;
for (i=0;i<arr.length;i++) {
// alert('val=' + arr);
if ( arr[i]==5)
$x('graduate').style.backgroundColor='red';
if ( arr[i]==6)
$x('distance').style.backgroundColor='red';
if ( arr[i]==7)
$x('career').style.backgroundColor='red';
if ( arr[i]==8)
$x('photo').style.backgroundColor='red';
</script>
<table cellpadding='0' cellspacing='0' border='0'>
<tr><td>
<input type='button' id='graduate' value='Graduate'>
</td>
<td>
<input type='button' id='distance' value='Distance'>
</td>
<td>
<input type='button' id='career' value='Career/Tech'>
</td>
<td>
<input type='button' id='photo' value='Photos'>
</td>
</tr></table>
2) Defined the application process  GETPROJECTS as DECLARE
IDS varchar2(1000);
l_act_code varchar2(100) :=4;
begin
IDS:='';
l_act_code := wwv_flow.g_x01;
for x in(
SELECT ACT_CODE,PROJECT_ID
FROM ASQ_CONTACT
where ACT_CODE = l_act_code)
LOOP
IDS := IDS || X.PROJECT_ID|| ':' ;
END LOOP;
HTP.PRN(IDS);
END;
3) Changed the 'onchange' event-handler on p1_act_code to be 'onchange=hilitebtn(this.value)'
4) Added the JS to the HTML Page Footer <script>
hilitebtn($v('P1_ACT_CODE'));
</SCRIPT>

Similar Messages

  • How to pass multiple values from workbook to planning function ?

    Hi,
    I have created Planning function in Modeler and it has one parameter(Variable represents = Multiple single values).
    When executing the planning function by create planning seq. in the web template : I see value of variable store data like ...
        A.) input one value -> V1
        B.) input three values -> V1;V2;V3
    This function execute completely in web.
    However, I want to use the planning function in workbook(Excel).
    The value of variable can't input V1;V2;V3... I don't know how to pass multiple values from workbook to parameter(Multiple single values type) in planning function ?
    thank you.

    Hi,
    Please see the attached how to document (page no 16).
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0881371-78a1-2910-f0b8-af3e184929be">how to</a>
    Hope this was helpful
    thanks

  • Catch a value from a pl*sql function in a shell script

    Hi all,
    I have a shell script that simply calls the following pl*sql function.
    echo "execute scott.my_pkg.test('FDLmaster');\n exit;" >./pippo.sql
    sqlplus scott/tiger @/fidcap_ftp/FDL/SCRIPTS/pippo.sql
    What I have to do to catch the value returned from the function test?
    Thanks in advance
    best regards
    Mario

    SQL> create or replace function do_something return varchar2 is
      2  begin
      3      return ('Something');
      4* end;
    SQL> /
    Function created.
    SQL> select do_something from dual;
    DO_SOMETHING
    Something
    SQL> save pippo
    Created file pippo.sql
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options
    [linuxas tmp test10]$ echo exit >>pippo.sql
    [linuxas tmp test10]$ VAR=`sqlplus -s scott/tiger @pippo`
    [linuxas tmp test10]$ echo $VAR | cut -f3 -d" "
    Something
    [linuxas tmp test10]$

  • Pass a list of number values to a pl/sql function

    I would like to pass a list of number values to a pl/sql function where the list will be used in an IN clause. Ideally I would like to do the following:
    CREATE OR REPLACE FUNCTION ( dept_list in varchar2) is
    begin
    select ... where dept in (dept_list) ;
    usage: process_list ( '7730,7735,7740,7745') ;
    I can not find an example of doing this in pl/sql function but it seems feasible.
    Is there a way to do this?

    user12088323 wrote:
    I would like to pass a list of number values to a pl/sql function where the list will be used in an IN clause.
    usage: process_list ( '7730,7735,7740,7745') ;The first thing is you need an appropriate data type to store a list of numbers. A single character value that looks to you like a list of numbers, is not in fact a list of numbers but a single character value.
    This example uses the built in data type odcinumberlist in a procedure, you can do the same in function
    Re: Passing an array to an Oracle stored procedure
    If you have an old version of the database you may need to create your own type with the same definition of odcinumberlist.

  • How to pass multi-value input parameter to SQL command

    I'm having trouble following the threads related to passing multi-value parameters to a SQL command.
    I need more details on the work-around that exists for using a dummy main report to GET the input parameters and pass them to a subreport parameter that uses the input parameters in its sql command WHERE clause.
    So far the main report prompts user to enter badge numbers into a multi-value string type parameter field called badgeNumber.
    The main report getRequesters command executes the following SQL:
    SELECT requester FROM lawprod.requester WHERE lawprod.requester.requester IN  '{?badgeNumber}'
    order by requester
    The main report also contains a formula called requesterList that concatenates the input parameters and separates the values with commas:  (Join ({?badgeNumber}, ", ")  
    So if user enters badge numbers 1 and 2 and 3 the value of requesterList is 1, 2, 3
    From the main report I've used the Insert Subreport command to choose an existing report, and used the link tab to link @requesterList to ?requester; where ?requester is a multi-value parameter that is used in the subreport's SQL query as shown below:
    WHERE (lawprod.ictrans.update_date <=  {?endDate} AND
           lawprod.ictrans.update_date >= {?startDate} AND
           lawprod.ictrans.doc_type = 'IS' AND
           lawprod.ictrans.system_cd = 'RQ' AND
           lawprod.mmdist.posting_type = 'O1')
          AND
          (lawprod.ictrans.company = lawprod.mmdist.company AND 
           lawprod.ictrans.system_cd = lawprod.mmdist.system_cd AND
           lawprod.ictrans.location = lawprod.mmdist.location AND
           lawprod.ictrans.doc_type = lawprod.mmdist.doc_type AND
           lawprod.ictrans.document = lawprod.mmdist.doc_number AND
           lawprod.ictrans.shipment_nbr = lawprod.mmdist.doc_nbr_num AND
           lawprod.ictrans.line_nbr = lawprod.mmdist.line_nbr AND
           lawprod.ictrans.component_seq = lawprod.mmdist.component_seq)
          AND
          (lawprod.ictrans.company = lawprod.reqline.company AND 
           lawprod.ictrans.document = lawprod.reqline.req_number_a AND
           lawprod.ictrans.line_nbr = lawprod.reqline.line_nbr AND
           lawprod.reqline.company = lawprod.reqheader.company AND
           lawprod.reqline.req_number = lawprod.reqheader.req_number)
           AND
           (lawprod.reqheader.requester in '{?requester}')
    Following execution of the main report, Crystal appears to prompt for three values as expected: badge numbers for the main report, and start and end dates needed by the subreport.   I can't figure out why Crystal XI returns no data. Can anyone explain what I'm missing?
    Edited by: Patricia Sims on Sep 21, 2009 9:30 PM

    The reason no data is returned is that the multiple values are not (properly?) passed to the main report's SQL.  The main report's SQL should be (MS SQL):
    select 1 as dummy
    This causes exactly one record to be returned, which will basically be ignored (except the fact that it will drive the subreport; any query that returns only 1 record will suffice...).
    Change the concatenation of the selected values to be (basic syntax):
    formula = "|" + join({?badgeNumber}, "|") + "|"
    The leading and trailing vertical bars are important (otherwise a database value of 1 might match a selection of 123).
    Pass the concatenated string as the parameter value to the subreport.  In your subreport, select records on (basic syntax):
    formula = (instr({?sr-badgeParam}, "|"+cstr({requester},"0") + "|") > 0)
    (assumes is numeric in the database, and is integer; modify or eliminate cstr() if otherwise...)
    Put your subreport on the detail format of the main report, and you're all set...
    HTH,
    Carl

  • How to pass the value from Sub report to main report

    I have un report(mainreport) within a subreport(subreport).
    With reporting services, how to pass the value from Sub report to main report?
    thanks

    Hi Alebet,
    With reporting services to pass values from sub report in to main report is not supported directly.
    But there are some workarounds through which you can get this .
    There are two ways to get this.
    1- Put your sub report query into some table. i mean to say through the subreport query get some temporary table.
    2- Using this temporary tables data write some Scala function in the data base.
    3- Now in your main report query return this scala function as a column.
    4- Extract the column value where ever you want in your main report which is getting calculated from the subreport query. so you will be getting the values returned from the subreport in the main report.
    This will definitely work fine as i have done some report in this way.
    Another way of doing is that
    1- prepare another data set with the same query as in sub report in the data tab.
    2- then refer this 2nd dataset in your main report .
    But better way will be the top one.
    Anyway please let me know if you get the solution.
    Thanks
    Mahasweta

  • Problem in Passing the value from child window to Parent window.

    Hi Frenz,
    I have a requirement like this. i have to pass a value from child window to parent window to one test field. That text field is not a normal text field.
    It was created like the following as SQL query.
    select
    ''LNo,
    apex_item.text(25,'',0,15,
    'style="width:100px;" onblur="javascript:showUpsell(this.value);" onkeypress="javascript:validateKeyPress(event,this.value,this.id);" onkeyup="javascript:this.value=this.value.toUpperCase();" id="P37_ITEMNO"') ItemNo
    Now i want to pass a value to the Item no from child window.
    i wrote the java script like this,
    opener.document.forms[0].f25.value="100";
    It was not working..Any suggestions for that..
    Thanks in advance

    Dear Baaju,
    How do you redirect your control from Child to Parent window.
    If you use a button to do this, then you can set this value in the branching of page.
    Rana

  • How to pass all values from one node element to created node element?

    Hi
    I have model node element under which there are 7 values, and I've created value node element and trying to pass the values from the model node Element to this value node element. But instead of passing all the values its listing only one value.
    How do we rectify this problem!!!
    Thanks in Advance
    Srikant

    Hi Anil
    I've created the node named: TableNode
    and the name of the node from which i want to get the data is : Li_Required_Node
    the Node Structure is
    Context
      |_ Zs_Quantity_Input
         |_Output
           |_Node_Required_Node
              |_Schddt
      |_TableNode
        |_CmpDate
    The Schddt has some 7 values
    The code Snippet is as follows:
    IPublicPricesComp.ITableNodeElement nodeElement;
    IPublicPricesComp.ILi_Required_NodeElement scheduleElement;
    int counter3Max = wdContext.ILi_Required_Node().size();
    for( int counter3= 0 ; counter3 < counter3Max ;counter3++ )
    nodeElement = wdContext.createTableNodeElement();
                             scheduleElement = wdContext.nodeZs_Quantity_Input().nodeOutput_Contract_Qty().nodeLi_Required_Node().getLi_Required_NodeElementAt(counter3);
    nodeElement.setCmpDate(scheduleElement.getSchddt());
    wdContext.nodeTableNode().addElement(nodeElement);               
    On writing the above code and then binding the node to a table column only one value getting displayed
    Where can be the error?
    Thanks in Advance
    Srikant

  • Passing the values from one pgm to another pgm (Calling pgm has no sel scr)

    Hi gurus,
    In my requirement i need to pass the values from one program to another program.
    I am using SUBMIT statement . But , the program which i am calling has no selection screen.
    So how can i pass the values?
    Please help me ASAP.
    Regards,
    Bhanu.R

    Export your internal tables or work areas to a memory id in ur program before u use submit.
    Then in second pgm you have to import from memory id given above.
    example.
    EXPORT gs_header FROM gs_header to memory id 'HEADER'.
    EXPORT gt_item FROM gt_item to memory id 'ITEM'.
    SUBMIT YFIIN_DISHC_MAILREPORT EXPORTING LIST TO MEMORY AND RETURN.
    In your second pgm you can write
    import gs_header TO gs_header from MEMORY id 'HEADER'.
    import gt_item TO gt_item from MEMORY id 'ITEM'.

  • Passing the values from subreport to master report in JasperReports

    Hi All,
    I want to pass the values from subreport to master report, but my subreport is without any query.
    Please help me in this regard. its urgent.
    Thanks & Regards
    Kris

    Hi,
    Below link may help you
    http://jasperreports.sourceforge.net/tips.tricks.html#returnvalues
    regards
    MJ

  • Passing filter values from column formula in OBIEE 10g

    Hi,
    I am trying to pass filter value from the column LY Spend YTD columns where we have a filter option and passing the year filter 2013 as below.
    FILTER("Fact - Purchasing - Invoice"."LY Spend YTD" USING (Time."Year" = '2013'))
    My goal behind doing this is, we have a filter already present for the whole criteria on the year which is 2012.
    But specifically for this column i dont want to pass the year 2012 to it, Instead I want to pass 2013 to it. But I am not succeding the result is blank.
    Please suggest and let me know if further understanding is needed.

    Hi Srini
    Thanks for you reply.
    I cannot do that way because some measures are satisfying with year 2012 and displaying the data and other measure are satisfying with 2013.
    I am working on LY Spend YTD, LY spend YTD - 1, Spend YTD and Year ago spend.
    So thats the reason I have thought that way of passing the filter in column formula irrespective of criteria filter.
    Please suggest.

  • How to pass the values from the Wb Dynpro Application to the SAP Backend ?

    Hi All,
    Good morning..,
    I have scenario like:
    I want to pass the values from the web dynpro appication to the SAP Back end R/3 Table. IN backend the RFC is writtn to accept the structure input from the Webdynpro.
    Upto know I imported the corresponding RFC and maaped to the View.
    How to proceed with the coding to save the data...
    PLease suggest...
    Regards and Thanks in Advance,
    CSP

    Hi  Pradeep
    Steps:
    1. First create an instance for bapi and bind the instance to the bapi node.
      Z<bapi name> zb=new Z<bapi name>();
      wdContext.nodeZ<bapi name>. bind(zb);
    2. Then if u have the import parameter u have to set them by using
        The instance of the above bapi.
        Zb.set<import parameters>;
    3. If the bapi has a table parameters then the structure for the table parameters will also be imported
       In the model class.
    4. Set the table parameters by creating the instance for that structure and using this instance set it.
       Z<Struct>itm tab=new Z<Struct>();
       Tab.set<table parameters>
    5. Then add the structure instance to the bapi instance.
        Zb.add(Tab);
    6. Then Execute the bapi after setting the import parameters.
    7.  If there is any export parameters, then get the values after execution.
    Look at this thread for codes
    Re: RFC call on click of button
    Regards,
    Arun

  • Is it possible to pass  a value from the list to another page..

    Hi everyone,
    I created a (list region) on a page and there is a FORM on the same page.I am trying to pass a value from that page to another page when the user selects one of the list entries.I tried with SET THESE ITEM.. WITH THESE VALUES in the list entries like
    SET THESE ITEMS--P13_TESTING_ID
    WITH THESE VALUES --&P10_ID.
    but its not working for me.I want to pass that value only when the user hits that list entry.Is it possible to do.
    Thanku
    phani

    Assuming P10_ID is an item on the FORM, I think , the form would have to be posted (submitted) for the item's vaue to be available in session state.

  • Passing a value from internal table to a powerpoint slide

    Hi,
    Does anyone know how to pass a value from internal table to a powerpoint slide?  I would also need some codes with regards to the coding to open the powerpoint and insert the value in.
    Thanks.
    Points will be awarded.
    Hope to hear from you soon.
    Lawrence

    geez!! do feel sorry for you
    you can fire FM WS_EXECUTE to open power point but passing a variable at run-time i'm not sure, sorry.

  • How to pass the value from JSP or HTML  to Applet

    Plz reply ....How can we pass the value from the JSP Page or from HTML page to Applet embedded in same page....

    Hi,
    <applet codebase = "."
    archive = foo.jar"
    code = "com.bar"
    name = "bar"
    id = "bar"
    width = "<%=Request["width"] %>"
    HEIGHT = "<%=Request["appHeight"] %>"
    hspace = "0"
    vspace = "0"
    align = "middle"
    alt     = "Applet is Loading..."
    >
         <param name="LANGUAGE"                value="<%=Request["lan"] %>">          
         <param name="LOGOUT_USER_URL"           value="EndSession.asp">
         <param name="DATA_READ_INTERVAL"      value="10000">
         <param name="REFRESH_INTERVAL"           value="5000">     
         <param name="DEFAULT_FONT"           value="Arial">
    </applet>
    pass values @ ur html or jsp page to Applet as parameters.
    Refer above code. By using getParameter() method of Applet, u can take values inside applet.

Maybe you are looking for

  • Windows XP Media Center Edition FAQ

    What is a Media Center PC? It is basically a regular PC, but designed to fit into your home entertainment system to replace your DVD player, Hi-Fi, TV set-top box, as well as allowing other functions as email, web browsing and more, all from the comf

  • How can I turn OFF iTunes Match on ALL devices?

    I am in Australia and just paid AUD34.99 last night to buy iTunes Match and have had so much trouble with it since I want to turn it OFF on all devices.  Ideally I'd love a refund but understand that terms and conditions may limit this - though am re

  • Flash is installed ,but not seen by Chrome or Firefox

    Here is what I checked in Chrome , I have:  Adobe Flash Player - Version: 15.0.0.189 Shockwave Flash 15.0 r0 This is installed but not being recognized by  either firefox or chrome. I am on a WIN 8.1 pc and IE does not work so it is disabled/turned o

  • Syncing contacts with Facebook and contact visualization in dialer

    Hi,  I have spent a lot of time trying to sync and consolidate my contacts from Google and Facebook. I did have a couple of issues however and I am looking for advise.  1) Contact photo from Facebook are very low res and blurry.      - Xperia with Fa

  • How do i get rid of the charge on my debit card for online backup?

    how do i get rid of the charge on my debit card for toshiba online backup? Backup has not been functional for months. I called the customer service number and eventually was transfered to some apartment complex phone number.