Using Decode or some other function

Hello,
I have two tables.
Table 1 is the data table where i have the following fields
Time Field the values are Jan, Feb....Dec
Data1 field has a data in USD
Data2 field has a data in Local Currency
Table 2 is Currency Convertion table The fields in this table are as follows:
Jan is a field
Feb is a field
My query should be
Table1 From Time field value Jan and Data1 * Table2 and Field Jan
What is the best statement that i can use to get the results.
Thanks in Advance!

You mean something like:
SQL> With Table1 as (select 'Jan' as Mn, 10000 as data1, 1200 as data2 from dual union all
  2                  select 'Feb', 13000, 1500 from dual)
  3      ,Table2 as (select 1.75 as Jan
  4                       , 1.80 as Feb
  5                       , 1.70 as Mar
  6                       , 1.65 as Apr
  7                       , 1.72 as May
  8                       , 1.77 as Jun from dual)
  9  -- END OF TEST DATA
10  SELECT t1.Mn, t1.data1, t1.data2,
11         t1.data1 * CASE t1.Mn
12                      WHEN 'Jan' Then t2.Jan
13                      WHEN 'Feb' Then t2.Feb
14                      WHEN 'Mar' Then t2.Mar
15                      WHEN 'Apr' Then t2.Apr
16                      WHEN 'May' Then t2.May
17                      WHEN 'Jun' Then t2.Jun
18                    ELSE 1
19                    END as conversion
20  FROM Table1 t1, Table2 t2
21  /
MN       DATA1      DATA2 CONVERSION
Jan      10000       1200      17500
Feb      13000       1500      23400
SQL>

