Case expression many cases

Hi all,
I am creating a Java application that - among other useful things - needs to change the values of the DB according a to a huge (maybe > 1000 mappings) , user-created (through the UI) mapping like the one below:
DB Value  UI Value
a --> A1
b --> B2
c --> C3
d --> D4
e --> E5
f --> F6
So, if my SELECT contains the column that needs its values changed (the values on the left), I need to somehow get the values on the right.
Normally, I would create a table with this mapping and use it in my query to have it return the values I need. However, I cannot do this, because I don't have (and will not get) privileges to create tables or procedures.
* One solution that comes into my mind is to generate through Java a query with a HUGE case expression, with a case for each mapping. But this does not seem right.
* Another thing I could do is make the query return the DB value and in my application I could do this mapping.
Is there a more elegant way to do the mapping without creating a table in the DB?
Thanks,
Markos
Edited by: user622271 on Jun 23, 2009 6:42 AM

Your best bet is a lookup table. If you do not have privilege to create a lookup table for some reason, then you should be allowed to create a view.
I am not sure how many mappings you will finally have, but it sounds like too much to DECODE. But in a simpler circumstance, you could use DECODE directly in your application SQL or use it to create a view then access the view from your application instead of the table.
SELECT DECODE(db_value,
              'a','A1',
              'b','B2',
              'c','C3',
              'd','D4',
              'x','Xn') ui_value
FROM table_name
/If you are lucky to have your db_value exist with some kind of pattern, then you can reduce the number of lines with some pattern matching.

