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

Hey guys,.

Have a question on how to pass a value of a PL/SQL to a JavaScript function in the HTML header.

I created a PL/SQL function in my database, which makes a loop.
The reason is: on my apex page when the user selects a code, it should display (or highlight the buttons) the different project id is present for that particular code.

example = code 1
a project id = 5, 6, 7

code 2
a project id = 7.8

Thank you for your help or Suggestions
Jesh

The PL/SQL function:

Contact_details (ACT_CODE1 in NUMBER) of the FUNCTION to CREATE or REPLACE RETURN VARCHAR2 IS
Project_codes varchar2 (10);
CURSOR contact_cur IS
SELECT ACT_CODE, PROJECT
OF ACTASQ. ASQ_CONTACT where ACT_CODE = ACT_CODE1;
currec contact_cur % rowtype;
/******************************************************************************
NAME: contact_details
PURPOSE:

REVISIONS:
Worm Date Description of the author
--------- ---------- --------------- ------------------------------------
1.0 06/25/2009 1. Created this function.

******************************************************************************/
BEGIN
FOR currec in contact_cur LOOP
dbms_output.put_line (currec. PROJECT | '|');
Project_codes: = currec. PROJECT | '|' || Project_codes;
END LOOP;
RETURN Project_codes;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHILE OTHERS THEN
-Consider recording the error and then re-raise
LIFT;
END contact_details;
/

Tags: Database