Similar Messages

  • Microsoft word is not responding.  I get this message every time I want to close Word or do some other functions such as change margins or print.  I'm using OSX on a imac.  What do to?

    Microsoft word is not responding.  I get this message every time I try to close a Word document or do some other functions such as change margins or print.  I just get the twirling ball.  I'm using OSX on a imac.  What do to?

    Bummer! The only way I have ever been able to get rid of the dreaded twirling ball was to reboot....with the exception of one time only, when it actually was some super techie issue that was only resolved when they looked at it and did their magic.
    Sorry I couldn't be of more help!

  • A function to announce or to do some other functions when a dataset is loaded successfully?

    What is the function to listen to the data and announce or do
    some other functions when the data is loaded successfully and ready
    to use?
    I've tried the getDataWasLoaded() but I must do it manually,
    or use it with the setTimeOut() function to check, this really
    unuseful.
    Thanks for all your help.

    U can use observers for that, the observer onPostLoad
    indicates that the data is ready to be processed.
    u can find the info in this document;
    http://labs.adobe.com/technologies/spry/articles/data_set_overview/index.html

  • REM and some other functions

    Why REM and some other functions can't be used in HTML sql panel
    What the source of this limitation ?
    Thank you

    253164,
    SQL*Plus script commands are not supported in the SQL Workshop command processer. You can enter SQL, PL/SQL, and '/' terminators only.
    Scott

  • TtyS4 and ttyS5 how do I activate using 'setserial' or some other way

    Is there a 'setserial' expert in the house?
    I've got a daughter board/card that has a bunch of I/O on it.  All devices work except the two serial ports.  I have 4 serial ports on the main board plus these two on the daughter board for a total of 6 serial ports.  The 4 ttyS* on the main board work but I can't get /dev/ttyS4 and /dev/ttyS5 to work.  (these serial ports on this exact hardware work on Solaris 10 x86)
    Here's what I've tried / found out so far:
    Using 8250.nr_uarts=6" parameter to boot options in /boot/grub/grub.conf so once booted there is /dev/ttyS4 and /dev/tty5 (in addition to the standard ones).
    Now I want to use "lspci -v" to find UART device info for ttyS4 and ttyS5 so I can use 'setserial' to specify port, interrupt and so on.  This is where I run into trouble.  I see from a block diagram from the manufacturer of the hardware that there are two Exar DUART chips: XR17D152 DUART for ttyS2 and ttyS3, and a XR16L2551 DUART for ttyS4 and ttyS5.  Problem is, when I do a 'lspci -v' only the  XR17D152 DUART for ttyS2 and ttyS3 shows up.  'lspci -v' does not report anything for the XR17D152 DUART, which is for ttyS4 and ttyS5.  I look at a block diagram of the daughter board where the XR17D152 DUART is and see it is NOT on the main bus but under a PLX  PCI9656  I/O accelerator chip.  I do see the info for the PCI9656 chip when I 'lspci -v' but not the DUART that's attached to it.  With nothing to lose,  I tried using the 'lspci' info from the PCI965 I/O accelerator as parameters to setserial for ttyS4 and ttyS5, but of course that didn't get results. Furthermore I see when I 'dmesg | grep tty' that that serials ttyS2 and ttyS3 use MMIO, which I'm not sure that 'setserial' can specify MMIO, only port IO.
    # lspci -v - output that shows the I/O acceler
    04:05.0 Serial controller: Exar Corp. XR17C/D152 Dual PCI UART (rev 02) (prog-if 02 [16550])
            Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
            Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
            Interrupt: pin A routed to IRQ 17
            Region 0: Memory at 80503000 (32-bit, non-prefetchable) [size=1K]
            Kernel driver in use: serial
    02:01.0 Bridge: PLX Technology, Inc. Device 9601 (rev ba)
            Subsystem: PLX Technology, Inc. Device 9656
            Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
            Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
            Interrupt: pin A routed to IRQ 7
            Region 0: Memory at 80160000 (32-bit, non-prefetchable) [size=512]
            Region 1: I/O ports at 3000 [size=256]
            Region 2: Memory at 80040000 (32-bit, non-prefetchable) [size=128K]
            Region 3: Memory at 80060000 (32-bit, non-prefetchable) [size=128K]
            Capabilities: [40] Power Management version 2
                    Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-)
                    Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
            Capabilities: [48] CompactPCI hot-swap <?>
            Capabilities: [4c] Vital Product Data
                    Unknown large resource type 35, will not decode more.
    #dmesg | grep tty - this output shows that ttyS2 and ttyS3 use MMIO, there is no info for the XR16L2551, because it's not detected.  I need to know how to tell the kernel about it.
    [    2.008167] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    [    2.033915] serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
    [    2.074052] 00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
    [    2.100632] 00:09: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
    [    2.110283] 0000:04:05.0: ttyS2 at MMIO 0x80503000 (irq = 17) is a XR17D15X
    [    2.116775] 0000:04:05.0: ttyS3 at MMIO 0x80503200 (irq = 17) is a XR17D15X
    Questions:
    -  XR16L2551 DUART (serial ttyS4 and ttyS5) is not detected by 'lspci -v'  Can I find it some other way?  Does it have a known MMIO? A way to probe for it’s MMIO?
    - Can setserial specify MMIO for ttyS4 and ttyS5 once I find out what it is?
    - Since the XR16L2551 resides under a PLX Technology PCI9656  chip which IS found by 'lspci -v' can I use memory info from it to probe for the  XR16L2551, or can I even use the 'lspci' info from the PLX chip as parameters to 'setserial?
    - How can I get these serials, ttyS4 and ttyS5 to work?
    Last edited by Mogombus (2012-04-06 22:54:24)

    lizziepaige wrote:
    ... having nothing but problems ...
    See your other posts...
    https://discussions.apple.com/message/20666642#20666642
    https://discussions.apple.com/message/20666702#20666702

  • Confused about wheather to use session or some other technology

    i have two jsp pages one is index.jsp and other one is display.jsp,from index.jsp i am passing a string value and collecting it in display.jsp ,after collecting it i am making use of that value in a sql query to display the result from the data base,and i am getting one line (row) of display ,when i repeat the process again that row is over written which i do not want , what i want is as long as i keep sending strings from index.jsp tp disply.jsp the number of rows should be added (as a display in display.jsp)
    and i wanted to do that in jsp environment only as i am not aware of struts and some other technology.some sample code of display.jsp is as follows
    String INDENT_NUMBER = request.getParameter("indent_number");
    query1="select some data from some tables where a.INDENT_NUMBER = '"+INDENT_NUMBER+"'";
    while(rs.next){
    get some values here to display
    like
    String item_name =rs1.getString("item_name");
    String INDENT_QUANTITY=rs1.getString("INDENT_QUANTITY");
    here i want to display row wise data
    and now close the while loop
    please get me the idea if possible with sample code,i'll be greatfull to u,
    thanx

    I would add the String you get from the DB to an ArrayList, and store that ArrayList in the session. Then, at time of display, just iterate over the List. I would also look into putting the SQL into a JavaBean that does the work. Take as much of that code out of the JSP as possible.

  • Can we able to purchase ipod touch in US and use it in some other country? will there be any issues?

    Have anyone tried purchasing in US and using it in India?

    You shouldn't have any problems recharging if you have the correct recepticle conversion plug for the AC adapter you purchase in the US. I've used and charged my IPOD touch 3G in US, UK, China, Israel, Australia, Greece, Hungary, Czech Republic and several other countries including ships.

  • Detecting UNKNOWN truth values using IIF or some other means

    Hi,
    I'm researching how to handle UNKNOWN truth value in my CHECK constraints, but I just want to know in general how to tell if an arbitrary boolean expression is TRUE, FALSE, or UNKNOWN, without having to specially rewrite the boolean condition to mean unknown.
    The IIF() function returns the 2nd argument if the 1st argument is TRUE, and the 3rd argument if the 1st argument is FALSE or UNKNOWN.  So the only way I can think of to specifically find the UNKNOWN ones is to try IIF() with <boolean_expression>
    and NOT(<boolean_expression>).  If it takes the 3rd argument both times, that means it's UNKNOWN.
    Is there a better way
    -- Returns 0
    SELECT CASE WHEN NULLIF(IIF(1 < 2, 'T', 'F') + IIF(NOT(1 < 2), 'T', 'F'), 'FF') IS NULL THEN 1 ELSE 0 END IS_UNKNOWN
    -- Returns 1
    SELECT CASE WHEN NULLIF(IIF(NULL < 2, 'T', 'F') + IIF(NOT(NULL < 2), 'T', 'F'), 'FF') IS NULL THEN 1 ELSE 0 END IS_UNKNOWN
    I'd want to replace an arbitrary boolean expression in the formula and just out if it is UNKNOWN.

    this?
    DECLARE @Param1 int=2
    DECLARE @Param2 int = 2
    SELECT IIF(@Param1 IS NULL OR @Param2 IS NULL,'Unknown',IIF(@Param1<@Param2,'True','False'))
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Some problems using some Matlab functions

    Hello,
    I have some trouble with MathScript when i want to use some MATLAB functions in it such as unique or histc. (i'm using windows 7 and LV2010 SP1)
    These functions are theoretically supported by MathScript insofar as they exist in MathScript Documentation but they return an error. This error explains that my matrix sizes are invalid but when we are doing exactly the same process with the same matrix in MATLAB, it ends well.
    So I checked the two MATLAB and MathScript documentations in order to see if there is a difference between the same functions. It is proving to be the same functionning in MathScript and in MATLAB so I am a little lost.
    In order to show you a concrete example :
    If we have a X matrix equals to (77 77; 88 96) and we are doing unique(X). The result is supposed to be (77 88 96) but mathscript returns an error.
    On the other hand, if X is not a matrix but a vector, unique ends well but i'm not interested in using some vectors (because it is exactly the same kind of problem with some others functions using only matrix).
    I could use a matlab node script but in this project, we would to avoid the use of a Matlab Licence.
    Do you have some idea in order to fix this kind of problem
    Thanks a lot

    Hi,
    Currently, the unique(X) in MathScript can accept vector input only. It reports error when X is a matrix. As a workaround, you can use
    unique(X(:))
    instead.

  • Using DECODE Function in SQL

    I need to know if there is any way to use a range of values from
    database and decode to certain text. I am able to do with one
    value.
    for example:
    DECODE(column_name,'216767111','Unlimited',column_name)
    above argument works with one value only. How about a range,
    ex: 216767000 to 216767111. I need to use only SQL. No PL/SQL.
    Kinldly need some body's help
    Thanks
    Munis

    Which version of the database? If it's 8i+ then you can use
    the CASE function
    for example:
    (CASE WHEN column_name between 216767000 and 216767111
    THEN 'Unlimited' ELSE column_name END)
    This won't work in PL/SQL because they're introducing a CASE
    statement does soemthing different.
    rgds, APCHello Andrew
    Thank you for response. I am using 8i. 8.1.6. However using
    CASE, I get inconsistent data type, ORA-00932: inconsistent
    datatypes. I able to work it out with other response using
    DECODE(sign(. Do you have any idea why i am getting this error.
    If time permits, let me know

  • How to use decode function

    Hello Friends,
    I have a query that has different columns and I am not sure what the data type of each column is ...
    I want to use decode function which displays the following if the value of the column is like this ..
    if the value of column is -714E ie -700000000000000 then display as .A
    if the value of column is -814E ie -800000000000000 then display as .B
    NOTE ; don't know which column is having the value - and i don't know the data type of the column is ..
    got to use the decode function for all the columns selected ..
    I want to use decode function pls let me know how to write for this kind of requirement.
    appreciate your help in this rgds.
    thanks/kumar

    Dear Sir / Madam,
    Thanks for your understanding.
    Right now I am facing a unique problem.
    I am using decode function in a select statement. The columns are dynamic some columns are of type number and some are varchar datatypes. I want to apply decode function for every column irrespective of datatype.
    What i am finding difficult is if the column is a number datatype , the decode funciton is working good but if the column datatype is varchar or char datatype then i am getting ..
    here's the decode function..
    decode (CHAI.EVNDRIVE,
    -800000000000000,'.A',
    -700000000000000, '.B',
    -600000000000000 ,'.C',
    -500000000000000 , '.D',
    -400000000000000 , '.E',
    -300000000000000 , '.F',
    -200000000000000, '.G',
    -100000000000000 , '.H',
    -1000000000, '.R' ,CHAI.EVNDRIVE ) EVNDRIVE
    report error:
    ORA-01722: invalid number
    pls let me know how to over come this kind of scenario.
    is their a way to find whether the column datatype is number or char , so that i can check the column datatype before the decode funciton is applied ..
    thanks ..
    kumar

  • How  to exclude columns dynamic using group functions or any other function

    i have a select that look like this
    SELECT *
      FROM (SELECT DISTINCT gruposcomerciales.cod_gcomercial,
                            gruposcomerciales.descripcion,
                            DECODE (:0,
                                    'OFICIAL', pbeoficialesjerarquia.oficial_id,
                                    NULL
                                   ) oficial_id,
                            DECODE (:0,
                                    'BANCA', NULL,
                                    pbeoficialesjerarquia.id_cluster
                                   ) id_cluster,
                            pbeoficialesjerarquia.cod_banca
                       FROM grupos_comerciales gruposcomerciales,
                            clientes clientes,
                            clientes_oficiales clientesoficiales,
                            pbe_oficiales_jerarquia pbeoficialesjerarquia,
                            bancos_clientes bancosclientes
                      WHERE gruposcomerciales.cod_gcomercial =  bancosclientes.cod_gcomercial
                        AND clientes.ID = bancosclientes.cliente_id
                        AND clientes.ID = clientesoficiales.cliente_id
                        AND bancosclientes.cliente_id = clientesoficiales.cliente_id
                        AND bancosclientes.entidad_id = clientesoficiales.entidad_id
                        AND clientesoficiales.oficial_id = pbeoficialesjerarquia.oficial_id
                        AND gruposcomerciales.cod_gcomercial <> 'SINGRUPO100'
                        AND clientesoficiales.tipo_oficial = 'PRINCIPA'
                        AND bancosclientes.estado_clientes_ibs = 'ACTIVO') qrslt
    WHERE (cod_banca = :1 AND id_cluster = :2 AND oficial_id = :3)This SQL duplicate rows so i use a distinct to exclude duplicate rows and decode to set null for columns that not are interested at runtime to avoid duplicate rows
    I use decode to dynamicly set null (a way fo not show duplicate rows from colums)
    If :0 is OFICIAL its show 3 columns values for oficial_id,cod_banca,id_cluster
    if :0 is CLUSTER its show 2 columns values for cod_banca,id_cluster
    There is a way to group by columns without take in consideration duplicate rows of other columns

    If i do my query passing pameters to [b]OFICIAL_ID, ID_CLUSTER, AND COD_BANCA get this info
    COD_GCOMERCIAL  DESCRIPCION                          OFICIAL_ID ID_CLUSTER COD_BANCA
    ==============  ===========                          ========== ========== =========
    GRUPOALC1149     GRUPO ALCAP                          JESS329     39        BANCAEMP
    GRUPOALQ533     GRUPO ALQUILERES NACIONALES          JESS329     39        BANCAEMP
    GRUPOANA649     GRUPO ANA MARIA CHEN                 JESS329     39        BANCAEMP
    GRUPOANC253     GRUPO ANCON                          JESS329     39        BANCAEMP
    GRUPOARI104     GRUPO ARIAS Y DE LA GUARDIA          JESS329     39        BANCAEMP
    GRUPOATL813     GRUPO ATLAS CORPORATION              JESS329     39        BANCAEMP
    IF I pass parameters to ID_CLUSTER, AND COD_BANCA i get
    COD_GCOMERCIAL  DESCRIPCION                          OFICIAL_ID ID_CLUSTER COD_BANCA
    ==============  ===========                          ========== ========== =========
    GRUPOALC1149     GRUPO ALCAP                                    39        BANCAEMP
    GRUPOALQ533     GRUPO ALQUILERES NACIONALES                    39        BANCAEMP
    GRUPOANA649     GRUPO ANA MARIA CHEN                           39        BANCAEMP
    GRUPOANC253     GRUPO ANCON                                    39        BANCAEMP
    GRUPOARI104     GRUPO ARIAS Y DE LA GUARDIA                    39        BANCAEMP
    GRUPOATL813     GRUPO ATLAS CORPORATION                        39        BANCAEMP
    IF I pass parameters to COD_BANCA i get
    COD_GCOMERCIAL  DESCRIPCION                          OFICIAL_ID ID_CLUSTER COD_BANCA
    ==============  ===========                          ========== ========== =========
    GRUPOALC1149     GRUPO ALCAP                                            BANCAEMP
    GRUPOALQ533     GRUPO ALQUILERES NACIONALES                            BANCAEMP
    GRUPOANA649     GRUPO ANA MARIA CHEN                                   BANCAEMP
    GRUPOANC253     GRUPO ANCON                                            BANCAEMP
    GRUPOARI104     GRUPO ARIAS Y DE LA GUARDIA                            BANCAEMP
    GRUPOATL813     GRUPO ATLAS CORPORATION                                BANCAEMPMy decode on select do this functionality of set null to columns because there are sometimes in wich oficial_id or id_cluster get rows
    that i dont need take in consideration.
    this get overhead on my select and on 10g using inline views by dblink not work fine
    this decode on my select do this functionality
    decode('OFICIAL', 'OFICIAL' , pbeoficialesjerarquia.oficial_id, NULL) oficial_id,
    decode('OFICIAL', 'BANCA' , NULL, pbeoficialesjerarquia.id_cluster) id_cluster,
    So i know oracle has a lot off grouping function some of this should help me to get this work
    Tnx Warren

  • Problem using DECODE() function with a Query of Queries

    I
    posted
    on my blog about an issue I was having trying to use the PL/SQL
    DECODE() function with a Coldfusion Query of Queries. This function
    works fine when you query a database for information. However, when
    you query another query, it seems that CF doesn't recognize it. I
    got errors stating that it found a left parenthesis where it
    expected a FROM key word. Here is a simplified version of what I am
    trying to do:
    quote:
    <!--- Simulated query; similar to what I was calling from
    my database --->
    <cfscript>
    qOriginal = queryNew("Name,Email,CountryCode",
    "VarChar,VarChar,VarChar");
    newRow = queryAddRow(qOriginal, 5);
    querySetCell(qOriginal, "Name", "Joe", 1);
    querySetCell(qOriginal, "Email", "[email protected]", 1);
    querySetCell(qOriginal, "CountryCode", "AMER", 1);
    querySetCell(qOriginal, "Name", "Sally", 2);
    querySetCell(qOriginal, "Email", "[email protected]", 2);
    querySetCell(qOriginal, "CountryCode", "AMER", 2);
    querySetCell(qOriginal, "Name", "Bob", 3);
    querySetCell(qOriginal, "Email", "[email protected]", 3);
    querySetCell(qOriginal, "CountryCode", "ASIA", 3);
    querySetCell(qOriginal, "Name", "Mary", 4);
    querySetCell(qOriginal, "Email", "[email protected]", 4);
    querySetCell(qOriginal, "CountryCode", "EURO", 4);
    querySetCell(qOriginal, "Name", "John", 5);
    querySetCell(qOriginal, "Email", "[email protected]", 5);
    querySetCell(qOriginal, "CountryCode", "EURO", 5);
    </cfscript>
    <cfquery name="qCountries" dbtype="query">
    SELECT DISTINCT(CountryCode) AS CountryCode,
    DECODE(states, "AMER", "North America &amp; Canada",
    "EURO", "Europe &amp; Africa", "ASIA", "Japan &amp;
    Asia","") CountryName
    FROM qOriginal
    ORDER BY CountryCode
    </cfquery>
    <cfdump var="#qCountries#">
    <!--- ========== END OF CODE ========== --->
    So running this returned the following error:
    Query Of Queries syntax error.
    Encountered "(. Incorrect Select Statement, Expecting a
    'FROM', but encountered '(' instead, A select statement should have
    a 'FROM' construct.
    Does anybody know why this doesn't work? Is it just not
    supported? Please note that I have also tried to use the CASE()
    function instead of DECODE() and that resulted in basically the
    same error. For now I an looping over my distinct query with a
    switch statement and manually loading a new query with the data how
    I want it. But it would be a lot cleaner and less code to have the
    DECODE() to work. Thx!

    DECODE() is an Oracle function, not generic SQL. Q-of-Q is a
    very limited subset of SQL and lacks many functions and clauses
    available in standard SQL, especially what you may be used to using
    in your particular RDBMS.
    See
    Query
    of Queries user guide
    Phil

  • How to use decode function in oracle apex 3.2.1

    Hello Friends,
    how to use decode
    var_decode := 'decode'||'('|| var1 ||','|| -800000000000000||','||'.A'||','||
    appreciate your help.
    regards/kumar
    Edited by: kumar73 on Apr 23, 2010 12:25 PM
    Edited by: kumar73 on Apr 23, 2010 12:27 PM

    Hey just on this particular point, there's a handy PL/SQL method for escaping quotation characters which may reduce the complexity of the string.
    For example, if I had a string:
    I can't understand why quoting my 'quote' characters never seems to "work"!and I wanted to pass that into a variable, I could do this:
    vc_foo:= 'I can''t understand why my ''quote'' characters never seems to "work"!';or I could use the q function, whereby you enclose your string within a quote delimiter of your choice, like so:
    vc_foo:= q'^I can't understand why quoting my 'quote' characters never seems to "work"!^';
    note: I used the caret (^) character by convention but any valid character will do
    ...all of which leaves your original string more or less unadulterated.
    I find this particularly useful for generating dynamic SQL and dynamic PL/SQL, as it leave the query looking a tad more readable, although if you are chaining together multiple strings with double-pipes, it can make it a little muddier. I find it particularly useful if I'm going to deal with string data from, for example, a field with Irish-derived surnames such as "O'Reilly"...
    Give it a go!

  • How to use DECODE function in Exspression?

    Hi,
    Can we use DECODE in Expression?
    I'm trying to use DECODE function but there is an error during the validation. But when i validate the mapping, it is successfully compiled but it is failed during deployment.
    But if I use CASE instead of DECODE, it works fine.
    Can we use DECODE in OWB???
    Thanks
    Raj

    Hi,
    In OWB 10gR2, if your are using only one DECODE in an expression, it's working. The package will compile when deploying the mapping. OWB will replace the DECODE by a CASE.
    But when you are using nested decode in an expression ( for example : decode(col1, 1, 'M', decode(col2, 'Madame', 'Mme', null)) ) only the first one is replaced by a case at deployment.
    In ROW_BASED mode, text of the expression is used outside of an sql statement and deployment will fails with "PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL statement only."
    If operating mode for the mapping is set to SET_BASED, it's working because the expression is used in an sql statement.
    I have logged a SR in metalink for this issue and a bug is opened (bug 5414112).
    But I agree with you, it's better to use case statement.
    Bernard

Maybe you are looking for