Similar Messages

  • AirPort Express - many questions

    Hi there.
    I hope you guys can help me with a few problems:
         1. Do i have to wire the AirPort Express from my wi-fi router, or is an ethernet cable from a non-wi-fi modem good enough?
         2. My amplifier is an old "Beomaster 2000". It has a 5-DIN input. I guess I'm going for a 5-DIN to 3,5 jack cable?
         3. If the jack output on the AirPort Express is ocupied, can i connect my Sony TV to it? I want my Sony TV sound to go through monitors hooked up to the beomaster 2000. Or what kind of solution should i go for? Jack from TV to phono-in on the Beomaster?
    I hope that is not too complex, and I hope you have some answers!

    MagnusPalu wrote:
    http://www.av-cables.dk/minijack-til-2xphono/standard-minijack-til-2xphono-kabel -0-2-m.html
    Is this a "phono plug"? I'm not from the States, so unfortunately, no fancy Walmarts.
    No don't use that one.
    The only thing I am uncertain about is which input your TV is using. If it is using Tape 1 then it is easy and all you need is a 3.5mm male to male audio cable such as this (buy an appropriate length though):
    http://www.av-cables.dk/minijack-kabler/standard-minijack-til-minijack-kabel-0-2 5-m.html
    If that is similar to the cable your TV is already using you will need this
    http://www.av-cables.dk/din-adapter/5p-din-2-x-phono-hun-lydkabel-0-2-m.html
    and this
    http://www.av-cables.dk/phono-til-minijack/standard-minijack-til-2xphono-kabel-0 -5-m.html
    ...unless you can find one cable already with those connectors.

  • Itunes/ express failure

    Hello, I`ve downloaded the latest version of itunes and when connecting to my airport express, I get "Unknown error code -3256"..... and no connection.
    I`ve had itunes for years, had the usual glitches and have tried to sort this one out, spent all day going thru` the sites trying to find clues. I`ve restarted the express many times and can always get onto it.... just itunes cannot. What am I missing,
    Regards, Mike.

    I also have this problem. I'm using an airport express that is my main wi-fi connection. When I go to a friend's place who has an airport express, but is not the main connection (it is only used for iTunes and not for the internet), I am able to play my music over her system.
    I had read that firewall settings could cause this. I'm using Intego Netbarrier, but my settings are set to allow iTunes play over an Airport network.

  • Common table expression

    Hi,
    In DB2, there is a concept called 'common table expressions'.
    A common table expression is like a temporary view that is defined and used for the duration of an SQL statement. You can define a common table expression for the SELECT, INSERT, and CREATE VIEW statements. Each common table expression must have a unique name and be defined only once. However, you can reference a common table expression many times in the same SQL statement.
    Eg :--
    insert into test1 with test_view1(column2) as (select colum1 * 2 from test2) select column2 from test_view1;
    Here 'test_view1' is a temporary view created with a select statement. This view has the scope only within this SQL statement. The data inserted into the table 'test1' is selected from the temporary view.
    This can be achieved in Oracle by creating views and then using the INSERT .. SELECT statement. But I like to know whether any direct equivalent available for this in Oracle, something like 'INSERT .. WITH <view_name>' as in DB2.
    Please advise,
    Thanks,
    Smitha

    Er...you mean like this?
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    JServer Release 9.2.0.6.0 - Production
    SQL> INSERT INTO emp
      2     WITH v_emp AS
      3          (SELECT empno + 1, ename, job, mgr,
      4                  hiredate, sal, comm, deptno
      5           FROM   emp)
      6     SELECT *
      7     FROM   v_emp;
    14 rows created.
    SQL> No, nothing like that whatsoever.

  • Dynamic expression evaluater

    I have a dynamic expression of this sort:
    { (( A || B ) && ( C || D )) || E }
    where A,B,C,D,E...(and so on) are boolean variables and the operators between them keep changing.
    How can i do this through some methods?

    If the expression is valid java syntax, then consider writing a piece of code that writes a piece of java with a method containing your expression, and where the letters in the expressions are local variables.
    Then invoke the compiler on the generated code using Runtime.exec, load the class and use it.
    How fast is this process you might ask? The slowest I have seen was one and a half second on a 550 MHz PIII W2K PC, the fastest was down around 0.01 second, on a recent Athlon with SCSI disks and Linux.
    Of course as soon as the class is loaded it is a method call like any other one, so if you want to invoke the expression many times with different values the runtime cost is only the cost of as many method calls, you don't have to regenerate the java again until you change the expression.
    You can trade simplicity of implementation for load time speed by generating the class file directly without using java source code as an interim format. O'Reilly has a book on how to write "assembler" for the JVM that explains how to do this. You won't be touching the disk system at all, but will be writing the bytes of a class definition directly to the ClassLoader.defineClass method

  • Airport Express suddenly stopped working Error (-15006) But Green Light On

    Hi There,
    I have had my airport express for a few years and I use it to stream music from my macbook to my hifi.
    However all of a sudden i stopped being able to see the drop down for the speakers in the bottom of itunes.
    I have reset the airport express many times and reconnected it to my network which sometimes allows the speaker dropdown in itunes.
    However when I get to that stage it tries to connect to my remote speakers for ages then eventually it times out or i get the error (-15006).
    When tht happens the drop down menu goes completley.
    I have now upgraded to itunes 9.0 and it still happens.
    Please help I am getting very frustrated!

    Sorry guys, I don't mean to give you a hard time, and I know I'd feel the same as you if it was my kit that was fried. Think I must have just finished reading the iPod nano article, where Apple has been slated for refusing to replace nano's that have surface scratches, even though they're still under warranty. It sounded like the usual story, consumer has purchased it, put it in their back pocket, sat down on it, put it through the washing machne and wondered why it was scratched. Funnily enough, I've kept mine in a old sock when not in use, and I've never been so stupid as to put it in my back pocket, clean it once a month and it's still as good as new.
    Doesn't help your issue though, but an EU directive might. Not sure when it came into force, and I can't remember which articles it refers to explicitly, but consumer electrical goods sold in the EU must carry a minimum 3 year guarantee. I think that only applies to "white goods", fridges, washing machines, etc. But there was another part where they must have a minimum guarantee period of 2 years, for more general electrical goods.

  • Usage function in Quark Express

    In Quark Express many moons ago I regularily used a feature called Usage whereby you could see where any rogue colours or fonts where being used in a large document. This was very handy for finding where Pantone colours had be brought into a document from an external file and then being able to go back and change them into the correct CMYK colours. Does anyone know if there is a similar option in InDesign as I really need to use it!

    The Package dialog will also give you a font list and used process and spot colors—you can view the info and cancel:

  • Confused with regual expressions

    Hi all,
    Many many thanks for your help so far. This is one more
    question
    I am trying to contruct a regula expression that will remove
    from a text inpu ttwo characters: a) any panctuation (? commas,
    etc) b) remove any white space at the end of the line. This is what
    i have so far:
    on mouseDown (me)
    m = sprite(me.spriteNum).member
    re ="(/\s+$/ +\W)" -- regexpression describing what you want
    to remove
    m.text = RegExp_Replace(m.text, re, " ", "g")
    end
    Nothing seems to happening! Any ideas what is wrong with it?
    I suspect that something must be wrong with the regular expression
    itself (i am completely new at these regular expressions)
    Many thanks

    Hi,
    Glad you worked it out. Just on a side note, remember not to
    confuse 'strings' with field and text members ie
    aMember = member("foo")
    aString = aMember.text
    aString = "abcdef"
    aMember.text = aString
    (it can get confusing becuase fields can - much of the time -
    be referred to as if they are a string as well as a member with a
    text property)
    Cheers,
    Luke

  • Aperture/Final Cut Express

    Hi
    Anybody out there got any idea if the Aperture plug-in "Aperture to Final Cut Pro" will work with Final Cut Express
    Many thanks in anticipation
    Steve

    Apparently not. Read the last line in this post:
    http://fcpdaily.com/2010/04/fcp-free-aperture-to-final-cut-pro-plug-in/

  • Final Cut Express/Aperture

    Hi
    Any body out there got any idea if the Aperture plug-in "Aperture to Final Cut Pro" will work with Final Cut Express
    Many thanks in anticipation
    Steve

    from: http://connectedflow.com/aperturetofinalcut/
    +System Requirements+
    +Aperture to Final Cut Pro requires Mac OS X 10.4 or later and Aperture 1.5.1 or later.+
    +Exported sequences require Final Cut Pro 5.1.2 or later.+
    +Aperture to Final Cut Pro does not work with Final Cut Express.+

  • Why my airport express dont find my network

    My airport express be conected to my airport extreme succesfully, but, a day, after reset my network, the airport express dont find a new network.
    I conected by ethernet, but dont work.
    I reset airport express many times and dont find.
    I dont know why dont worklokes new.

    The main problem is that airport utility can't find my express

  • Airport Express not connecting to Broadband router

    Dear Apple lovers,
    I have been stuck with an issue for the past few weeks, and i hope that your experience can help me sort out the connectivity issues.
    Infrastructure:
    Telco-provided Broadband modem router provides the internet connectivity. it connects to the house rooms thru data points.
    I have an Extreme setup as a extender to the broadband router (becuase the rooms are far way from the broadband router, i have to do extend the wireless..)
    The Extreme has been working fine for the past 2 years, even after the broadband modem router has been upgraded.
    However, the Express started giving problems as soon as the broadband modem router was replaced.
    I have tried resetting the Express many times, i've tried creating a new Network (they ask for PPOE settings which creates endless loops), creating it as an extender to the Broadband and even to the Extreme. So i've tried all options, and i'm not sure where to start looking for answers (searched this forum many times..)
    Issue is that the Express is the furthest away from the Broadband, and if the room doors are closed, the Express has to rely on the Ethernet connection to the broadband for connectivity. Which makes me think that the right installation option to choose is " set up as an extender to Broadband modem" Is this correct?
    With the doors closed, the express cant reach the extreme too (extreme is in another room). 
    I have an iMac, iPhone and iPod that has been suffering from no WiFi for the past month.. we're like in rehab for Internet addiction.. Hope there's a kind soul out there who can point out the right direction to follow (chose which option), or to diagnose the problem, and eventually solve it.
    There's also intermittent issues with setting up the express, it just cant be configured. But it still blinks orange and green(sometimes). So i dont think the express needs to be changed..
    Thanks in advance for the help  ( if any.. ) 
    Have a nice day!

    I didn't understand how you had the setup and configuration.
    You have a modem router combination device that is creating a wireless network, an AirPort Extreme that is extending the wireless network, and an AirPort Express that is also extending the network?

  • Airport Express is recognized in AirPort Utility but will not connect.

    I just bought a brand new Airport Extreme from Best Buy yesterday and have it set up perfectly. However, now my Airport Express (that I use to stream music to my stereo via Airtunes) will not connect. I have reset the Airport Express many times and it still won't connect. Here is what is crazy... the Airport Express is recoginized within the AirPort Utility, however when I click 'Continue' I get this message:
    "Warning: Are you sure you want to switch wireless networks? Setting up this Apple wireless device requires switching networks. Switching networks may interupt your connection to the Internet"
    I click 'OK' and I get this message "Connecting To Network' Connecting to network 'Apple Network 08ded7'. Please wait..."
    Than the message disappears and I stay on the same screen I started from (I don't advance to the next setup screen... repeat and it does the same thing.
    I've disabled my firewalls and still no luck. Also, the Airport Express shows an Orange light both on the device and the AirPort Utility.
    Anyone know what the deal may be?
    Thanks in advance!!

    Not sure why, but I installed the Airport Utility software on a differnt PC and was able to get the Airport Express configured and working just fine now. Hmmmmm...
    So nice to have my music playing again - love Airtunes!

  • Current  day in month view

    In month view, I used to be able to see the current day in a slightly colored box. now all days are all in white. off to the left there is a blue box around the current day but I would like the big view to have the color. It makes it difficult for your eye to be drawn right to the current day.

    In my iCal, the current day is just ever so slightly shaded a light shade of blue. This "concern" has been expressed many times, so I think expressing your thoughts to Apple is the best you can do for now: http://www.apple.com/feedback/ical.html

  • NW2K4SP9 login problem & availability of Evaluation S/W for BI Practise

    Hello Experts
    nice to meet u all: here I’m expressing my queries:
    To Practice BI I tried to install NW2004 SP16 & SP9 Sneak Preview
    1. Newly I installed the <b>S/W NetWeaver2004 SP16 Sneak Preview</b>. It was installed fine and works very fine, but it’s useful for Enterprises Portal. Again I tried to Install the <b>S/W NetWeaver 2004 SP9 Sneak Preview</b> on my PC
    System: Intel 2.4GHz, 1Gb Ram, OS: Windows2003 Server EE,
    after installed the OS, I set the page file system, Ms Loopback Adaptor and keep the details: IP Address 192.168.100.1, subnet mask and system name in the file "hosts" , installed the IIS for safety purpose,
    installed the j2sdk1.5 and set path(Environmental details), after completed all the activities as above start the NW2004 SP9 full java version installation. It was installed successfully. But after successful installation, I tried to start the MMC as rClk: <b>2JE</b> start all programs in MMC, pop up windows asks for authentication enter the password, I entered the password as "abcd1234"(as I used to enter in every situation, in the installation procedure for authentication for MAXDB etc..). but authentication was not passed and it gives the message "credentials are not valid"
    According to this query please give me the details of what is credentials, if there is credentials, what are those and give me the details and if any wrong in my installation procedure please rectify me and suggest me.
    My second Query is the :
    2. To practice the SAP-Business Intelligence, what is the freely available (Trail or Evaluation version) version Software, from where it can be download and what are the step by step procedures to install that software. if any body knows please give &sent the details to my mail ID: <b><REMOVED BY MODERATOR></b>
    I am very very thankful to u all for
    step by step procedures:
    System configuration: Intel pentium4-2.4GHz, 1Gb RAM, 160Gb HDD(12GB for OS, 40GB for SAP ...)
    - Installed the OS Windows2003, Ms-Office 2003, MotherBoard Drivers WinRar, IIS,
    - after installation of above all installed the Ms Loopback Adaptor with IP Address 192.168.100.1.
    - installed the Java:j2sdk1.5,
    -after all these installed the SAP with password abcd1234 wherever required in installation. procedure was followed through the installation procedure given with the S/w
    -installation of IDE for GUI
    - MAXDB and sql also.
    in this my long query I expressed many queries in one, because presently who are trying to enter & practice Sap-BI, those are all don't know the details of these all, if any professionals gone through this long query patiently and give me the details and procedures (in the mean time please send me the clear step by step procedure of Installation), it will definitely helpful for those and all. I will give full points to who are given the valuable information. Thanq for all my senior professionals
    Regards
    Sarath
    <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

    Hello Sarath,
    perhaps I can help you with question number 1:
    The password you have to enter there is from the user you're actually logged on at the moment.
    So if for example "administrator" is written in the first line of the pop up window you have to enter the password of the local administrator of your windows machine and not from the administrator of the portal.
    And perhaps a little advise for the future:
    In SAP environments please use the latest 1.<b>4</b>.x Java version and not Java 1.<b>5</b>.x. Only the 1.4.x version is certified and tested by SAP at the moment.
    I hope you get it running - good luck 
    Regards,
    Norman

Maybe you are looking for

  • How to display data in SelectOneChoice from database?

    Hi, I want to display data in SelectOneChoice component after fetching from database in a bean using Application module implementation class. I have two fields in my bean id and name. I want to display name in choice and in backend i want to play wit

  • Resetting PIX 515E 'enable' password and/or Factory Reset

                       We have a PIX Firewall where the last user of the device had not changed the 'enable' password and username so we are locked out of the device. I did some research and found a password reset tool that was supposed to clear the 'ena

  • DynamicRFCException with JCO.client problem

    Hi, Iam trying to execute an RFC from webdynpro.Iam getting the following error.So as a result i dont get any result as expected on my screen as the RFC is not getting executed due to JCO problem.Please kindly let me know the reason.In the last line

  • Can I use 667mhz ram in a 800mhz ram machine.

    I have a MacPro1,1 and a MacPro3,1. Can I move use the 667mhz ram from the earlier machine into the "newer" machine which uses 800mhz ram. I am going to recycle the old machine when Mountain Lion comes out and it has a lot of ram in it. Hate to lose

  • AD object security inheritance getting disabled

    Hi, I am observing few uses are having security inheritance issue and AD administrators are losing their permissions on these user objects. Inheritance is getting removed automatically after some time even after setting it manually as per below scree