Similar Questions

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

    I would like to pass a list of 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)
    Start
    Select... where dept in (dept_list);

    use: process_list ('7730,7735,7740,7745');

    I can't find an example to do based on pl/sql, but it seems feasible.
    Is there a way to do this?

    user12088323 wrote:

    I would like to pass a list of values to a pl/sql function where the list will be used in an IN clause.

    use: process_list ('7730,7735,7740,7745');

    The first thing is that you need an appropriate data type for storing a list of numbers. A unique value that look you like a list of numbers, is not actually a list of numbers but a single character value.

    This example uses the built in odcinumberlist data type in a procedure, you can do the same in function

    Re: Pass an array to an Oracle stored procedure

    If you have an older version of the database, you may need to create your own type with the same definition of odcinumberlist.

  • Passing the value from one page to the other page

    Hi gurus,

    I need to pass the value from one page to the other page and two pages use different AMs.
    In the first page I have sellers results region table where the $vendor_name column is a hyperlink that navigates to the page Vendor_Sites. Now after accessing the second page, I want to excute the VendorSitesVO in PR of CO based on the value passed to VendorsVO (vendor_id) of first page.

    can someone help me on this?

    Thank you
    Vincent.

    Published by: user4933347 on December 4, 2009 12:19 AM

    You can set parameters of Pagecontext and transmit values through them. These values can be passed between pages, even if the AMs are different.

    Try:
    pageContext.putParameter ("Parameter1", value1);
    pagecontext.setForwardURL (second page)

    Concerning
    Sumit

  • Who knows how to pass a value from the form on the next page of javascript?

    I have a simple drop-down list. Maybe this isn't the best way, but I use the MM_goToURL function on the onchange event. It works very well so he can redirect without clicking on the submit button.
    What I need to do, it's pass the value selected on the next page and grab it so I can use Coldfusion to manipulate the results.

    Help, please.

    The answer is too simple. Just use javascript to submit the form onchange.



  • How to pass a value from table in to another using java-oracle script: apex 5.0

    Hello

    Step 1:

    Two Table (product, product 2)

    Created an IR where all data are from Table Product

    -> a cell in the column is editable.

    Step 2:

    Whenever the user change certain values of cell and click on the button set to day then cell value must also be updated in the table leader2.

    -> entire product line (table) must be inserted into the product 2 (table) with update of the cell value.

    JS:

    var arr_f01 = [];

    () $("input[name='f01']").each

    function() {}

    If ($(this).) Val() > 0)

    {

    arr_f01.push ($(this).) Val());

    }

    });

    (apex). Server.Process

    "Update".

    {f01: arr_f01,}

    {dataType: "text", success: function (pData) {alert ("' data inserted into the Table Product");}}

    } }

    );

    Thank you.

    Hi Dominique,.

    Pranav.Shah wrote:

    Hello

    Step 1:

    Two Table (product, product 2)

    Created an IR where all data are from Table Product

    --> A cell in the column is editable.

    Step 2:

    Whenever the user change certain values of cell and click on the button set to day then cell value must also be updated in the table leader2.

    ---> Whole product line (table) must be inserted into the product 2 (table) with update of the cell value.

    JS:

    var arr_f01 = [];

    () $("input[name='f01']").each

    function() {}

    If ($(this).) Val() > 0)

    {

    arr_f01.push ($(this).) Val());

    }

    });

    (apex). Server.Process

    "Update".

    {f01: arr_f01,}

    {the data type: 'text', success: function (pData) {alert (' ' data inserted into the Table Product ');}}

    } }

    );

    Thank you.

    Follow the steps below.

    Step 1: Give static id to the other columns in your interactive report

    Attributes of the region-> column-> Id static definition

    Step 2: change your Javascript code to read values of other columns

    check the line no 8, in this way, you can read the value of other columns and push that in table

    This is the static id of the column I given EMPNO.

    do the same for the other columns you want to insert.

    var arr_f01 = [];
    var arr_f02 = [];
    var empno;
    $("input[name='f01']").each(
    function() {
    if($(this).val() > 0)
    {
      empno = $(this).closest('tr').children('td[headers="EMPNO"]').text();
      arr_f01.push($(this).val());
      arr_f02.push(empno);
    }
    });
    
    apex.server.process (
      "Update"
    , {  f01: arr_f01, f02: arr_f02
      }
    , { dataType: 'text',success: function(pData){alert('Data Inserted in Product Table');
    } }
    );
    

    Step 3: use tables in your ajax process to insert the record., replace your table name and the columns

    begin
    for i in 1..apex_application.g_f01.count loop
    insert into test(A,B) values (APEX_APPLICATION.G_F02(i),APEX_APPLICATION.G_F01(i));
    commit;
    end loop;
    end;
    

    Hope this helps you,

    Kind regards

    Jitendra

  • passing multiple values from the query in the select statement of the procedure

    I am collecting IDS to select education agreement from the date of rental values and then I would pass the result of the query in the statement select to get the result.
    data type for the contract id is of type varchar and date of rental there is more than one id to contract for most of the time. Help, please. Thank you

    CREATE OR REPLACE PROCEDURE abstract_menu (p_letting   IN     VARCHAR2,
                                               p_results      OUT SYS_REFCURSOR)
    IS
       v_contractId   VARCHAR2 (40);
    
    SELECT lcontid
      INTO v_contractId
      FROM letprop
     WHERE datestat IS NOT NULL AND letting = p_letting AND letstat <> 'R';
    
    
    BEGIN
       OPEN p_results FOR
            SELECT DISTINCT
                      SUBSTR (l.letting, 3, 2)
                   || '-'
                   || SUBSTR (l.letting, 5, 2)
                   || '-'
                   || SUBSTR (l.letting, 1, 2)
                      lettingdate,
                   l.lcontid contractid,
                   SUBSTR (q.cprojnum, 1, 10) projectnumber,
                   DECODE (TRIM (MIN (j.route)), NULL, 'N/A', TRIM (MIN (j.route)))
                      routenumber,
                   L.DATESTAT statusdate,
                   L.LETSTAT lettingstatus,
                   (q.cdescr) jobdescription,
                   INITCAP (q.clocat1 || q.clocat2) LOCATION
              FROM vendor v,
                   vendaddr r,
                   letprop l,
                   planhold p,
                   proposal q,
                   project j,
                   propproj k,
                   bidlet bd
             WHERE     v.vendor = r.vendor
                   AND k.contid = q.contid
                   AND k.pcn = j.pcn
                   AND l.lcontid = k.contid
                   AND p.vendor = v.vendor
                   AND l.letting = p.letting
                   AND l.lcontid IN v_contactid  "**************This is where I would like to pass the contract id from the above select statement***********'"
                   AND l.CALL = p.CALL
                   AND r.addrnum = p.billto
                   AND bd.letting = l.letting
          GROUP BY q.cdescr,
                   q.clocat1,
                   q.clocat2,
                   bd.letting,
                   l.letting,
                   l.lcontid,
                   q.cprojnum,
                   L.LETSTAT,
                   L.DATESTAT
          ORDER BY lettingdate;
    
    end;

    user9196150 wrote:
    AND l.lcontid IN v_contactid ' * this is where I would like to pass the id of the select statement above contract * ""»

    CREATE OR REPLACE PROCEDURE abstract_menu (p_letting   IN     VARCHAR2,
                                               p_results      OUT SYS_REFCURSOR)
    IS
    BEGIN
       OPEN p_results FOR
            SELECT DISTINCT
                      SUBSTR (l.letting, 3, 2)
                   || '-'
                   || SUBSTR (l.letting, 5, 2)
                   || '-'
                   || SUBSTR (l.letting, 1, 2)
                      lettingdate,
                   l.lcontid contractid,
                   SUBSTR (q.cprojnum, 1, 10) projectnumber,
                   DECODE (TRIM (MIN (j.route)), NULL, 'N/A', TRIM (MIN (j.route)))
                      routenumber,
                   L.DATESTAT statusdate,
                   L.LETSTAT lettingstatus,
                   (q.cdescr) jobdescription,
                   INITCAP (q.clocat1 || q.clocat2) LOCATION
              FROM vendor v,
                   vendaddr r,
                   letprop l,
                   planhold p,
                   proposal q,
                   project j,
                   propproj k,
                   bidlet bd
             WHERE     v.vendor = r.vendor
                   AND k.contid = q.contid
                   AND k.pcn = j.pcn
                   AND l.lcontid = k.contid
                   AND p.vendor = v.vendor
                   AND l.letting = p.letting
                   AND l.lcontid IN (
                                     SELECT  ll.lcontid
                                       FROM  letprop ll
                                       WHERE ll.datestat IS NOT NULL AND ll.letting = p_letting AND ll.letstat  'R'
                                    )
                   AND l.CALL = p.CALL
                   AND r.addrnum = p.billto
                   AND bd.letting = l.letting
          GROUP BY q.cdescr,
                   q.clocat1,
                   q.clocat2,
                   bd.letting,
                   l.letting,
                   l.lcontid,
                   q.cprojnum,
                   L.LETSTAT,
                   L.DATESTAT
          ORDER BY lettingdate;
    
    end;
    /
    

    SY.

  • in PHP how pass a value from the recordset object via a url

    I have a blog set up with PHP/MySQL with two tables (1 table for blog entry) and 1 table for comments on the blog
    I can view the blog and the comment with a LEFT JOIN recordset like this-
    SELECT golf_blog.blog_ID, DATE_FORMAT (golf_blog.blog_created, "%%b, %Y ') AS blog_created, golf_blog.blog_author, golf_blog.blog_subject, golf_blog.blog_article, blog_comments.comment_article
    FROM golf_blog LEFT JOIN blog_comments using (blog_ID)
    ORDER BY golf_blog.blog_created ASC

    I have a link in the this object recordset repeat region goes to a page containing the comment drag.
    blog_ID is the primary key of the table blog and blog_ID is the index in the array of comment.

    How do you pass the blog_ID of the recordset on a text field in the form of comments via the link insertion?
    Or am even thinking about it in the right way?

    I figured it out and got it to do work in passing the blog_ID as a variable on the URL of the comment form page

    the link looks like this
    ">Comment

    and on the comment page used this code

    $blog_ID = $_GET [$blog_ID]? >

    and the Insert field value is

    I guess that reading David Powers begins to bear fruit. Eureka!

  • is it possible to pass the value of the variable validation function return Boolean message?

    Selection_012.pngSelection_013.png

    Assume that L_BATCH_NAME is the name of the variable which will receive the value as

    declare

    l_batch_name: = "NA";

    BEGIN

    L_BATCH_NAME: = FUNCTION (PARAMETERS);

    IF CONDITION > 0

    THEN

    RETURN FALSE;

    ON THE OTHER

    RETURN TRUE;

    END IF;

    END;

    Hi Reema,

    ReemaPuri wrote:

    Assume that L_BATCH_NAME is the name of the variable which will receive the value as

    declare

    l_batch_name: = "NA";

    BEGIN

    L_BATCH_NAME: = FUNCTION (PARAMETERS);

    IF CONDITION > 0

    THEN

    RETURN FALSE;

    ON THE OTHER

    RETURN TRUE;

    END IF;

    END;

    1. create a hidden item I say P1_HIDDEN_ITEM

    2 type the error message for this element in your process of

    declare
    l_batch_name:='NA';
    
    BEGIN
    :P1_HIDDEN_ITEM := FUNCTION(PARAMETERS);
    IF CONDITION > 0
    THEN
    RETURN FALSE;
    ELSE
    RETURN TRUE;
    END IF;
    END;
    

    3 and refer to this element hidden in the error message.

    Record for the batch '||&P1_HIDDEN_ITEM.||' already exists.
    

    Kind regards

    Jitendra

  • Passing the value from one page to the other

    Hello

    I'm trying to display a page popup with an IR as below.

    1. There is a field next to a button.

    2 at the click of the button I want to get an Id and the value of a text field for step 1 on page popup and use them as a filter condition.

    3. I wrote a dynamic action that has the consequence of the "real" actions

    "a. the with action run PL/SQL code", which affects the value of the url a hidden point as below

    : P111_SHOWLOCATION_URL: = APEX_UTIL. PREPARE_URL ('f? p = & APP_ID.:112: & SESSION.: P112_PICKLISTID, P112_QUANTITY: & P111_PICKLISTID, & P111_QUANTITY.');

    "b. action run Javascript code" that displays an alert for one blank on the other shows the popup

    If {(apex.item("P111_QUANTITY").isEmpty ())}

    Alert ("Please enter the quantity to show locations.");

    }

    else {}

    popUp2 ($v ('P111_SHOWLOCATION_URL'), 700,300,0, 0);

    }

    When I change the value of the field in step 1 and press the button. There are only the old value not the new value. What's wrong with this code?

    Apex 4.2 | Windows | CROME browser

    Concerning

    Sanjaya

    Sanjaya Kumar Pradhan wrote:

    Yes, I mentioned as below in the Articles Page to submit

    P11198_PICKLISTID, P11198_QUANTITY

    : P111_SHOWLOCATION_URL: = APEX_UTIL. PREPARE_URL('f?p=&APP_ID.:112:&session.:::P112_PICKLISTID,P112_QUANTITY:&P111_PICKLISTID.,&P111_QUANTITY.');

    Why are the names of different elements?

    The new P111_SHOWLOCATION_URL value is specified to be returned in the Items property of the Page to return?

  • Passing a value from one table to another

    Access database:
    I have 2 tables, table 1 has a field that is a primary key (not indexed, no dups), table 2 has a field that should receive the same number as the table represented in 1.
    The problem is that when the query runs, it gets the MAX (number), but when it is inserted in table 2, all records in table 2 are updated with this number.
    Is there a way to prevent all the records in a table 2 updated and only the most recent file receiving the number in table 1?
    Any ideas?

    This is my query:

    < cftransaction >

    < cfif len (trim (form. GT Time_Spent)) 0 >
    < cfquery "InsertRecord' datasource = name ="NBProdReports">
    Insert Into TblMasterTrans (Time_Spent) Values ('#form.) Time_Spent #')
    < / cfquery >
    < / cfif >

    < cfif len (trim (form. WG Notes)) 0 >
    < cfquery "InsertRecord' datasource = name ="NBProdReports">
    Insert into TblContractInfo_SubMenuTable (Contract_Number, Transaction_Type, Num_Checks_Trans, Notes)
    Values ('#form.) Contract_Number # ',' #form. Trans_Type # ',' #form. Num_Checks_Trans # ',' #form. Notes #')
    < / cfquery >
    < / cfif >

    < name cfquery = "getTask_Number" datasource = "NBProdReports" >
    SELECT MAX (Task_Number) AS theTask_Number
    Of TblMasterTrans
    < / cfquery >

    < name cfquery = "SetTaskNumber" datasource = "NBProdReports" >
    Update TblContractInfo_SubMenuTable
    Set
    Task_Number = #getTask_Number.theTask_Number #.
    Where Task_Number = Null
    < / cfquery >

    < / cftransaction >

    In fact, you could even with impunity with a single query by selecting the Task_Number MAX in the second insert statement.



    Insert Into TblMasterTrans (Time_Spent) Values ('#form.) Time_Spent #')



    Insert into TblContractInfo_SubMenuTable (Task_Number, Contract_Number,
    Transaction_Type, Num_Checks_Trans, Notes)
    SELECT MAX (Task_Number), ' #form. Contract_Number #'.
    ' #form. Trans_Type # ',' #form. Num_Checks_Trans # ',' #form. Note #'
    Of TblMasterTrans

    Phil

  • value from the point of view put in javascript

    How to set the value of the element "Show text" via javascript?

    Tried this
    $x (pFieldName) .value = data;
    But this does not work for a type of item "Show text" while working for an item of type text.

    H

    Use .innerHTML rather than .value

    See you soon

    Ben

  • Passing values from a CO of a page in the xml file of a field with LOV.

    Hello

    I have 2 pages in this CUSTOMIZATION and the 2nd page got fields that have their turn to LOV.

    The query behind the LOV is sitting in the XML file and as an amendment to this motion, he needs some dynamic values

    I got to a stage where in the Commander of the 2nd page I set up values using getparameters.

    But how to pass this value from the 2nd page to the XML FILE.

    Thank you

    Regis

    Hi Regis

    Leave; s first focus on your first build errors. You said very well reconstruction work but compilation error comes when you run the page.

    It's strange. Can you please confirm if you have added the OFA libraries to your project. Ideally, they should be there once you create an OA project

    Concerning

    Marie Lise S

  • Passing values from one scene to the other

    Hello, how can I pass a value from a textbox in scene1 to another area of text that is in scene2?

    In scene 1, you might have...

    var str:String = t1.text;

    and to scene 2, you might have...

    T2. Text = str;

  • Dynamically by passing the values in the columns

    Hi all

    I'm trying a pl/sql block that take a string and execute it dynamically. Suppose that here is the string

    M_COL: = Q' [(Code_P = > ': DEPTNO', P_CODE_TYPE = > "ÉTAT")]';

    Now try to run. using below

    M_STR: = 'SELECT CHK_DEPT ' | M_COL | ' FROM EMP WHERE EMPNO = "7499" ';


    RUN IMMEDIATELY M_STR

    IN M_DATE;

    Now what I want is M_STR vairable executed as

    SELECT CHK_DEPT (Code_P = > DEPTNO, P_CODE_TYPE = > 'STATE') FROM EMP WHERE EMPNO = '7499'

    Instead of

    SELECT CHK_DEPT (Code_P = > 'DEPTNO', P_CODE_TYPE = > 'STATE') FROM EMP WHERE EMPNO = '7499'

    another other way in the Code_P column DEPTNO value parameter must be passed. Also note that the DEPTNO column in the M_COL string is Dynamic.i.e

    M_COL: = Q' [(Code_P = > ': DEPTID', P_CODE_TYPE = > "ÉTAT")]'; OR

    M_COL: = Q' [(Code_P = > ': EMP_ID', P_CODE_TYPE = > "ÉTAT")]';

    Any suggestions, please share with me.

    And also, please don't bother much about the data and the output of function. If I get a way to pass the value of the column in function, my problem is solved.

  • Copy the default value from another field in the same page

    Hello

    I need to pass a value from one page to another page and I want to use this key as DEFAULT VALUE for a field.

    If I create a form tabular all it's ok, but if I create a normal page. I am not able to do that.

    1. 1. I call the page and I pass the value. I also have a FIELD of VIEW and I can see the correct value.
    2. 2. I create a field with attributes of this:
      1. a. source > Source = database column type
      2. b. sources > Source value or expression = FK_ID_DA (the column name)
      3. c. default > default = P27_PK_ID_DA (the field that contains the value)
    3. 3. on the screen, I see P27_PK_ID_DA and not the value

    Where is the error?

    Thank you very much

    TexasApexDeveloper wrote:

    You missed one: before the variable, without it, the default value is the string...

    Not sure that you can READ the other pages... Such that if you are on Page 27 and have a field that you want to use on page 30, page 27 is presented and its items in session state, you can 'see' on page 30.

    So, if you set the default value: P27_PK_ID_DA, then you should get by default, you are looking for...

    Only if the default value Type is set on the PL/SQL Expression. If the literal value "P27_PK_ID_DA" is seen then the Type of default value should currently be set static text with Substitutions of State of Session, in which case the value of session state must be referenced using the syntax of substitution string:

    &P27_PK_ID_DA.

