By the way a column value to Javascript

Hi all

I have an interactive relationship with the following SQL:

Select

EmpNo,

Ename,

"< a href =" # "onclick = 'test ("show it");' > ' |" jobs jobs | "< /a > ' job

de)

Select 10 empno, ename 'John', 'Manager' of the double job

Union

Select the 20 empno, ename 'Bookmark', 'Clerk' double work

)

Here is the definition of the test() function:

< script type = "text/javascript" >

function test (x) {}

Window.Alert (x);

}

< /script >

The report works very well. I can click on the column values of work e.g. Manager, the value hardcoded clerk alerts and function 'show it '. I want to show the value of employment, so if I click Manager, the alert must be 'Manager' and if I click on clerk then the alert should be "clerk." I tried to call the function like test(#job#) but no use.

Help, please.

Thank you

ZKay wrote:

I have an interactive relationship with the following SQL:

Select

EmpNo,

Ename,

'' | job |'' as job

de)

Select 10 empno, ename 'John', 'Manager' of the double job

Union

Select the 20 empno, ename 'Bookmark', 'Clerk' double work

)

Here is the definition of the test() function:

The report works very well. I can click on the column values of work e.g. Manager, the value hardcoded clerk alerts and function 'show it '. I want to show the value of employment, so if I click Manager, the alert must be 'Manager' and if I click on clerk then the alert should be "clerk." I tried to call the function like test(#job#) but no use.

It does not seem very useful, but all that is needed is to concatenate the value of employment in the event hours code:

select
  empno,
  ename,
  '' || job || '' as job
from(
select 10 empno, 'John' ename, 'Manager' job from dual
union
select 20 empno, 'Mark' ename, 'Clerk' job from dual
)

Tags: Database

Similar Questions

  • Search file, return of the other excel column value

    I tried the Excel research and this pension, but have not found something that can help yet. I have an Excel file which contains three columns. I want to find the first column with a value (1-99), and then returns the value of this same line, but the 3rd column. About the same as the VLOOKUP function, but I have not found a way to do in LV here is a basic example:

    Column1 | Column 2 | Column 3

    LB/01 PO2 3

    .

    .

    20 PEA 2

    For example, if '20' is entered, it will return the value "2".

    Thanks again

    buickgn wrote:

    About the same as the VLOOKUP function, but I have not found a way to do in LV

    Thanks again

    Well, use the VLOOKUP function then of _Application WorksheetFunction (a reference range for the Argument 2 pass).

    Ben64

  • By the way a column as a parameter name

    Good afternoon

    I was wondering if any of you ever come across the following situation and found a way to work around...

    I recently created a PivotTable using SQL query (body of function from PL/SQL returning SQL query).

    The table was composed of the following information:
    -Date range, Type of object, and count.

    The final table looks like this (forgive the lack of fancy markup, if all goes well he will get the message):
    Date        Object A    Object B    Object D    Object G
    01-apr-09   10           16         50          43
    02-apr-09   1            15         77          35
    03-apr-09   19           0          14          17
    04-apr-09   15           7          70          20
    05-apr-09   7            6          65          50
    And he keeps going.
    I had to create the code dynamically because I don't know what objects I will get course in the same range of dates (for example: I could have something to object C and nothing for object D in March). I had a loop of the cursor in the types of objects before creating the SQL query that creates the table above.

    The table now works fine. What I'm trying to do now is to do a little data mining.

    Since everything is built dynamically, I can't give the real column names in my report. Is it possible that, when I click on, for example, the '10', on April 1 in one who opposed the column heading 'Object A' is passed? #COL02 # pass only the value '10', which is not what I want, and I have tried other variations such as: COL02 and & COL02. without much luck.

    If you can shed some light on this problem, that would be greatly appreciated!

    Thank you for your time.

    Ivan

    Hello

    You can also use the substitution #COLUMN_HEADER # (ie. not #COL2 #, but in fact #COLUMN_HEADER #)

    See you soon

    Ben

  • By the way Select list value to another page via report link

    Hello

    I have a page 1001 with an item from the selection list (SLI), a button (BTN) and a report (EPR).

    After selecting a value of the element of selection it s possible to click on the button.

    After clicking the report button will display the data. Report structure: ID, COL1, COL2, COL3, COD values in COL1 is the links to the page 1011.

    I managed to pass the value of a column in the report, but how to pass the value of SLI this link?

    I tried: SLI, SLI, #SLI # and & SLI... but nothing has worked.

    You have an idea?

    1013248 wrote:

    Please update your forum profile with a real handle instead of '1013248 '.

    I have a page 1001 with an item from the selection list (SLI), a button (BTN) and a report (EPR).

    After selecting a value of the element of selection it s possible to click on the button.

    After clicking the report button will display the data. Report structure: ID, COL1, COL2, COL3, COD values in COL1 is the links to the page 1011.

    I managed to pass the value of a column in the report, but how to pass the value of SLI this link?

    I tried: SLI, SLI, #SLI # and & SLI... but nothing has worked.

    You have an idea?

    Use the exact static text substitution method to reference the value of the element. This requires an end point ('.) ») :

    &SLI.
    
  • by the way check box values in the WHERE clause

    Hello

    I created a data block - 'CONTACT' (block of data in database)

    and has an element of database - 'Code', 'Descr '.

    The number of records displayed has the value 5.

    When enabled - value 'Y '.

    Value when disabled - n

    Box mapping of other values - "unchecked."


    I write the code inside "WHEN the BUTTON PRESS. My main goal is to return the number of records from

    According to several conditions and one among them is the CODE which can be single or multiple based on the checked checkbox.

    The requirement is when I check one or more boxes, I should pass the "Code" element values in the WHERE clause.

    I tried to use the simple loop but things havmt worked as shown below.

    The next_record refers to the COCHEE BOX as well, and thus return all the eventhough lines if it is not checked.

    ----------------------------------------------------------------------------

    -LOOP

    IF: contact.cb = 'Y' THEN

    LOOP

    IF p_where is null then

    p_where: =: contact.code;

    on the other

    p_where: = p_where | «, » || : contact.code;

    end if;

    When the output: system.last_record = "TRUE";

    next_record;

    END LOOP;

    end if;

    -END LOOP;

    MESSAGE ("p_where :'|| p_where);

    MESSAGE (' ');

    END;


    ------------------------------------

    And even if I write the LOOP before the first CASE, it returns me the current value and move to the last record.

    Please suggest

    Try something like this:

    FIRST_RECORD;
    
    LOOP
    
      IF :contact.cb = 'Y' THEN
        IF p_where is null then
           p_where := :contact.code;
         else
           p_where := p_where ||','||:contact.code;
         end if;
       END IF;
      exit when :system.last_record = 'TRUE';
      next_record;
    END LOOP;
    
    -- END LOOP;
    MESSAGE ( 'p_where :'||p_where);
    MESSAGE (' ');
    
    END;
    
  • The value of the cell in column

    Hello

    We report with a number of columns and columns of cells have value with a lot of characters (more than 100). We want to adjust the value of the cell in this column for example 20 characters and all characters of the value of the cell in column value of title HTML TD as "flag". Something like this:

    < code >
    "< td #ALIGNMENT headers # =" "#COLUMN_HEADER_NAME #" title = "#FULL_COLUMN_VALUE #" class = "data" > #TRIMED_COLUMN_VALUE # < table >
    < code >

    We can do as a model? You have an idea?

    I have an idea that uses JavaScript and the value of the total column in the hidden column, but I thing that there could be a better way to do this :-)

    Regarding.

    David

    Published by: user4893970 on November 23, 2010 16:11

    While I don't think that there is a way to do it with a normal report

    If it's a standard and not interactive report, then it can be done using the column Expression of HTML:

    #TRIMMED_COLUMN_VALUE#
    
  • A combine with other values of the column, the column values


    Hi all

    I need your help on this. I have a req I need to combine values of a percentage to the values of column test column. Here are examples of data

    Select decode('test',null,'ABC') abc, b.percent, b.amount

    from tableA, tableB b

    where id = b.id

    Examples of data

    Amount of the percentage TEST

    ABC              0.3                10

    ABC              0.5                20

    ABC              0.2                30

    After him combine the values of percentage to the ABC percentage column values must be zero

    Desired output

    Amount of the percentage TEST

    ABC(30%)                              10

    ABC(50%)                              20

    ABC(20%)                              30

    Valuable suggestions are appreciated

    Alter the query from Etbin with a trifle for the exact release.

    with

    t as

    (select 'ABC' test, 0.3 percent, 10 amount of all the double union

    Select 'ABC', 0.5, 20 double Union all

    Select 'ABC', 0.2, 30 double

    )

    Select test | ' ('| to_char(100 * percent) |'%)' test, null as a percentage, the amount

    t

  • By the way the value of the report column in Javascript

    Dear magicians Apex,
    I am a bit stuck now to implement a modal pop-up/iframe/javascript and this forum is my last hope to solve this problem.
    Anyway, I will try to explain what I'm trying to accomplish.
    What I need, is: I want to have a SQL report, as first column I want to have an 'ID' of my table numbers and I want this column to have a "link in the column" located in the appropriate links "column attributes. The thing is that when I click on the link of the column (when I run my report on the Apex page) I need a JQuery modal window where the pop-up in IFrame will be another page and this page uses an 'ID' of my link URL column to display the data. So, basically, I want to pass a value of 'ID' of my page parent to my page of the child which appears in an iFrame modal window.
    And here's what I have:
    1. I have a SQL report:
     
    select SUBNET_ID, 
           long2ip(NETWORK_ADDRESS), 
           long2ip(SUBNET_MASK), 
           long2ip(END_HOST), 
           long2ip(START_HOST), 
           MAX_HOSTS, 
           long2ip(BROADCAST_IP), 
           NETWORK_CLASS, 
           NETWORK_SIZE, 
           HOST_SIZE 
    from   YC_CM_IP_SUBNETS 
    2 then, in 'The column attributes' to 'SUBNET_ID' a have put a "link in the column" URL like:
    javascript:ViewNetworkDetails(#SUBNET_ID#);
    3. now, when I run my page and point my mouse over any item in my column "SUBNET_ID", I see that she receives a number of "SUBNET_ID" of my table and it shows it in the button of the browser as:
    javascript:ViewNetworkDetails(1);
    , or (2) or anything that is 'SUBNET_ID '. So, that's good.
    4 and here I am confused, basically, I need to pass a value of
    javascript:ViewNetworkDetails(#SUBNET_ID#);
    , which seems to work as it gives me good numbers of my table to my 'ViewNetworkDetails' JavaScript function, then it can paste this value in "f?" p =... "IFrame URL. Here is my Jquery Modal script form and Javascript to redirect me to my popup page (the script is located in the HTML header):
     
    <script type="text/javascript"> 
    function ViewNetworkDetails(){ 
    var apexSession = $v('pInstance'); 
    var apexAppId = $v('pFlowId'); 
    var subnetIDNumber = document.getElementById(#SUBNET_ID#); 
    
    $(function(){ 
    vRuleBox = '<div id="ViewNetworkDetailsBox" title="View Subnet Details"> 
    <iframe src="f?p='+apexAppId+':103:'+apexSession+'::NO:103:P103_SUBNET_ID:'+subnetIDNumber+'
    "width="875" height="500" title="View Subnet Details" frameborder="no"></iframe></div>' 
    $(document.body).append(vRuleBox); 
    $("#ViewNetworkDetailsBox").dialog({ 
                            buttons:{"Cancel":function(){$(this).dialog("close");}}, 
                            stack: true, 
    modal: true,                             
                            width: 950,                     
    resizable: true, 
    autoResize: true, 
    draggable: true, 
    close : function(){$("#ViewNetworkDetailsBox").remove(); 
                            location.reload(true); } 
    }); 
    }); 
    } 
    </script> 
    PS My hypothesis is that there is a problem with this part of my script
    var subnetIDNumber = document.getElementById(#SUBNET_ID#); 
    where I can't get my "SUBNET_ID" value from
    javascript:ViewNetworkDetails(#SUBNET_ID#);
    in 'subnetIDNumber' variable and that's why I can't spend my iFrame URL.

    P.S. P.S. the child page 103 has a "Automated row fetch", is not a problem. In addition, I did a simple test, where I had a page element 'P102_Value' with values and in my script I had instead
    var subnetIDNumber = document.getElementById(#SUBNET_ID#); 
    This
    var subnetIDNumber = $v('P102_Value'); 
    and it worked perfectly fine... but cannot operate against the SQL Select statement :-(

    HEEEEEEEEEEEEEELLLLLPPPP.
    Thank you

    Change your column to link to send the value of the subnet_id column to the function call (you mentioned, but I don't know if you've actually done m)

    JavaScript:ViewNetworkDetails(#SUBNET_ID#);

    You pass the value of the parameter to the function, but not defined all the parameters in the function definition (this is possible in JS, no other parameter is ignored)
    For example, to change the function to accept the subnet ID parameter (I'm really surprised how you missed it) and assign this parameter to a variable.