SELECT - DECODE -- Conditional image-display with " " or " "

Hi!
I want to show a traffic sign conditionally. If the DATE is less than (<) today - 1 than show the red light, else show the green light.
Below is my code. The code works with the hard-coded date. But is it possible to do it with "<" and ">"?
select     "DATE" as "DATUM",
     "STOCK" as "STOCK",
     DECODE(DATE, '07.02.2008 15:44',
'<img src="#WORKSPACE_IMAGES#green.JPG">',
'<img src="#WORKSPACE_IMAGES#red.JPG">') AS "SIGN"
from     "TBL_STOCK"
Thanks so much,
Elisabeth

Elisabeth,
you can also just do a
SELECT DATE AS DATUM
     , STOCK
     , CASE
         WHEN DATE &lt; SYSDATE - 1 THEN 'red'
         ELSE                         'geen'
       END        AS SIGN
  FROM TBL_STOCKwhich is probably easier to read.
Hope that still helps
Patrick
My APEX Blog: http://www.inside-oracle-apex.com
The ApexLib Framework: http://apexlib.sourceforge.net
The APEX Builder Plugin: http://apexplugin.sourceforge.net/ New!

Similar Messages

  • Image displayed with MapViewer , need to control

    Hi we have a Image ( a Map of Network) displayed on the browser with the help of MapViewer .
    Now we have a requirement of controlling it .(Means upon left click and Right click of Mouse we need our functionality to get executed) .
    How can this be done ??
    Please help .
    Edited by: Jai7881 on Jun 12, 2009 11:43 AM

    Hi
    you can use mapviewer's oraclemaps.js to add this functionality.
    there are some examlpes you can find at http://yourmapviewerhost:port/mapviewer/fsmc/tutorial/demos.html
    also, try accessing API doc for mapviewer http://yourmapviewerhost:port/mapviewer/fsmc/apidoc/index.html
    Michael

  • Apex_item select list to be displayed with multiple default values

    I am using APEX 4.2.
    For one of our requirements , we are displaying a report which uses "apex_item.select_list_from_query" multiselect field.
    The above function accepts a parameter, 'p_value' using which we can specify the default value to be highlighted.
    Is there any way to highlight multiple values on the select list by default, when the page is loaded, based on a sql output.
    Sample Scenario:
    Say colour is a multiselect field. Full list of values available : R, B, G, Y, O
    On day1, for record1 i am choosing R and B. which I am saving in the backend when the page is submitted.
    On day2 : I login again to see the report. When the report is loaded, I should see the values 'R' and 'B' highlighted or in a different font format , differentiated from the rest.
    Thanks in advance for your replies.
    Regards,
    Raasi
    Edited by: 878815 on Mar 11, 2013 10:23 PM

    878815 wrote:
    I am using apex_item.select_list_from query. and then a piece of javascript to concatenate as a colon delimited string. This is the function I am using in the report sql,
    apex_item.hidden(20,null)||apex_item.select_list_from_query(6,null,'<sql>','multiple size = "6" onChange="Multi(this)"','NO' ) as col_1I think 'multiple size' is a custom attribute and APEX have no clue about it.
    javascript code:
    function Multi(p_this)
    var l_selected=html_SelectValue(p_this);
    if (l_selected.constructor == Array) l_selected=l_selected.join(':');
    p_this.parentNode.firstChild.value = l_selected;
    return l_selected;
    };What is this apex_item.hidden used for.. placeholder?
    May be populate the hidden item with default value as colon delimited string and on page load use some JavaScript to read that string and set/highlight the select list.
    It would be easy if you can replicate the issue on apex.oracle.com

  • Image displaying with blocked out areas

    Hi - I am new to these forums so I hope this is the right place for this.  I downloaded an image of a web template to look at the colours more closely before possibly purchasing it and when I opened the image in CS4 it had a bunch of triangular blocked out areas - kind of like a mask of some sort I think.  I then tried creating a new document and opening an existing, unrelated PSD file and now they have the same triangular blocked out areas.  Help please!!!

    Sorry for the delay - I tried uninstalling and reinstalling without success... I also opened a different pre-existing .PSD and it had a different display issue than this one.  The image below is from a new document creation, but the same pattern still showed up in a document that I had initially opened.
    4

  • How do I select one record when working with image data sets?

    David Powers had an example with creating spry data sets and using the filename in the database linked to images in the local files as data sources.  The pages shows the images with the specified information requested, however all of the images display with their content.  I want to pull an individual record with the image and content. HELP!
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $maxRows_rs_getPhoto = 10;
    $pageNum_rs_getPhoto = 0;
    if (isset($_GET['pageNum_rs_getPhoto'])) {
      $pageNum_rs_getPhoto = $_GET['pageNum_rs_getPhoto'];
    $startRow_rs_getPhoto = $pageNum_rs_getPhoto * $maxRows_rs_getPhoto;
    mysql_select_db($database_gepps1_db, $gepps1_db);
    $query_rs_getPhoto = "SELECT last_name, first_name, personal_bio, file_name, width, height FROM mem_profile";
    $query_limit_rs_getPhoto = sprintf("%s LIMIT %d, %d", $query_rs_getPhoto, $startRow_rs_getPhoto, $maxRows_rs_getPhoto);
    $rs_getPhoto = mysql_query($query_limit_rs_getPhoto, $gepps1_db) or die(mysql_error());
    $row_rs_getPhoto = mysql_fetch_assoc($rs_getPhoto);
    if (isset($_GET['totalRows_rs_getPhoto'])) {
      $totalRows_rs_getPhoto = $_GET['totalRows_rs_getPhoto'];
    } else {
      $all_rs_getPhoto = mysql_query($query_rs_getPhoto);
      $totalRows_rs_getPhoto = mysql_num_rows($all_rs_getPhoto);
    $totalPages_rs_getPhoto = ceil($totalRows_rs_getPhoto/$maxRows_rs_getPhoto)-1;
    ?>
    <table width="800" border=" ">
      <tr>
        <td>Image</td>
        <td>thumbnail</td>
        <td>firstname</td>
        <td>lastname</td>
        <td>personal bio</td>
      </tr>
      <?php do { ?>
        <tr>
          <td><img src="<?php echo $row_rs_getPhoto['file_name']; ?>" alt="" width="<?php echo $row_rs_getPhoto['width']; ?>" height="<?php echo $row_rs_getPhoto['height']; ?>"></td>
          <td><img src="<?php echo $row_rs_getPhoto['file_name']; ?>" alt="" width="50" height="35"></td>
          <td><?php echo $row_rs_getPhoto['first_name']; ?></td>
          <td><?php echo $row_rs_getPhoto['last_name']; ?></td>
          <td><?php echo $row_rs_getPhoto['personal_bio']; ?></td>
        </tr>
        <?php } while ($row_rs_getPhoto = mysql_fetch_assoc($rs_getPhoto)); ?>
    </table>
    <?php
    mysql_free_result($rs_getPhoto);
    ?>

    I tried pulling the record by using entered value, but then I would need to create several recordsets.
    It's actually no problem doing that.  Can you explain more what you want the final result of this page to display? You are pulling a recordset of the entire group of photos.  Do you still want that comprehensive recordset on this page?  How many other images do you want?  Are you trying to make a master/detail pair where this page displays only the details for a single image?  See what I mean?

  • Go back to old image display

    I just updated to Firefox 11 and the new image display is awful. When I go to an image URL (like this http://www.google.com.br/images/srpr/logo3w.png ) it's displayed with a dark background. It would be better if the background was soft grey... but it's too dark!
    Is there a way to use the old image display, with white background or changing the background color?

    <strike>I don't think that you can use code in userContent.css to fix this</strike>.<br />
    <strike>There is no selector possible to set the background-color for the body if there is only an img (body > img:only-child) on that page.<br />
    Only a script would be able to accomplish that AFAIK.</strike>
    It looks that I'm wrong about this.
    *http://userstyles.org/styles/58710/firefox-11-change-image-view-background
    *http://forums.mozillazine.org/viewtopic.php?f=38&t=2443535
    Add this code to userContent.css in the chrome folder
    *http://kb.mozillazine.org/userContent.css
    <pre><nowiki>@-moz-document regexp("((.*\\.(png|apng|jpg|jpeg|gif|tiff|bmp))|(^data:image\\/.*))(\\?([^#]*))?(#(.*))?") {
    html > body { background-color: #E8E8E8 !important; }
    html > body > img:only-child { background-color:#fff !important; box-shadow: none !important; margin: 0 !important; }
    </nowiki></pre>
    * resource://gre/res/TopLevelImageDocument.css

  • Selecting data from single table with different condition in single query

    Hi everybody...
    I have one table with col1, col2, col3, col4, col5... as columns.
    I want to select col1, col2, col3 with condition (x=y and a=b and c=d)
    I want to select col4, col5 with condition (x=y and a=b and m=n )
    in single query...
    Thanx for ur help

    Given this data set...
    SQL> select * from oddity
      2  /
          COL1       COL2       COL3       COL4       COL5 A X C M
             1          2          3          4          5 B Y   M
             1          2          3          4          5 A Y C N
             1          2          3          4          5 A Y D M
             1          2          3          4          5 A Y D N
             1          2          3          4          5 B Y D N
             1          2          3          4          5 B Y D U
    6 rows selected.
    SQL>The following query meets the requirements. Of course, the requirements as stated are incomplete. I ahave assumed that we select all five columns if C=D andM=N.
    SQL> SELECT decode(c, 'D', col1, '0') AS col1
      2         , decode(c, 'D', col2, '0') AS col2
      3         , decode(c, 'D', col3, '0') AS col3
      4          , decode(m, 'N', col4, '-8') AS col4
      5           , decode(m, 'N', col5, '-8') AS col5
      6  FROM oddity
      7  WHERE a = 'B'
      8  AND  x = 'Y'
      9  /
          COL1       COL2       COL3       COL4       COL5
             0          0          0         -8         -8
             1          2          3          4          5
             1          2          3         -8         -8
    SQL> Cheers, APC

  • Displaying thumbnail images inline with a report

    Hi,
    I have a table with data and one column which is a text image filename. This image file resides on another server. I currently have a cgi that takes the image filename as a parameter and returns the image be viewed in a browser. I've been able to create a report where the image file name was a hyperlink that opens the image in the browser. I've also been able to create a static html page that can display the image inline with the APEX page, but the html is hardcoded.
    My desire is to have the thumbnail appear inline with the report in its own column. Is this possible? I've seen it in some demos, but the images were stored in the database or the database servers filesystem.

    Yes, it is possible.
    I did just that.
    Here what I did
    SQL> desc dept
    Name Null? Type
    DEPTNO NOT NULL NUMBER(2)
    DNAME VARCHAR2(14)
    LOC VARCHAR2(13)
    PICS VARCHAR2(20)
    PICS hold the file name of the image, I name my thumbnail and the picture with the same name but store in different directories under HTTPHOME/images, name pics and thumbail
    I created an interactive report in APEX
    select
    "DEPTNO",
    "DNAME",
    "LOC",
    '<img src="#IMAGE_PREFIX#thumbnail/'||"PICS"||'" border="0">' AS PIC_LINK
    from "DEPT"
    In the interactive report attribute, I set the "DISPLAY TEXT AS" for PIC_LINK as "Standard Report Column"
    If you are using XDB, you need to re-copy you images(This part I don't like) to database every time you change/add/delete an image.
    If you are using HTTP server, then that it is.
    I am looking for a way to dynamically show the thumbnail with providing an image file in APEX. So,that I don't have to use 2 files
    --John                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Image slideshow with filmstrip display problem

    I'm not sure whether this is the right discussion group for this and therefore if it is wrong I apologise.
    Using Dreamweaver CS5 under Windows XP I've developed a new website and tested it to my satisfaction. I've now started to deploy the pages to my new live site. The majority of the deployment has been just using the Synchronize Sitewide facility. As far as I can see everything is working as expected except for one page.
    This uses the Spry Image Slideshow with Filmstrip - Basic:#ImageSlideShow. In my development site the varying size pictures display with the picture and black background. In my live page when selecting a new image parts of the previous image are still showing. Can anyone please advise what I should change or need to do for the pictures to display correctly?
    The live page can be found at http://baughen.co.uk/HarryBaughan.html
    The above snapshot illustrates the error.
    Thanks
    Cliff
    Level -  novice++

    Thanks for the suggestion but this code was already in at line 4.
    The pan and zoom seems to have kicked in since my last change (I went back and deleted the widget and then reinserted). The problem is less noticeable unless you click on the individual thumbnails. Is there any straightforward documentation on how to manage the pan and zoom, even if it is just to remove it?
    Thanks
    Cliff

  • When I try to move from one selected image to selecting a different image, lightroom (new install of Lightroom 5.5) will keep the previous image selected, so I always end up with two selected images - why?

    For example, I will select the first image in my grid view, then let's say I want to work on the fifth image. When I click on the fifth image, Lightroom leaves image one selected, as if I have held down the Command or the Shift key to select multiple images.  This is not what I expect. Then I am forced to command click the image I no longer want selected - this happens every time I try to move to any new image - the previous one(s) stay selected.  I have tried a reboot of my machine but still this happens.  Also, as a further bug, if I leave my grid with no images selected at all, after a few seconds Lightroom automatically selects the first two images in my library and highlights them - without my even pressing a key!  This is really weird behaviour. It's really frustrating as I like to use my keyboard arrow keys to move through my library of images, but when Lightroom keeps two images selected it just ping pongs between those two images.  I deselect and try to move on, and it again leaves the previous image selected!  By the way - I am not in Compare mode while this is happening - just in standard browsing of the library...  Help please!
    kind regards,
    oMac

    For example, I will select the first image in my grid view, then let's say I want to work on the fifth image. When I click on the fifth image, Lightroom leaves image one selected, as if I have held down the Command or the Shift key to select multiple images.  This is not what I expect. Then I am forced to command click the image I no longer want selected - this happens every time I try to move to any new image - the previous one(s) stay selected.  I have tried a reboot of my machine but still this happens.  Also, as a further bug, if I leave my grid with no images selected at all, after a few seconds Lightroom automatically selects the first two images in my library and highlights them - without my even pressing a key!  This is really weird behaviour. It's really frustrating as I like to use my keyboard arrow keys to move through my library of images, but when Lightroom keeps two images selected it just ping pongs between those two images.  I deselect and try to move on, and it again leaves the previous image selected!  By the way - I am not in Compare mode while this is happening - just in standard browsing of the library...  Help please!
    kind regards,
    oMac

  • In bridge i select a jpg image with cntrl r to open in camera raw but get "camera raw not avail"

    In bridge i select a jpg image with cntrl r to open in camera raw but get "camera raw not available"  camera raw editing requires that a qualifying product has been launched at least once to enable this feature.  I can open nef. in camera raw with no problem.

    Hm, what I suggested might actually be a possibility then...
    Close whatever version you have open first...
    I think Adobe installs shortcuts for both 32 and 64 bit Photoshop in the start menu.
    If you can't find the 32 bit Start menu entry, look for the 32 executable here (changing the CS version number to whatever yours is):
    C:\Program Files (x86)\Adobe\Adobe Photoshop CS5\Photoshop.exe
    -Noel

  • Flickering problem with live viewing with IMAQ Image Display

    Hi everyone,
    I am trying to write a program to do live imaging with Andor camera. I am using some examples from Andor. The images are acquired in sequence and send into IMAQ Image Display and also Intensity Graph. There is minimal flickering issue in the Intensity Graph but there is very bad flickering problem in IMAQ Image Display. Perhaps I misunderstand how to optimize the vision tools. Does anyone know how to overcome this issue? I have attached the code that I am testing. Thanks in advance.
    Best regards,
    Han Yen
    Solved!
    Go to Solution.
    Attachments:
    iXonRTA_live_0.0.1.vi ‏70 KB

    You can use Vision Assistant to test our vision functions. Vision Assistant is really meant to prototype - it does not have all teh functionality of Vision Development Module and is not as flexible as we don't allow you access to all the settings for every function.
    I recommend starting in Vision Assistant and then porting over to LabVIEW or C (whatever you are most comfortable with)...this is built-in functionality. There is nothing wrong with using Vision Assistant to do live imaging, just that you run into limitations and you will only be able to use this code on computers that have Vision Assistant.
    Hope this helps.
    --Michelle
    Instrument Control R&D
    National Instruments
    Instrument Control
    Machine Vision

  • Image files with large pixel dimensions display out of focus in a Bridge viewer?

    I Create image files with pixel dimensions 2048x1365. When I display these files from Bridge on my Mac, either by pressing the space bar or in a slideshow, the images are out of focus. If I left click or click/hold and move the images slightly on screen they display in sharp focus. Unfortunately, although landscape-orientation images display correctly with no change in position or size, portrait-orientation files are enlarged and display with top and bottom off the screen. The pixel dimensions of my monitor are 2450x1600 so, yes, if portrait images are displayed at 100% they should display off screen, but this does not excuse the out of focus display of landscape files on this large screen. Nor does this explain why the portrait files are out of focus when they fit on screen. When the same files open in a Camera Raw window they are in focus. When they open in Photoshop at 100% the files are in focus.

    Hi, Clay. Photoshop.com has its own forum, so you might want to post this there:
    http://forums.adobe.com/community/photoshopdotcom

  • Can I make an image display instead of flash slideshow on explorer with high security?

    I am a total flash beginner.  I created a simple flash slideshow that I want to appear on my website.  It works fine in firefox., but when viewed in explorer with high security, nothing displays unless the viewer specifically allows it. The slideshow is very prominent, and the site looks very bad when only an x shows up.   Is it possible to have a static image display in place of the slideshow, and then have the slideshow start if the viewer allows it? Is there any other way to get around this? 
    Thank you for any assistance.
    EJ

    Have you tested it with IE online or only locally?  Locally IE will usually prohibit displaying Flash content.

  • Have trial version of lightroom images display in library and 'before' in developer, but can't display full image to develop.  Shows as a blue box with a white X on it.

    I have downloaded and installed Lightroom for a 30 day trial. Library works fine, but when I try to edit images in Develop, I can't see the full size image just a blue box with a white X on it.  If I switch on to Before & After mode, the image displays fine in the before, but still just blue box in the 'after'.  Can't find any answer to this anywhere!  Please help as my trial days are running out.

    Lightroom CC - blue box in develop module

Maybe you are looking for

  • Help with very slow connection if apple tv linked to wireless apple keyboard

    My husband and I trying to connect the wireless Apple keyboard to our Apple tv so we can get rid of the pesky and cumbersome Apple tv clicker. However, when we do so, our connection slows to a crawl and we cannot access sites like Netflix et al. We d

  • Problem in module pool with table control scrolling

    hi, i am using the table control in module pool,in the table control i have radion button for all the rows. After i got the data into the table control ,if i select radio button and if i press vertical scroll bar button, that radio button is deselect

  • Ios 7.0.2 issue: how to stop running programs

    I am a new iPhone5 user and just installed ios 7.0.2 (maybe I should not have but I did). Now I don't know how to stop running programs. Previously I double-clicked the Home button, then saw the icons that represented running programs, then could lig

  • Insert File Path into Text Field

    I am trying to create a text filed at the bottom of a form document that will automatically input the file path (e.g.. C\:Folder\File) of the document itself after the document is saved.  I've looked at a few Scripts but nothing seems to be working. 

  • USD reflecting in Web form

    Hi All, Entire Webform is refelcting with USD, i have not selected as "enable multicurrency" while creating the form. Can somebody tell me how is it reflecting automaticaly. It very important for me to resolve this issue ASAP. Thnks