Maybe you are looking for

  • Can I track a specific cell in a chart?

    I'm tracking my current value will GO into a worksheet based on the value from the beginning of the year. I figured out how to display percentage increase/decrease and increase overall. I created a chart and found that I could score the maximum value

  • Questions to THE El Capitan fixed yet 2016?

    Is anyone know if validation in Logic Pro X is resolved for all the current versions of * contact * play 4 East West * sampltank in El Capitan 11.3 yet? IMac 13.1 2.9 16 GB 1 Yosemite 10.5

  • DV7 - 7227 windows 7 drivers

    looking for drivers for my desire dv7-7227 cl for windows 7 SM Bus Controller PCI\VEN_1022 & DEV_780B & SUBSYS_1833103C & REV_14 PCI\VEN_1022 & DEV_780B & SUBSYS_1833103C PCI\VEN_1022 & DEV_780B & CC_0C0500 PCI\VEN_1022 & DEV_780B & CC_0C05 USB CONTR

  • Screen stuck on 'Save settings' when connecting and closed times

    Original title: I've been having this problem since last week. Whenever I stop or restart my laptop, it always crashes right on the screen that says 'to save your settings.   I saw this problem since last week. Whenever I stop or restart my desktop c

  • HP Officejet 8500, A909a series, scanning, fax or copy

    Whenever I scan, copy or fax documents usning the auto feed on top of the printer, the documents resulting from this process themselves with a line down the center of the document.  What causes cela and how to eliminate the line?  If I use the glass